embedded - How to link static library into specific section? -
i writing code embedded platform. need link 3rd party sdk. however, symbols sdk should go specific section (not .text
). possible that?
i use gnu-based toolchain xtensa-lx106 processor , build esp8266 chip.
to have modify linker script you're using.
you'll find in makefile in line links final binary. linker script file passed via -t
option.
once have this, open in text editor , search section
directive. you'll find group called .text
in lists sections should go final text segment.
you can add code-section name of sdk list. can use wildcards if sdk has multiple sections common prefix (that happends quite lot).
the same thing can done using .data
group , .bss
group if nessesary.
after these modifications can re-link executable , sections sdk library should go straight .text
, .data
groups.
if want to, can create new groups in memory
declaration @ top of linker file. gives direct control on exact address linker use. can redirect sdk library sections right new memory regions you've created , have libs @ same address.
Comments
Post a Comment