This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold linker: Access section start & end address w/o using a linker script


Thanks Ian!
__start_SECNAME / __stop_SECNAME: I've been googling for something like this almost for hours…

That certainly answers my question for "project specific" section names. But I cant see yet how it solve my question for pre-defined sections like .sbss, .sdata, etc.? Is there another trick I don't know yet? E.g. can I create section-aliasses or something like that? (again, a short google session didn't give useful results)

Raphael

On Apr 21, 2013, at 7:42 PM, Ian Lance Taylor <iant@google.com> wrote:

> On Sun, Apr 21, 2013 at 9:04 AM, Raphael Zulliger <zulli73@gmail.com> wrote:
>> 
>> After having read several things about gold in the net, my impression is that gold mainly supports linker scripts to be backward compatible to the bfd linker. But the "gold style of linking" is to avoid using linker scripts. Am I roughly right with this conclusion?
> 
> Yes.
> 
>> The problem that arises when no linker script should be used is that our RTOS (and probably embedded system in general) requires to know the start address and end address of certain sections, such as data, sbss, etc. We need to know these addresses in order to create copies of these section during startup to support 'soft reset OS' features.
> 
> With both gold and GNU ld, if the name of the section is a valid C
> identifier (e.g., does not start with '.') then the symbols
> __start_SECNAME and __stop_SECNAME will be automatically defined by
> the linker and available for use by the program.
> 
> Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]