This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problem with linking static lib text into specific section
- From: Elad Yosef <elad dot yosef at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 4 Mar 2012 22:51:49 +0200
- Subject: Problem with linking static lib text into specific section
- Authentication-results: mr.google.com; spf=pass (google.com: domain of elad.yosef@gmail.com designates 10.68.125.233 as permitted sender) smtp.mail=elad.yosef@gmail.com; dkim=pass header.i=elad.yosef@gmail.com
Hi I have the following in my linker script:
I'm forcing to link the text and the rodata from libMy-Cli.a into a
specific section.
Now I have additional file libMy-GUI.a that I also want to link in similar way.
But It fails I get linking error that some addresses are out of the memory.
Is there more elegant way to what i'm trying to achieve?
#define SECTION_text(_region_, _vma_, _lma_) \
.text _vma_ : _lma_ \
{ \
_stext = .; _ftext = . ; \
*(EXCLUDE_FILE (*libMy-Cli.a) .text) \
*(EXCLUDE_FILE (*libMy-Cli.a) .text.*) \
*(.stub) \
*(.gnu.warning) \
*(.gnu.linkonce.t*) \
*(.mips16.fn.*) *(.mips16.call.*) \
} > _region_ =0 \
_etext = .; PROVIDE (etext = .);
#define SECTION_rodata(_region_, _vma_, _lma_) \
.rodata _vma_ : _lma_ \
{ \
FORCE_OUTPUT; \
*(EXCLUDE_FILE (*libMy-Cli.a) .rodata) \
*(EXCLUDE_FILE (*libMy-Cli.a) .rodata.*) \
*(.gnu.linkonce.r*) \
} > _region_
#define SECTION_statLib_text(_region_, _vma_, _lma_) \
.statLib_text _vma_ : _lma_ \
{ \
FORCE_OUTPUT; \
KEEP(*( SORT (.my.cli.table.*))); \
libMy-Cli.a (.text) \
libMy-Cli.a *(.text.*) \
libMy-Cli.a (.rodata) \
libMy-Cli.a *(.rodata.*) \
} > _region_
Thanks
Elad