This is the mail archive of the
mailing list for the binutils project.
Re: mis-elf-as : local/global symbol order in symbol table
Ian Lance Taylor wrote:
Pierre Habraken <Pierre.Habraken@imag.fr> writes:
The ELF specification states that table all local symbols in a symbol
should precede all global symbols.
mips-elf-as (binutils 2.20) disregards this rule.
Can anyone explain to me the reason for this ?
It's a historical issue. The SGI Irix 5 assembler did not follow this
rule, and the Irix 5 linker got confused when gas did try to follow
this rule. As I recall, Irix 5 thought the rule applied to
STT_SECTION symbols rather than to STB_LOCAL symbols. To work around
this we (or maybe just me) introduced all the elf_bad_symtab code.
Later this was extended to the IRIX_COMPAT and SGI_COMPAT code. We
can probably straighten out mips-elf-as if we try.
Thanks for your reply.
I do not know what are "elf_bad_symtab", "IRIX_COMPAT" and "SGI_COMPAT".
I assume that they are code chunks in binutils, are they ?
I have to precise that I am not a mips programmer. I just supervise a
student project in which students have to program an assembler or a
simulator. The mips architecture was choosen for educational reasons
(not for technical reasons). Several students ask us why the "official"
assembler (mips-elf-as !) does not conform to the ELF specification
(this is rather confusing for them). Hence my post.
Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
Tél: 04 76 63 59 94 - Fax: 04 76 51 47 93