kernel using gcc-5.3 fails to boot right

Adrian Chadd adrian at freebsd.org
Sat Aug 20 01:06:11 UTC 2016


[snip]

http://people.freebsd.org/~adrian/mips/20160819-mips-elf-reloc-gcc-5.3-3.diff

This has the debugging output removed and includes the relevant bits
from the current "authoritative" (as far as I'm aware) documentation
on what MIPS relocations are doing, including the GNU "extensions".

I say extensions because binutils says this:

  /* The combined value is the sum of the HI16 addend, left-shifted by
     sixteen bits, and the LO16 addend, sign extended.  (Usually, the
     code does a `lui' of the HI16 value, and then an `addiu' of the
     LO16 value.)

     Scan ahead to find a matching LO16 relocation.

     According to the MIPS ELF ABI, the R_MIPS_LO16 relocation must
     be immediately following.  However, for the IRIX6 ABI, the next
     relocation may be a composed relocation consisting of several
     relocations for the same address.  In that case, the R_MIPS_LO16
     relocation may occur as one of these.  We permit a similar
     extension in general, as that is useful for GCC.

     In some cases GCC dead code elimination removes the LO16 but keeps
     the corresponding HI16.  This is strictly speaking a violation of
     the ABI but not immediately harmful.  */

...




-adrian


More information about the freebsd-mips mailing list