Correct the relocation names for R_AARCH64_TLSDESC_LD_PREL19 and R_AARCH64_TLSDESC_AD...
authorYufeng Zhang <yufeng.zhang@arm.com>
Tue, 28 May 2013 16:39:51 +0000 (16:39 +0000)
committerYufeng Zhang <yufeng.zhang@arm.com>
Tue, 28 May 2013 16:39:51 +0000 (16:39 +0000)
12 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/elf64-aarch64.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/ChangeLog
gas/testsuite/gas/aarch64/tls.d
gas/testsuite/gas/aarch64/tls.s
include/elf/ChangeLog
include/elf/aarch64.h

index a29227e52e81bde2971c9d9984e7a3be92dbcc30..516999615986bb6f7b54bca703d1f69dfbb55044 100644 (file)
@@ -1,3 +1,25 @@
+2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * reloc.c (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
+       (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21): ... this.
+       (BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
+       (BFD_RELOC_AARCH64_TLSDESC_LD_PREL19): ...  this.
+       * bfd-in2.h: Regenerate.
+       * libbfd.h: Regenerate.
+       * elf64-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Update to use
+       the correct names.
+       (elf64_aarch64_tlsdesc_howto_table): Likewise.
+       (elf64_aarch64_reloc_map): Likewise.
+       (aarch64_resolve_relocation): Likewise.
+       (bfd_elf_aarch64_put_addend): Likewise.
+       (aarch64_tls_transition_without_check): Likewise.
+       (aarch64_reloc_got_type): Likewise.
+       (elf64_aarch64_final_link_relocate): Likewise.
+       (elf64_aarch64_tls_relax): Likewise.
+       (elf64_aarch64_relocate_section): Likewise.
+       (elf64_aarch64_gc_sweep_hook): Likewise.
+       (elf64_aarch64_check_relocs): Likewise.
+
 2013-05-26  Mark Wielaard  <mjw@redhat.com>
 
        * cache.c (BFD_CACHE_MAX_OPEN): Remove define.
index 0050f46390b18ec7d75efc2cc54f3f53829cdba9..a6299a5ba18ef81a56ababdcb46db145142f8489 100644 (file)
@@ -5350,7 +5350,7 @@ of a signed or unsigned address/value.  */
   BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC,
 
 /* AArch64 TLS DESC relocation.  */
-  BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE,
+  BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
 
 /* AArch64 TLS DESC relocation.  */
   BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21,
@@ -5362,7 +5362,7 @@ of a signed or unsigned address/value.  */
   BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC,
 
 /* AArch64 TLS DESC relocation.  */
-  BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19,
+  BFD_RELOC_AARCH64_TLSDESC_LD_PREL19,
 
 /* AArch64 TLS DESC relocation.  */
   BFD_RELOC_AARCH64_TLSDESC_LDR,
index fe9d5b17c8ed2167c15e3b3aed87a173d32679f9..68f03fc16bb32698e5a33ca13155f60c4643f1ab 100644 (file)
@@ -40,7 +40,7 @@
   For TLS descriptors the assembler will present us with code
   fragments of the form:
 
-  adrp  x0, :tlsdesc:foo                      R_AARCH64_TLSDESC_ADR_PAGE(foo)
+  adrp  x0, :tlsdesc:foo                      R_AARCH64_TLSDESC_ADR_PAGE21(foo)
   ldr   x1, [x0, #:tlsdesc_lo12:foo]          R_AARCH64_TLSDESC_LD64_LO12(foo)
   add   x0, x0, #:tlsdesc_lo12:foo            R_AARCH64_TLSDESC_ADD_LO12(foo)
   .tlsdesccall foo
@@ -171,9 +171,9 @@ bfd_elf_aarch64_put_addend (bfd *abfd,
    || IS_AARCH64_TLSDESC_RELOC ((R_TYPE)))
 
 #define IS_AARCH64_TLSDESC_RELOC(R_TYPE)               \
-  ((R_TYPE) == R_AARCH64_TLSDESC_LD64_PREL19           \
+  ((R_TYPE) == R_AARCH64_TLSDESC_LD_PREL19             \
    || (R_TYPE) == R_AARCH64_TLSDESC_ADR_PREL21         \
-   || (R_TYPE) == R_AARCH64_TLSDESC_ADR_PAGE           \
+   || (R_TYPE) == R_AARCH64_TLSDESC_ADR_PAGE21         \
    || (R_TYPE) == R_AARCH64_TLSDESC_ADD_LO12_NC                \
    || (R_TYPE) == R_AARCH64_TLSDESC_LD64_LO12_NC       \
    || (R_TYPE) == R_AARCH64_TLSDESC_OFF_G1             \
@@ -1204,7 +1204,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
 
 static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
 {
-  HOWTO (R_AARCH64_TLSDESC_LD64_PREL19,        /* type */
+  HOWTO (R_AARCH64_TLSDESC_LD_PREL19,  /* type */
         2,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         21,                    /* bitsize */
@@ -1212,7 +1212,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
         0,                     /* bitpos */
         complain_overflow_dont,        /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
-        "R_AARCH64_TLSDESC_LD64_PREL19",       /* name */
+        "R_AARCH64_TLSDESC_LD_PREL19", /* name */
         FALSE,                 /* partial_inplace */
         0x1ffffc,              /* src_mask */
         0x1ffffc,              /* dst_mask */
@@ -1234,7 +1234,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
 
   /* Get to the page for the GOT entry for the symbol
      (G(S) - P) using an ADRP instruction.  */
-  HOWTO (R_AARCH64_TLSDESC_ADR_PAGE,   /* type */
+  HOWTO (R_AARCH64_TLSDESC_ADR_PAGE21, /* type */
         12,                    /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         21,                    /* bitsize */
@@ -1242,7 +1242,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
         0,                     /* bitpos */
         complain_overflow_dont,        /* complain_on_overflow */
         bfd_elf_generic_reloc, /* special_function */
-        "R_AARCH64_TLSDESC_ADR_PAGE",  /* name */
+        "R_AARCH64_TLSDESC_ADR_PAGE21",        /* name */
         FALSE,                 /* partial_inplace */
         0x1fffff,              /* src_mask */
         0x1fffff,              /* dst_mask */
@@ -1471,9 +1471,9 @@ static const struct elf64_aarch64_reloc_map elf64_aarch64_reloc_map[] =
   {BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, R_AARCH64_TLSLE_ADD_TPREL_HI12},
   {BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC,
    R_AARCH64_TLSLE_ADD_TPREL_LO12_NC},
-  {BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, R_AARCH64_TLSDESC_LD64_PREL19},
+  {BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, R_AARCH64_TLSDESC_LD_PREL19},
   {BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, R_AARCH64_TLSDESC_ADR_PREL21},
-  {BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, R_AARCH64_TLSDESC_ADR_PAGE},
+  {BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, R_AARCH64_TLSDESC_ADR_PAGE21},
   {BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, R_AARCH64_TLSDESC_ADD_LO12_NC},
   {BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, R_AARCH64_TLSDESC_LD64_LO12_NC},
   {BFD_RELOC_AARCH64_TLSDESC_OFF_G1, R_AARCH64_TLSDESC_OFF_G1},
@@ -2132,7 +2132,7 @@ aarch64_resolve_relocation (unsigned int r_type, bfd_vma place, bfd_vma value,
       break;
 
     case R_AARCH64_ADR_GOT_PAGE:
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
     case R_AARCH64_TLSGD_ADR_PAGE21:
     case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
       value = PG (value + addend) - PG (place);
@@ -3361,7 +3361,7 @@ bfd_elf_aarch64_put_addend (bfd *abfd,
 
     case R_AARCH64_TLSGD_ADR_PAGE21:
     case R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
     case R_AARCH64_ADR_GOT_PAGE:
     case R_AARCH64_ADR_PREL_LO21:
     case R_AARCH64_ADR_PREL_PG_HI21:
@@ -3527,7 +3527,7 @@ aarch64_tls_transition_without_check (unsigned int r_type,
   switch (r_type)
     {
     case R_AARCH64_TLSGD_ADR_PAGE21:
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
       return is_local
        ? R_AARCH64_TLSLE_MOVW_TPREL_G1 : R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21;
 
@@ -3567,7 +3567,7 @@ aarch64_reloc_got_type (unsigned int r_type)
       return GOT_TLS_GD;
 
     case R_AARCH64_TLSDESC_ADD_LO12_NC:
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
     case R_AARCH64_TLSDESC_CALL:
     case R_AARCH64_TLSDESC_LD64_LO12_NC:
       return GOT_TLSDESC_GD;
@@ -4025,7 +4025,7 @@ elf64_aarch64_final_link_relocate (reloc_howto_type *howto,
       *unresolved_reloc_p = FALSE;
       break;
 
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
     case R_AARCH64_TLSDESC_LD64_LO12_NC:
     case R_AARCH64_TLSDESC_ADD_LO12_NC:
     case R_AARCH64_TLSDESC_ADD:
@@ -4079,7 +4079,7 @@ elf64_aarch64_tls_relax (struct elf64_aarch64_link_hash_table *globals,
   switch (r_type)
     {
     case R_AARCH64_TLSGD_ADR_PAGE21:
-    case R_AARCH64_TLSDESC_ADR_PAGE:
+    case R_AARCH64_TLSDESC_ADR_PAGE21:
       if (is_local)
        {
          /* GD->LE relaxation:
@@ -4515,7 +4515,7 @@ elf64_aarch64_relocate_section (bfd *output_bfd,
        case R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
          break;
 
-       case R_AARCH64_TLSDESC_ADR_PAGE:
+       case R_AARCH64_TLSDESC_ADR_PAGE21:
        case R_AARCH64_TLSDESC_LD64_LO12_NC:
        case R_AARCH64_TLSDESC_ADD_LO12_NC:
          if (! symbol_tlsdesc_got_offset_mark_p (input_bfd, h, r_symndx))
@@ -4903,7 +4903,7 @@ elf64_aarch64_gc_sweep_hook (bfd *abfd,
        case R_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
        case R_AARCH64_TLSLE_MOVW_TPREL_G0:
        case R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
-       case R_AARCH64_TLSDESC_ADR_PAGE:
+       case R_AARCH64_TLSDESC_ADR_PAGE21:
        case R_AARCH64_TLSDESC_ADD_LO12_NC:
        case R_AARCH64_TLSDESC_LD64_LO12_NC:
           if (h != NULL)
@@ -5243,7 +5243,7 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
        case R_AARCH64_TLSLE_MOVW_TPREL_G0:
        case R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
-       case R_AARCH64_TLSDESC_ADR_PAGE:
+       case R_AARCH64_TLSDESC_ADR_PAGE21:
        case R_AARCH64_TLSDESC_ADD_LO12_NC:
        case R_AARCH64_TLSDESC_LD64_LO12_NC:
          {
index 1c4d36f91ae692b13302573d23c342ddabca2041..c0006bfd0a12f64e6b6f50618ac56eec82904216 100644 (file)
@@ -2554,11 +2554,11 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_AARCH64_TLSDESC",
   "BFD_RELOC_AARCH64_TLSDESC_ADD",
   "BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC",
-  "BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE",
+  "BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21",
   "BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21",
   "BFD_RELOC_AARCH64_TLSDESC_CALL",
   "BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC",
-  "BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19",
+  "BFD_RELOC_AARCH64_TLSDESC_LD_PREL19",
   "BFD_RELOC_AARCH64_TLSDESC_LDR",
   "BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC",
   "BFD_RELOC_AARCH64_TLSDESC_OFF_G1",
index 57df51b391829e45d841a84c57f6c11509cb659c..d4d98f7857b617514516e873656a488f6687764a 100644 (file)
@@ -6275,7 +6275,7 @@ ENUM
 ENUMDOC
   AArch64 TLS DESC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE
+  BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21
 ENUMDOC
   AArch64 TLS DESC relocation.
 ENUM
@@ -6291,7 +6291,7 @@ ENUM
 ENUMDOC
   AArch64 TLS DESC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19
+  BFD_RELOC_AARCH64_TLSDESC_LD_PREL19
 ENUMDOC
   AArch64 TLS DESC relocation.
 ENUM
index 6b2a16650326e26289b68ae7ae01d32b1260204b..b8fa3a5b1b09b9f43dd9ab666f073d064980e905 100644 (file)
@@ -1,3 +1,11 @@
+2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * config/tc-aarch64.c (reloc_table): Update to use
+       BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21 instead of 
+       BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE.
+       (md_apply_fix): Likewise.
+       (aarch64_force_relocation): Likewise.
+
 2013-05-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/tc-arm.c (it_fsm_post_encode): Improve
index 6af526db232d6c62f9c4b8dc33456ca50b070c13..f462dbdc71236117b7ed09a34c25d226ac5a3d90 100644 (file)
@@ -2389,7 +2389,7 @@ static struct reloc_table_entry reloc_table[] = {
 
   /* Get to the page containing GOT TLS entry for a symbol */
   {"tlsdesc", 0,
-   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE,
+   BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21,
    0,
    0,
    0},
@@ -6500,7 +6500,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
-    case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE:
+    case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
     case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
       S_SET_THREAD_LOCAL (fixP->fx_addsy);
@@ -6663,7 +6663,7 @@ aarch64_force_relocation (struct fix *fixp)
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
-    case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE:
+    case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
     case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC:
     case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
index bbfe39df5b69c801e224438f421e240385a76274..6bd45d5a3b7fefa14bff801daf8b8af86afbf48c 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * gas/aarch64/tls.d: Update.
+       * gas/aarch64/tls.s: Update.
+
 2013-05-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * gas/arm/armv8-a-bad.l: Update expected warning message.
index 29345193c3d860de8c75f51b6749bc8d735594c5..9b79c85943386449ae337ea810c85f169541dd63 100644 (file)
@@ -6,7 +6,7 @@ Disassembly of section \.text:
 
 0000000000000000 <.*>:
    0:  90000000        adrp    x0, 0 <var>
-                       0: R_AARCH64_TLSDESC_ADR_PAGE   var
+                       0: R_AARCH64_TLSDESC_ADR_PAGE21 var
    4:  f9400001        ldr     x1, \[x0\]
                        4: R_AARCH64_TLSDESC_LD64_LO12_NC       var
    8:  91000000        add     x0, x0, #0x0
index 6bf75b4d1ff340a9f6990f35babc5708a022711f..1c7025ae6ea519a0fdd6142462d2cee3d5a8bbb8 100644 (file)
@@ -21,7 +21,7 @@
 
 func:
 
-       // R_AARCH64_TLSDESC_ADR_PAGE  var
+       // R_AARCH64_TLSDESC_ADR_PAGE21  var
        adrp  x0, :tlsdesc:var
        // R_AARCH64_TLSDESC_LD64_LO12 var
        ldr   x1, [x0, #:tlsdesc_lo12:var]
index 2263307f41ad4e5413bc17c563e2d63426ce3ac9..e7058f79b8569eb1f48240ef6247029cb8f85bcb 100644 (file)
@@ -1,3 +1,10 @@
+2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * aarch64.h (R_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
+       (R_AARCH64_TLSDESC_LD_PREL19): ... this.
+       (R_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
+       (R_AARCH64_TLSDESC_ADR_PAGE21): ... this.
+
 2013-05-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        * common.h (EM_INTEL205): New.
index e3af4442a25183bfa2e023bcb67fe99306b72729..a7b86c10ed8f00e3b73c2e286b5399a472d0c809 100644 (file)
@@ -178,9 +178,9 @@ RELOC_NUMBER (R_AARCH64_TLSLE_ADD_TPREL_LO12_NC, 551)
 FAKE_RELOC (R_AARCH64_tls_max, 552)
 
 FAKE_RELOC (R_AARCH64_tlsdesc_min, 560)
-RELOC_NUMBER (R_AARCH64_TLSDESC_LD64_PREL19, 560)
+RELOC_NUMBER (R_AARCH64_TLSDESC_LD_PREL19, 560)
 RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PREL21, 561)
-RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE, 562)
+RELOC_NUMBER (R_AARCH64_TLSDESC_ADR_PAGE21, 562)
 RELOC_NUMBER (R_AARCH64_TLSDESC_LD64_LO12_NC, 563)
 RELOC_NUMBER (R_AARCH64_TLSDESC_ADD_LO12_NC, 564)
 RELOC_NUMBER (R_AARCH64_TLSDESC_OFF_G1, 565)