I have a question related to the gcc linker.
I work with embedded material (PIC32), but the PIC32 compiler and linker are gcc-based, so the basic things should be normal for a โregularโ gcc linker and PIC32 linker.
To save flash space (which is often not enough on microcontrollers), I need to add some large functions to the bootloader, and the application should call these functions only with pointers.
So, I need to create a vector table in the generated code.
I try to get the absolute address of the function and write it to the generated code, but still get errors.
In the example below, I am trying to get the address of the _formatted_write function.
the code:
.user_addr_table _USER_ADDR_TABLE_ADDR : { KEEP(*(.user_addr_table)) LONG((ABSOLUTE(_formatted_write))); } > user_addr_table
The link returns an error: " unresolvable symbol '_formatted_write' referenced in expression ".
I noticed that if I write a little garbage instead of _formatted_write , then it will return the error " undefined symbol ..... ", so _formatted_write is known to the linker.
It makes me think that I have to follow some extra steps to make it "solvable." But I still donโt know how to do it.
source share