This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with linking static lib text into specific section
When I add the new lib the ld file has these changes
#define SECTION_text(_region_, _vma_, _lma_) \
.text _vma_ : _lma_ \
{ \
_stext = .; _ftext = . ; \
*(EXCLUDE_FILE (*libMy-Cli.a) .text) \
*(EXCLUDE_FILE (*libMy-Cli.a) .text.*) \
*(EXCLUDE_FILE (*libMy-ATP-GUI.a) .text) \ --- New LIB
*(EXCLUDE_FILE (*libMy-ATP-GUI.a) .text.*) \ --- New LIB
*(.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.*) \
*(EXCLUDE_FILE (*libMy-ATP-GUI.a) .rodata) \ --- New LIB
*(EXCLUDE_FILE (*libMy-ATP-GUI.a) .rodata.*) \ --- New LIB
*(.gnu.linkonce.r*) \
} > _region_
/* those linker changes are for Flash section */
#define SECTION_statLib_text(_region_, _vma_, _lma_) \
.statLib_text _vma_ : _lma_ \
{ \
FORCE_OUTPUT; \
KEEP(*( SORT (.ecos.cli.table.*))); \
libMy-Cli.a (.text) \
libMy-Cli.a *(.text.*) \
libMy-Cli.a (.rodata) \
libMy-Cli.a *(.rodata.*) \
libMy-ATP-GUI.a (.text) \ --- New LIB
libMy-ATP-GUI.a *(.text.*) \ --- New LIB
libMy-ATP-GUI.a (.rodata) \ --- New LIB
libMy-ATP-GUI.a *(.rodata.*) \ --- New LIB
} > _region_
I get the following error::::
/localhome/eCos/gnutools/mipsisa32-elf/bin/../lib/gcc/mipsisa32-elf/4.3.2/../../../../mipsisa32-elf/bin/ld:
address 0x80058264 of mars section .bss is not within region ram
/localhome/eCos/gnutools/mipsisa32-elf/bin/../lib/gcc/mipsisa32-elf/4.3.2/../../../../mipsisa32-elf/bin/ld:
address 0x80058264 of mars section .bss is not within region ram
collect2: ld returned 1 exit status
make: *** [mars] Error 1
**** NOTE ****
When I increase the size of the "ram" region it all goes well.
It Looks like that when I add the new Lib in the ld file it totally
ignores the sections of the both libs
and links them into the ram region and not into the specified section
that i have defined.
The only output that I see in my section is from
KEEP(*( SORT (.ecos.cli.table.*)));
command
Thanks
Elad
On Mon, Mar 5, 2012 at 7:01 AM, Ian Lance Taylor <iant@google.com> wrote:
>
> Elad Yosef <elad.yosef@gmail.com> writes:
>
> > 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?
>
> What is the exact error message?
>
> This general approach should work.
>
> Ian