]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/
authorNick Clifton <nickc@redhat.com>
Thu, 18 Mar 2010 11:22:46 +0000 (11:22 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 18 Mar 2010 11:22:46 +0000 (11:22 +0000)
2010-03-15  Wei Guozhi  <carrot@google.com>

       PR gas/11323
       * bfd-in2.h (enum bfd_reloc_code_real): New BFD_RELOC_GOT_PREL type.
       * elf32-arm.c (elf32_arm_reloc_map): BFD_RELOC_GOT_PREL to
       R_ARM_GOT_PREL map.
       * libbfd.h (bfd_reloc_code_real_names): BFD_RELOC_GOT_PREL name.
       * reloc.c (comments): Document the new relocation.

gas/
2010-03-15  Wei Guozhi  <carrot@google.com>

       PR gas/11323
       * config/tc-arm.c (reloc_names): New relocation names.
       (md_apply_fix): New case for BFD_RELOC_ARM_GOT_PREL.
       (tc_gen_reloc): New case for BFD_RELOC_ARM_GOT_PREL.
       * doc/c-arm.texi (ARM-Relocations): Document the new relocation.

gas/testsuite
2010-03-15  Wei Guozhi  <carrot@google.com>

       PR gas/11323
       * gas/arm/got_prel.s: New test case.
       * gas/arm/got_prel.d: Likewise.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/elf32-arm.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-arm.c
gas/doc/c-arm.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/got_prel.d [new file with mode: 0644]
gas/testsuite/gas/arm/got_prel.s [new file with mode: 0644]

index 0172fdf80055af3d5c1f0c990788c68756a66ef7..d8af13c07a172681bf2d141948fb8f921e171d95 100644 (file)
@@ -1,3 +1,12 @@
+2010-03-18  Wei Guozhi  <carrot@google.com>
+
+       PR gas/11323
+       * elf32-arm.c (elf32_arm_reloc_map): Map BFD_RELOC_ARM_GOT_PREL to
+       R_ARM_GOT_PREL.
+       * reloc.c (BFD_RELOC_ARM_GOT_PREL): New ARM relocation.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
+
 2010-03-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * reloc.c (BFD_RELOC_SPU_PIC18): Removed.
index c90ac2db243574267345d3dcf3c548b210b81659..31af74f917f782c13b9656cc46a18bb43a713205 100644 (file)
@@ -3114,6 +3114,7 @@ pc-relative or some form of GOT-indirect relocation.  */
   BFD_RELOC_ARM_RELATIVE,
   BFD_RELOC_ARM_GOTOFF,
   BFD_RELOC_ARM_GOTPC,
+  BFD_RELOC_ARM_GOT_PREL,
 
 /* ARM thread-local storage relocations.  */
   BFD_RELOC_ARM_TLS_GD32,
index eede7ecbfbfd9259aa1f089f6128a6e9eac25d80..6bd29f69c068b34da1696d3613116fa5ad4a64f8 100644 (file)
@@ -1721,6 +1721,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
     {BFD_RELOC_ARM_RELATIVE,         R_ARM_RELATIVE},
     {BFD_RELOC_ARM_GOTOFF,           R_ARM_GOTOFF32},
     {BFD_RELOC_ARM_GOTPC,            R_ARM_GOTPC},
+    {BFD_RELOC_ARM_GOT_PREL,         R_ARM_GOT_PREL},
     {BFD_RELOC_ARM_GOT32,            R_ARM_GOT32},
     {BFD_RELOC_ARM_PLT32,            R_ARM_PLT32},
     {BFD_RELOC_ARM_TARGET1,         R_ARM_TARGET1},
index fa9d18760e0d53fc38e3f2923b6ebe6a2e13a6f2..65cfccf89a5bf13f3f9b69bb0494e91664a91934 100644 (file)
@@ -1330,6 +1330,7 @@ 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_GOT_PREL",
   "BFD_RELOC_ARM_TLS_GD32",
   "BFD_RELOC_ARM_TLS_LDO32",
   "BFD_RELOC_ARM_TLS_LDM32",
index 1974851d8536ccf2fd5b44ceb1b5237ae5c5e9bf..cacd0de00cc3eef94f9391af6b321a6b02adf51c 100644 (file)
@@ -2936,6 +2936,8 @@ ENUMX
   BFD_RELOC_ARM_GOTOFF
 ENUMX
   BFD_RELOC_ARM_GOTPC
+ENUMX
+  BFD_RELOC_ARM_GOT_PREL
 ENUMDOC
   Relocations for setting up GOTs and PLTs for shared libraries.
 
index 5110a41fed922113e116e36cc1f271291710d305..929cb7be05d8d3eebb9a4c9720b412040511f0ab 100644 (file)
@@ -1,3 +1,11 @@
+2010-03-18  Wei Guozhi  <carrot@google.com>
+
+       PR gas/11323
+       * config/tc-arm.c (reloc_names): New relocation names.
+       (md_apply_fix): New case for BFD_RELOC_ARM_GOT_PREL.
+       (tc_gen_reloc): New case for BFD_RELOC_ARM_GOT_PREL.
+       * doc/c-arm.texi (ARM-Relocations): Document the new relocation.
+
 2010-03-15  Thomas Schwinge  <thomas@codesourcery.com>
 
        * dw2gencfi.c (output_cie): Consider emitting the S augmentation in all
index 16f4fd321581639bf7c00e1884ce9b26593f40b1..557b9f910e2881d90737196cfb2d0f99c543612d 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-arm.c -- Assemble for the ARM
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008, 2009
+   2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
        Modified by David Taylor (dtaylor@armltd.co.uk)
@@ -16191,7 +16191,8 @@ static struct reloc_entry reloc_names[] =
   { "tlsldm",  BFD_RELOC_ARM_TLS_LDM32}, { "TLSLDM",  BFD_RELOC_ARM_TLS_LDM32},
   { "tlsldo",  BFD_RELOC_ARM_TLS_LDO32}, { "TLSLDO",  BFD_RELOC_ARM_TLS_LDO32},
   { "gottpoff",BFD_RELOC_ARM_TLS_IE32},  { "GOTTPOFF",BFD_RELOC_ARM_TLS_IE32},
-  { "tpoff",   BFD_RELOC_ARM_TLS_LE32},  { "TPOFF",   BFD_RELOC_ARM_TLS_LE32}
+  { "tpoff",   BFD_RELOC_ARM_TLS_LE32},  { "TPOFF",   BFD_RELOC_ARM_TLS_LE32},
+  { "got_prel", BFD_RELOC_ARM_GOT_PREL}, { "GOT_PREL", BFD_RELOC_ARM_GOT_PREL}
 };
 #endif
 
@@ -20477,7 +20478,12 @@ md_apply_fix (fixS *   fixP,
       if (fixP->fx_done || !seg->use_rela_p)
        md_number_to_chars (buf, 0, 4);
       break;
-      
+
+    case BFD_RELOC_ARM_GOT_PREL:
+      if (fixP->fx_done || !seg->use_rela_p)
+        md_number_to_chars (buf, value, 4);
+      break;
+
     case BFD_RELOC_ARM_TARGET2:
       /* TARGET2 is not partial-inplace, so we need to write the
          addend here for REL targets, because it won't be written out
@@ -21062,6 +21068,7 @@ tc_gen_reloc (asection *section, fixS *fixp)
 #ifdef OBJ_ELF
     case BFD_RELOC_ARM_GOT32:
     case BFD_RELOC_ARM_GOTOFF:
+    case BFD_RELOC_ARM_GOT_PREL:
     case BFD_RELOC_ARM_PLT32:
     case BFD_RELOC_ARM_TARGET1:
     case BFD_RELOC_ARM_ROSEGREL32:
index 11d7215be63fcf8a49f5a90b715c0af45117c024..60a455798981ba00f990d9aa81a1ae8865ff34bb 100644 (file)
@@ -452,7 +452,8 @@ The following relocations are supported:
 @code{TLSGD},
 @code{TLSLDM},
 @code{TLSLDO},
-@code{GOTTPOFF}
+@code{GOTTPOFF},
+@code{GOT_PREL}
 and
 @code{TPOFF}.
 
index dd0807e711251b75b19178af058dee5d13bd6297..86d14dc011b42fde3434b756c8be62c3998625fd 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-18  Wei Guozhi  <carrot@google.com>
+
+       PR gas/11323
+       * gas/arm/got_prel.s: New test case.
+       * gas/arm/got_prel.d: Expected disassembly.
+
 2010-03-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/i386.exp: Run list-1, list-2 and list-3 only for
diff --git a/gas/testsuite/gas/arm/got_prel.d b/gas/testsuite/gas/arm/got_prel.d
new file mode 100644 (file)
index 0000000..ad74dfc
--- /dev/null
@@ -0,0 +1,19 @@
+# name: R_ARM_GOT_PREL relocation
+# source: got_prel.s
+# as: -march=armv5te -meabi=5
+# readelf: -x 4 -r
+# target: *-*-*eabi *-*-symbianelf *-*-linux-* *-*-elf
+
+Relocation section '.rel.text.foo' at offset 0x3f0 contains 1 entries:
+ Offset     Info    Type            Sym.Value  Sym. Name
+00000010  00000c60 R_ARM_GOT_PREL    00000000   i
+
+Relocation section '.rel.ARM.exidx.text.foo' at offset 0x3f8 contains 2 entries:
+ Offset     Info    Type            Sym.Value  Sym. Name
+00000000  0000042a R_ARM_PREL31      00000000   .text.foo
+00000000  00000d00 R_ARM_NONE        00000000   __aeabi_unwind_cpp_pr0
+
+Hex dump of section '.text.foo':
+ NOTE: This section has relocations against it, but these have NOT been applied to this dump.
+  0x00000000 034b7b44 1b681a68 1860101c 7047c046 .K{D.h.h.`..pG.F
+  0x00000010 0a000000                            ....
diff --git a/gas/testsuite/gas/arm/got_prel.s b/gas/testsuite/gas/arm/got_prel.s
new file mode 100644 (file)
index 0000000..9628d47
--- /dev/null
@@ -0,0 +1,23 @@
+        .code   16
+        .text
+.Ltext0:
+        .section        .text.foo,"ax",%progbits
+        .align  2
+        .global foo
+        .code   16
+        .thumb_func
+        .type   foo, %function
+foo:
+        .fnstart
+        ldr     r3, .L3
+.LPIC0:
+        add     r3, pc
+        ldr     r3, [r3]
+        ldr     r2, [r3]
+        str     r0, [r3]
+        mov     r0, r2
+        bx      lr
+        .align  2
+.L3:
+        .word   i(GOT_PREL) + (. - (.LPIC0+4))
+        .fnend