bfd/
authorPaul Brook <paul@codesourcery.com>
Fri, 6 Aug 2004 16:18:11 +0000 (16:18 +0000)
committerPaul Brook <paul@codesourcery.com>
Fri, 6 Aug 2004 16:18:11 +0000 (16:18 +0000)
* elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
(elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
* reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
and BFD_RELOC_ARM_SBREL32.
* bfd-in2.h, bbfd.h: Regenerate.
gas/
* config/tc-arm.c (md_apply_fix3, tc_gen_reloc, arm_parse_reloc):
Handle new relocations.
* include/elf/arm.h (elf_arm_reloc_type): Add new EABI relocations.
gas/testsuite/
* gas/arm/pic.s,d: Test RELABS and SBREL relocations.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/elfarm-nabi.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/pic.d
gas/testsuite/gas/arm/pic.s
include/elf/arm.h

index c431b3ec19792e03782ce00331b1a076616cf432..42132adf014756823aec6e6eabfb3dc90f2342bc 100644 (file)
@@ -1,3 +1,12 @@
+2004-08-06  Paul Brook  <paul@codesourcery.com>
+
+       * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
+       (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
+       BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
+       * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
+       and BFD_RELOC_ARM_SBREL32.
+       * bfd-in2.h, bbfd.h: Regenerate.
+
 2004-08-01  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
 
        * elfxx-mips.c (mips_elf_calculate_relocation): Test only for
index 8f5d59bdae03464c61c56a449ae23cee77e1b7d5..f2ec29d71ac05a0dfc1861de3ca7c2c2a36cf1e3 100644 (file)
@@ -2639,6 +2639,16 @@ field in the instruction.  */
   BFD_RELOC_ARM_GOTOFF,
   BFD_RELOC_ARM_GOTPC,
 
+/* PC-relative or absolute relocation depending on target.  Used for
+entries in .init_array sections.  */
+  BFD_RELOC_ARM_RELABS32,
+
+/* Read-only segment base relative address.  */
+  BFD_RELOC_ARM_ROSEGREL32,
+
+/* Data segment base relative address.  */
+  BFD_RELOC_ARM_SBREL32,
+
 /* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
   BFD_RELOC_SH_PCDISP8BY2,
   BFD_RELOC_SH_PCDISP12BY2,
index e2e34f3f62b9877ac967ae393490faefdda1506e..1abe9b1a2031e1a48659e79744af0762443d37c8 100644 (file)
@@ -188,16 +188,16 @@ static reloc_howto_type elf32_arm_howto_table[] =
 
   HOWTO (R_ARM_SBREL32,                /* type */
         0,                     /* rightshift */
-        0,                     /* size (0 = byte, 1 = short, 2 = long) */
-        0,                     /* bitsize */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
         FALSE,                 /* pc_relative */
         0,                     /* bitpos */
         complain_overflow_dont,/* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
         "R_ARM_SBREL32",       /* name */
         FALSE,                 /* partial_inplace */
-        0,                     /* src_mask */
-        0,                     /* dst_mask */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
   HOWTO (R_ARM_THM_PC22,       /* type */
@@ -557,6 +557,90 @@ static reloc_howto_type elf32_arm_howto_table[] =
         0x00000fff,            /* src_mask */
         0x00000fff,            /* dst_mask */
         TRUE),                 /* pcrel_offset */
+
+  HOWTO (R_ARM_LDR_SBREL_11_0, /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        12,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_LDR_SBREL_11_0",/* name */
+        FALSE,                 /* partial_inplace */
+        0x00000fff,            /* src_mask */
+        0x00000fff,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO (R_ARM_ALU_SBREL_19_12,        /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        8,                     /* bitsize */
+        FALSE,                 /* pc_relative */
+        12,                    /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_ALU_SBREL_19_12",/* name */
+        FALSE,                 /* partial_inplace */
+        0x000ff000,            /* src_mask */
+        0x000ff000,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO (R_ARM_ALU_SBREL_27_20,        /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        8,                     /* bitsize */
+        FALSE,                 /* pc_relative */
+        20,                    /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_ALU_SBREL_27_20",/* name */
+        FALSE,                 /* partial_inplace */
+        0x0ff00000,            /* src_mask */
+        0x0ff00000,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO (R_ARM_RELABS32,       /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_RELABS32",      /* name */
+        FALSE,                 /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO (R_ARM_ROSEGREL32,     /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_ROSEGREL32",    /* name */
+        FALSE,                 /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO (R_ARM_V4BX,           /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont,/* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_ARM_V4BX",          /* name */
+        FALSE,                 /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        FALSE),                /* pcrel_offset */
 };
 
   /* GNU extension to record C++ vtable hierarchy */
@@ -689,7 +773,10 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
     {BFD_RELOC_ARM_GOTOFF,           R_ARM_GOTOFF},
     {BFD_RELOC_ARM_GOTPC,            R_ARM_GOTPC},
     {BFD_RELOC_ARM_GOT32,            R_ARM_GOT32},
-    {BFD_RELOC_ARM_PLT32,            R_ARM_PLT32}
+    {BFD_RELOC_ARM_PLT32,            R_ARM_PLT32},
+    {BFD_RELOC_ARM_RELABS32,        R_ARM_RELABS32},
+    {BFD_RELOC_ARM_ROSEGREL32,      R_ARM_ROSEGREL32},
+    {BFD_RELOC_ARM_SBREL32,         R_ARM_SBREL32}
   };
 
 static reloc_howto_type *
index f3bd57af4d4bf5749b2fa433f5dc8af967c5fa17..de3ead65d06a73dd464b17a0619acfeea8da6f74 100644 (file)
@@ -1134,6 +1134,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARM_RELATIVE",
   "BFD_RELOC_ARM_GOTOFF",
   "BFD_RELOC_ARM_GOTPC",
+  "BFD_RELOC_ARM_RELABS32",
+  "BFD_RELOC_ARM_ROSEGREL32",
+  "BFD_RELOC_ARM_SBREL32",
   "BFD_RELOC_SH_PCDISP8BY2",
   "BFD_RELOC_SH_PCDISP12BY2",
   "BFD_RELOC_SH_IMM3",
index 74492f0287783788c231b05fc5467eefd8cfac57..48166db51ec55ee8bd09895d72521f7a5861461e 100644 (file)
@@ -2608,6 +2608,19 @@ ENUMX
 ENUMDOC
   These relocs are only used within the ARM assembler.  They are not
   (at present) written to any object files.
+ENUM
+  BFD_RELOC_ARM_RELABS32
+ENUMDOC
+  Pc-relative or absolute relocation depending on target.  Used for
+  entries in .init_array sections.
+ENUM
+  BFD_RELOC_ARM_ROSEGREL32
+ENUMDOC
+  Read-only segment base relative address.
+ENUM
+  BFD_RELOC_ARM_SBREL32
+ENUMDOC
+  Data segment base relative address.
 
 ENUM
   BFD_RELOC_SH_PCDISP8BY2
index f221a1580429be9795f12a68f4255fb00dc79951..4361aa3a16b689b801b6eb084fa6053af4dea8d6 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-06  Paul Brook  <paul@codesourcery.com>
+
+       * config/tc-arm.c (md_apply_fix3, tc_gen_reloc, arm_parse_reloc):
+       Handle new relocations.
+       * include/elf/arm.h (elf_arm_reloc_type): Add new EABI relocations.
+
 2004-08-05  Bob Wilson  <bob.wilson@acm.org>
 
        * write.c (relax_segment): Use was_address instead of address when
index 96cf3ca7bd3e12d38214cc5d1f015da30beaf12b..f7eeca7d7327c1397e5a0486b59192ea4cda400c 100644 (file)
@@ -12487,6 +12487,9 @@ md_apply_fix3 (fixP, valP, seg)
 
     case BFD_RELOC_RVA:
     case BFD_RELOC_32:
+    case BFD_RELOC_ARM_RELABS32:
+    case BFD_RELOC_ARM_ROSEGREL32:
+    case BFD_RELOC_ARM_SBREL32:
       if (fixP->fx_done || fixP->fx_pcrel)
        md_number_to_chars (buf, value, 4);
 #ifdef OBJ_ELF
@@ -12774,6 +12777,9 @@ tc_gen_reloc (section, fixp)
     case BFD_RELOC_ARM_GOT32:
     case BFD_RELOC_ARM_GOTOFF:
     case BFD_RELOC_ARM_PLT32:
+    case BFD_RELOC_ARM_RELABS32:
+    case BFD_RELOC_ARM_ROSEGREL32:
+    case BFD_RELOC_ARM_SBREL32:
       code = fixp->fx_r_type;
       break;
 #endif
@@ -14132,6 +14138,8 @@ arm_parse_reloc ()
     /* ScottB: Jan 30, 1998 - Added support for parsing "var(PLT)"
        branch instructions generated by GCC for PLT relocs.  */
     MAP ("(plt)",    BFD_RELOC_ARM_PLT32),
+    MAP ("(relabs)", BFD_RELOC_ARM_RELABS32),
+    MAP ("(sbrel)", BFD_RELOC_ARM_SBREL32),
     { NULL, 0,         BFD_RELOC_UNUSED }
 #undef MAP
   };
index f0679ebc33b56a4dba0304eab737988bdb860fd2..f91cf6d1b1618be78e7526d3396db2d75dc1c481 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-06  Paul Brook  <paul@codesourcery.com>
+
+       * gas/arm/pic.s,d: Test RELABS and SBREL relocations.
+
 2004-08-05  Nitin Yewale  <nitiny@kpitcummins.com>
 
        * h8300/h8300.exp: Addition of new test case to check rx
index 6c4a043306354d84bd1faf28bdbc08f961de114b..bd69d1bbd49a24fa6e76bc44b72011a5ec602daf 100644 (file)
@@ -15,3 +15,5 @@ Disassembly of section .text:
                        c: R_ARM_GOT32  sym
                        10: R_ARM_GOTOFF        sym
                        14: R_ARM_GOTPC _GLOBAL_OFFSET_TABLE_
+                       18: R_ARM_RELABS32      foo2
+                       1c: R_ARM_SBREL32       foo3
index f538908e90663160316d94c6f9794a978b092478..8d0842cfce02438065baa061e0c2eafcd1ecbc92 100644 (file)
@@ -9,3 +9,5 @@
        .word   sym(GOTOFF)
 1:
        .word   _GLOBAL_OFFSET_TABLE_ - 1b
+       .word foo2(RELABS)
+       .word foo3(SBREL)
index 158a4b55e4f2ca316dd68d7adc889f9852b65ff9..a391a0e681d245d7022739a40c1ba4952256c007 100644 (file)
@@ -124,10 +124,15 @@ START_RELOC_NUMBERS (elf_arm_reloc_type)
   RELOC_NUMBER (R_ARM_ALU_PCREL7_0,    32)
   RELOC_NUMBER (R_ARM_ALU_PCREL15_8,   33)
   RELOC_NUMBER (R_ARM_ALU_PCREL23_15,  34)
-  RELOC_NUMBER (R_ARM_LDR_SBREL11_0,   35)
-  RELOC_NUMBER (R_ARM_ALU_SBREL19_12,  36)
-  RELOC_NUMBER (R_ARM_ALU_SBREL27_20,  37)
-  FAKE_RELOC   (FIRST_INVALID_RELOC2,  38)
+  RELOC_NUMBER (R_ARM_LDR_SBREL_11_0,  35)
+  RELOC_NUMBER (R_ARM_ALU_SBREL_19_12, 36)
+  RELOC_NUMBER (R_ARM_ALU_SBREL_27_20, 37)
+  RELOC_NUMBER (R_ARM_RELABS32,        38)
+  RELOC_NUMBER (R_ARM_ROSEGREL32,      39)
+  RELOC_NUMBER (R_ARM_V4BX,            40)
+  RELOC_NUMBER (R_ARM_STKCHK,          41)
+  RELOC_NUMBER (R_ARM_THM_STKCHK,      42)
+  FAKE_RELOC   (FIRST_INVALID_RELOC2,  43)
   FAKE_RELOC   (LAST_INVALID_RELOC2,   99)
   RELOC_NUMBER (R_ARM_GNU_VTENTRY,    100)
   RELOC_NUMBER (R_ARM_GNU_VTINHERIT,  101)
This page took 0.036913 seconds and 4 git commands to generate.