Possible problem with gas on MIPS
Koundinya.K
kk@ddeorg.soft.net
Thu Jun 8 04:45:00 GMT 2000
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 },
koundinya
-> > I would suspect that the shift for R_MIPS_PC16 has not been documented in
-> > the ABI or elsewhere and has just been missed out.
->
-> Yes, you're actually right. It has been missed out. We do shift the offsets
-> right by 2 when we link objects including R_MIPS_PC16 with gld. This is
-> however nothing we want to generate with gas. IRIX as is actually reluctant
-> to assemble branches to symbols as well. I think IRIX ld pukes on R_MIPS_PC16
-> whenever it gets the chance.
->
-> Ulf
->
More information about the Binutils
mailing list