aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-mips.c
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2003-05-22 09:27:52 +0000
committerThiemo Seufer <ths@networkno.de>2003-05-22 09:27:52 +0000
commitd0c728db63fdac4cd4b02fef0275b45399d46059 (patch)
treec3275f11871ed912956e3eb3a7418d0ca3d23477 /bfd/elf64-mips.c
parenta105a3009ce56aa3c7b8bb076d02db7f64e24ed4 (diff)
downloadgdb-d0c728db63fdac4cd4b02fef0275b45399d46059.zip
gdb-d0c728db63fdac4cd4b02fef0275b45399d46059.tar.gz
gdb-d0c728db63fdac4cd4b02fef0275b45399d46059.tar.bz2
* elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
R_MIPS_GNU_REL16_S2 support. (bfd_elf64_bfd_reloc_type_lookup): Use it. (mips_elf64_rtype_to_howto): Use it. * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used R_MIPS_GNU_REL16_S2 support. (bfd_elf32_bfd_reloc_type_lookup): Use it. (mips_elf_n32_rtype_to_howto): Use it.
Diffstat (limited to 'bfd/elf64-mips.c')
-rw-r--r--bfd/elf64-mips.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 6e7321c..a43b3da 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1227,6 +1227,38 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto =
0, /* dst_mask */
FALSE); /* pcrel_offset */
+/* 16 bit offset for pc-relative branches. */
+static reloc_howto_type elf_mips_gnu_rel16_s2 =
+ HOWTO (R_MIPS_GNU_REL16_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_GNU_REL16_S2", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE); /* pcrel_offset */
+
+/* 16 bit offset for pc-relative branches. */
+static reloc_howto_type elf_mips_gnu_rela16_s2 =
+ HOWTO (R_MIPS_GNU_REL16_S2, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MIPS_GNU_REL16_S2", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ TRUE); /* pcrel_offset */
+
/* Swap in a MIPS 64-bit Rel reloc. */
static void
@@ -1960,6 +1992,8 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code)
return &elf_mips_gnu_vtinherit_howto;
case BFD_RELOC_VTABLE_ENTRY:
return &elf_mips_gnu_vtentry_howto;
+ case BFD_RELOC_16_PCREL_S2:
+ return &elf_mips_gnu_rela16_s2;
default:
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -1983,6 +2017,11 @@ mips_elf64_rtype_to_howto (r_type, rela_p)
return &elf_mips_gnu_vtinherit_howto;
case R_MIPS_GNU_VTENTRY:
return &elf_mips_gnu_vtentry_howto;
+ case R_MIPS_GNU_REL16_S2:
+ if (rela_p)
+ return &elf_mips_gnu_rela16_s2;
+ else
+ return &elf_mips_gnu_rel16_s2;
default:
BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
if (rela_p)