I'm using ARM GCC 10.2.1 20201103 and am running out of memory because I have an array of functions (short example below) and GCC is putting the array (or perhaps the functions) into RAM instead of .text.
The code looks like this:
static int16_t* (*func_arr[])(int16_t) = {
func1,
func2,
func3,
func4,
};
I've tried playing with attribute((section ("text"))), "static", "const", but I'm getting this message regardless:
motor6.elf section `._user_heap_stack' will not fit in region `RAM'
For every function I add to the array, I run out of memory by an additional 32 bytes or so, which makes me think the functions themselves are being put into RAM, though I'm unsure.
Anyone have ideas?
Each function I was including on the list was using static data. So for each function that I added to the list, that amount of static data was added to the RAM section. Resolving this just means that the functions referenced in the list need to declare their data const static instead of just static.