This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: mis-elf-as : local/global symbol order in symbol table
- From: Ian Lance Taylor <iant at google dot com>
- To: Pierre Habraken <Pierre dot Habraken at imag dot fr>
- Cc: binutils at sourceware dot org
- Date: Sun, 25 Apr 2010 11:16:01 -0700
- Subject: Re: mis-elf-as : local/global symbol order in symbol table
- References: <4BD313B9.6000709@imag.fr>
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.
Ian