Problem with linking static lib text into specific section
Elad Yosef
elad.yosef@gmail.com
Tue May 29 09:40:00 GMT 2012
Hi,
I have the following linker script
/* those linker changes are for Flash section */
#define SECTION_cliLib_tree(_region_, _vma_, _lma_) \
.cliLib_tree _vma_ : _lma_ \
{ \
FORCE_OUTPUT;\
KEEP(*( SORT (.ecos.cli.table.*))); \
}> _region_
#define SECTION_cliLib_text(_region_, _vma_, _lma_) \
.cliLib_text _vma_ : _lma_ \
{ \
FORCE_OUTPUT;\
libMars-Cli.a (.text) \
libMars-Cli.a *(.text.*) \
libMars-Cli.a (.rodata) \
libMars-Cli.a *(.rodata.*) \
}> _region_
#define SECTION_guiLib_text(_region_, _vma_, _lma_) \
.guiLib_text _vma_ : _lma_ \
{ \
FORCE_OUTPUT;\
KEEP(*( SORT (mars.syslog.table.*))); \
libMars-ATP-GUI.a (.text) \
libMars-ATP-GUI.a *(.text.*) \
libMars-ATP-GUI.a (.rodata) \
libMars-ATP-GUI.a *(.rodata.*) \
}> _region_
SECTION_cliLib_tree - is fine and has the data in want.
SECTION_cliLib_text - is bad is also has the text & rodata that I want
to be in SECTION_guiLib_text.
SECTION_guiLib_text - is bad it has only the syslog table from KEEP(*(
SORT (mars.syslog.table.*)));
Please help
Elad
On Tue, Mar 6, 2012 at 12:36 PM, Elad Yosef <elad.yosef@gmail.com> wrote:
> Hi,
> Don't ask me how but somehow it works now
>
> The original ld file with your fix
>
> Thank you very much
>
> Elad
>
> On Tue, Mar 6, 2012 at 7:43 AM, Elad Yosef <elad.yosef@gmail.com> wrote:
>> Hi,
>> I checked that by increasing the ram region size and found that both
>> libs text and rodata is linked in the wrong place.
>> It is linked into the ram region and not into my section.
>>
>> Thanks
>>
>> Elad
>>
>> On Tue, Mar 6, 2012 at 12:17 AM, Ian Lance Taylor <iant@google.com> wrote:
>>> Elad Yosef <elad.yosef@gmail.com> writes:
>>>
>>>> I have tried changing the exclude rule as suggested but still the same error.
>>>> Does my new section rules are O.K?
>>>
>>> Time to use the -M option to generate a map file to confirm that the
>>> data is going where you want it to.
>>>
>>> If your data is going where you want, and your memory region is
>>> overflowing, then you need to make your region larger or make your code
>>> smaller.
>>>
>>> Ian
More information about the Gcc-help
mailing list