Possible problem with gas on MIPS

Ian Lance Taylor ian@zembu.com
Thu Jun 8 10:22:00 GMT 2000


   Date: Thu, 08 Jun 2000 17:21:14 +0530
   From: "Koundinya.K" <kk@ddeorg.soft.net>

   O.K, here is a tiny patch that I applied to get my assembler stuff compiling 
   for the same issue.

   Index: elf32-mips.c
   ===================================================================
   RCS file: /gnu/cvsroot/binutils-000213/bfd/elf32-mips.c,v
   retrieving revision 1.2
   diff -u -p -b -r1.2 elf32-mips.c
   --- elf32-mips.c        2000/06/08 08:23:45     1.2
   +++ elf32-mips.c        2000/06/08 10:13:49
   @@ -1843,6 +1843,7 @@ static CONST struct elf_reloc_map mips_r
      { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL },
      { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
      { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
   +  { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
      { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
      { BFD_RELOC_MIPS_GPREL32, R_MIPS_GPREL32 },
      { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },

Well, this patch can't be right.  Either BFD_RELOC_16_PCREL or
BFD_RELOC_16_PCREL_S2 can be translated to R_MIPS_PC16, but not both.
The two BFD relocations are significantly different; we can't possibly
translate them to the same R_MIPS relocation.

Which one is correct depends upon the definition of R_MIPS_PC16.

Ian


More information about the Binutils mailing list