In a gcc
linker file, how do you map all functions of all .obj
s in an archive to a certain section?
I know how to do it function-by-function inside the source file but I'd like to do it in the linker file by .obj
name.
I found this post in the gcc mailing lists but for me it's not working.
I modified my .ld
by copying what the poster did...
.dflash_code :
{
*archive.dlb: // this is my archive file
} >dflash
...but it didn't work.
When I add __attribute__((section(".dflash_code")))
to a function, amount of overflow the linker reports decreases so I know the linker is paying attention to the __attribute__
.
However, I'd really like to do it for an entire archive (that's the .dlb
).
I tried to do it just based on one .obj
file and even that doesn't work
.dflash_code :
{
*compile.doj //my object file
} >dflash
UPDATE
Actually, looks like it is working (kinda): it is outputting the contents of ATI_micropython.dlb
to .dflash_code
except for the .text sections.