Let's say I have a section in a linker script that describes some really fast ram:
.fastram __fastram_start : AT (__fastram_lma)
{
__fastram_start__ = ABSOLUTE(.) ;
*(.fastram.fastram*)
*fastram.*(.text* .data*)
. = ALIGN(4);
__fastram_end__ = ABSOLUTE(.) ;
} >fastram = 0x00
Normally we can do : __attribute__((section(".my_awesome_section"))) void do_something() and expect that the function will end up in that section. But what if I have a third party library I'm statically linking against and I want some of it's symbols to go into this fast ram section without modifying the original library? Is that possible?
So far I've tried redeclaring the functions I want added to this section with the same signature but with the attribute. But when I objdump it, my symbols are not where I want them to be.
While it doesn't directly answer the question, the solution I'm using to solve my issue is to patch the library using
FetchContent_Declare'sPATCH_COMMANDfrom this solution and adding the attributes to the source that way.