Subject: Re: EGCS enabled on mips
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Todd Whitesel <toddpw@best.com>
List: tech-toolchain
Date: 11/01/1998 18:23:39
> Maybe i misunderstod the source. Mouse, could you take a look at the
> fucntion _bfd_mips_elf_lo16_reloc in usr/src/gnu/dist/bfd/elf32-mips.c?
...
> i dont knoww what the SGI assembler/ABI constraitns are here.
> Maybe they permit (foul) code like
> lui reg, %hi(sym); addiu reg %lo(sym + <small-constant>),
Oh man, I think I see what's going on here now.
Early MIPS boxes ran SVR3, so they almost certainly used COFF. In that
case the assembler/linker pretty much had no choice but to support the
groveling behavior -- COFF relocations assumed that the immediate bits
in the instruction were available for little offsets.
What do you want to bet that the ELF MIPS code is heavily derived from
the old COFF MIPS code?
Unless I'm missing something really obvious, any toolchain using ELF
should not need the groveling behavior unless they permit the (foul)
code example given above, FOR BACKWARD COMPATIBILITY in the assembler.
Todd Whitesel
toddpw @ best.com