aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-mips.c
diff options
context:
space:
mode:
authorChris Demetriou <cgd@google.com>2004-06-14 18:25:10 +0000
committerChris Demetriou <cgd@google.com>2004-06-14 18:25:10 +0000
commit092dcd755dcdcf664b25a7011fd15957f124c29f (patch)
tree40fdd5b8b97cfcae50dc9ffbc93896575431b5bd /bfd/elf32-mips.c
parent700c15aa2af8978c0ad550457244837ecd2a27f7 (diff)
downloadgdb-092dcd755dcdcf664b25a7011fd15957f124c29f.zip
gdb-092dcd755dcdcf664b25a7011fd15957f124c29f.tar.gz
gdb-092dcd755dcdcf664b25a7011fd15957f124c29f.tar.bz2
[ bfd/ChangeLog ]
2004-06-14 Chris Demetriou <cgd@broadcom.com> * elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24 removal) with updated comment. (bfd_elf32_bfd_reloc_type_lookup): Add back case for BFD_RELOC_32_PCREL. (mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32. * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. [ include/elf/ChangeLog ] 2004-06-14 Chris Demetriou <cgd@broadcom.com> * mips.h (R_MIPS_PC32): Add back (undoing removal on 2004-04-24), with an updated comment.
Diffstat (limited to 'bfd/elf32-mips.c')
-rw-r--r--bfd/elf32-mips.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 63f1062..2e6eeb9 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -615,6 +615,25 @@ static reloc_howto_type elf_mips_gnu_rel16_s2 =
0xffff, /* dst_mask */
TRUE); /* pcrel_offset */
+/* 32 bit pc-relative. This was a GNU extension used by embedded-PIC.
+ It was co-opted by mips-linux for exception-handling data. It is no
+ longer used, but should continue to be supported by the linker for
+ backward compatibility. (GCC stopped using it in May, 2004.) */
+static reloc_howto_type elf_mips_gnu_pcrel32 =
+ HOWTO (R_MIPS_PC32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_PC32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE); /* pcrel_offset */
+
/* GNU extension to record C++ vtable hierarchy */
static reloc_howto_type elf_mips_gnu_vtinherit_howto =
HOWTO (R_MIPS_GNU_VTINHERIT, /* type */
@@ -1071,6 +1090,8 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
return &elf_mips_gnu_vtentry_howto;
case BFD_RELOC_16_PCREL_S2:
return &elf_mips_gnu_rel16_s2;
+ case BFD_RELOC_32_PCREL:
+ return &elf_mips_gnu_pcrel32;
}
}
@@ -1092,6 +1113,8 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
return &elf_mips_gnu_vtentry_howto;
case R_MIPS_GNU_REL16_S2:
return &elf_mips_gnu_rel16_s2;
+ case R_MIPS_PC32:
+ return &elf_mips_gnu_pcrel32;
default:
BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
return &elf_mips_howto_table_rel[r_type];