[ bfd/ChangeLog ]
authorChris Demetriou <cgd@google.com>
Mon, 14 Jun 2004 18:25:10 +0000 (18:25 +0000)
committerChris Demetriou <cgd@google.com>
Mon, 14 Jun 2004 18:25:10 +0000 (18:25 +0000)
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.

bfd/ChangeLog
bfd/elf32-mips.c
bfd/elfxx-mips.c
include/elf/ChangeLog
include/elf/mips.h

index 63bd2ad4a0d8d4f9fe71ec28d5bff0d6821454c9..8ef353efe302a57752443e4ccd8454eaffe69d32 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2004-06-12  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc
index 63f1062de336cb99d03f293fbf1855969e7f9901..2e6eeb9f5d0aa9cacfc39b575582f8d661ebb45c 100644 (file)
@@ -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];
index 21748f24f691684d923170207f4ee7f69800ac35..cbacd4e24c4ac32ad253c8704349e5183c225d56 100644 (file)
@@ -3336,6 +3336,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
       value &= howto->dst_mask;
       break;
 
+    case R_MIPS_PC32:
+      value = symbol + addend - p;
+      value &= howto->dst_mask;
+      break;
+
     case R_MIPS_GNU_REL16_S2:
       value = symbol + _bfd_mips_elf_sign_extend (addend, 18) - p;
       overflowed_p = mips_elf_overflow_p (value, 18);
index 0e41208684dd088239c107ffa95cd1491834dc16..7c247cdf71b714a445c29d9903b9ba865121ad96 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
 
        * sh.h (EF_SH_HAS_DSP): Remove.
index 9aba63e420c06b55f8b2fb589fefacb4104ee2a1..b7d800a70ed6e89883d738f849418fabd28b4063 100644 (file)
@@ -76,6 +76,11 @@ START_RELOC_NUMBERS (elf_mips_reloc_type)
   /* These relocs are used for the mips16.  */
   RELOC_NUMBER (R_MIPS16_26, 100)
   RELOC_NUMBER (R_MIPS16_GPREL, 101)
+  /* 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.)  */
+  RELOC_NUMBER (R_MIPS_PC32, 248)
   /* FIXME: this relocation is used internally by gas.  */
   RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250)
   /* These are GNU extensions to enable C++ vtable garbage collection.  */
This page took 0.033196 seconds and 4 git commands to generate.