This is the mail archive of the binutils@sources.redhat.com 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: gas rearranging elf file symbols


Exactly. I see these two interpretations of the wording: Either there
can be just (at most) one such symbol (for the main source file), which
is the way gcc handles it. Or there can be multiple of them, each one
preceding the local symbols resulting from that file. But I cannot
interpret the wording in a way that would make it match the current
implementation.

Jan

>>> Alan Modra <amodra@bigpond.net.au> 08.10.04 08:29:29 >>>
On Fri, Oct 08, 2004 at 03:23:19PM +0930, Alan Modra wrote:
> the correct file.  You can't do better for globals of course, since
> global symbols are placed after local symbols, losing any
association
> you might infer from the symbol ordering.

Actually, you can't do much about local symbols either.  The ELF gABI
says:

STT_FILE
    Conventionally, the symbol's name gives the name of the source
file
    associated with the object file. A file symbol has STB_LOCAL
    binding, its section index is SHN_ABS, and it precedes the other
    STB_LOCAL symbols for the file, if it is present.

>From that wording you could also infer that there should only be one
file symbol, that of the main source file.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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