[Binutils][AARCH64]Add TLS IE large memory support.
authorRenlin Li <renlin.li@arm.com>
Fri, 2 Oct 2015 15:59:46 +0000 (16:59 +0100)
committerRenlin Li <renlin.li@arm.com>
Fri, 2 Oct 2015 16:56:08 +0000 (17:56 +0100)
bfd/

2015-10-02  Renlin Li <renlin.li@arm.com>

* reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
* libbfd.h: Regenerate.
* bfd-in2.h: Likewise.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
TLSIE_MOVW_GOTTPREL_G1 check overflow.
(aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
and TLSIE_MOVW_GOTTPREL_G0_NC.
(elfNN_aarch64_final_link_relocate): Likewise.
(elfNN_aarch64_relocate_section): Likewise.
(elfNN_aarch64_gc_sweep_hook): Likewise.
(elfNN_aarch64_check_relocs): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.

gas/

2015-10-02  Renlin Li <renlin.li@arm.com>

* config/tc-aarch64.c (reloc_table): Add two entries for
gottprel_g0_nc and gottprel_g1.
(process_movw_reloc_info): Add support.
(md_apply_fix): Likewise.
(aarch64_force_relocation): Likewise.

gas/testsuite/

2015-10-02  Renlin Li <renlin.li@arm.com>

* gas/aarch64/reloc-gottprel_g0_nc.d: New.
* gas/aarch64/reloc-gottprel_g0_nc.s: New.
* gas/aarch64/reloc-gottprel_g1.d: New.
* gas/aarch64/reloc-gottprel_g1.s: New.

ld/testsuite/

2015-10-02  Renlin Li <renlin.li@arm.com>

* ld-aarch64/tls-large-ie.d: New.
* ld-aarch64/tls-large-ie.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.

17 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/elfnn-aarch64.c
bfd/elfxx-aarch64.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/ChangeLog
gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-gottprel_g1.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-gottprel_g1.s [new file with mode: 0644]
ld/testsuite/ChangeLog
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/tls-large-ie.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/tls-large-ie.s [new file with mode: 0644]

index a02858966273de341d20e08015683bf7e29580ae..7a9ba59c43a762f31e8004915faf9a060ad84cc7 100644 (file)
@@ -1,3 +1,20 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
+       AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
+       * libbfd.h: Regenerate.
+       * bfd-in2.h: Likewise.
+       * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
+       TLSIE_MOVW_GOTTPREL_G1 check overflow.
+       (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
+       and TLSIE_MOVW_GOTTPREL_G0_NC.
+       (elfNN_aarch64_final_link_relocate): Likewise.
+       (elfNN_aarch64_relocate_section): Likewise.
+       (elfNN_aarch64_gc_sweep_hook): Likewise.
+       (elfNN_aarch64_check_relocs): Likewise.
+       * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+       (_bfd_aarch64_elf_resolve_relocation): Likewise.
+
 2015-10-02  Renlin Li  <renlin.li@arm.com>
 
        * elfnn-aarch64.c (aarch64_reloc_got_type): Add
index 036bbbbbf998eb22636b6e0249fab4d40f35ff25..f4f98af40d38ec24d187d70338ab8c81efe526c2 100644 (file)
@@ -5792,12 +5792,6 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
 /* AArch64 TLS General Dynamic relocation.  */
   BFD_RELOC_AARCH64_TLSGD_MOVW_G1,
 
-/* AArch64 TLS INITIAL EXEC relocation.  */
-  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
-
-/* AArch64 TLS INITIAL EXEC relocation.  */
-  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
-
 /* AArch64 TLS INITIAL EXEC relocation.  */
   BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,
 
@@ -5810,6 +5804,12 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
 /* AArch64 TLS INITIAL EXEC relocation.  */
   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
 
+/* AArch64 TLS INITIAL EXEC relocation.  */
+  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
+
+/* AArch64 TLS INITIAL EXEC relocation.  */
+  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
+
 /* bit[23:12] of byte offset to module TLS base address.  */
   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
 
index 7c9310f6842b0d40dedeea31524f740e7d46e9b1..2bbdf65097da88ce9c94ba26152dc03eceeb2768 100644 (file)
@@ -1038,34 +1038,6 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
         0xffff,                /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */
-        16,                    /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        16,                    /* bitsize */
-        FALSE,                 /* pc_relative */
-        0,                     /* bitpos */
-        complain_overflow_dont,        /* complain_on_overflow */
-        bfd_elf_generic_reloc, /* special_function */
-        AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1),        /* name */
-        FALSE,                 /* partial_inplace */
-        0xffff,                /* src_mask */
-        0xffff,                /* dst_mask */
-        FALSE),                /* pcrel_offset */
-
-  HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC),      /* type */
-        0,                     /* rightshift */
-        2,                     /* size (0 = byte, 1 = short, 2 = long) */
-        16,                    /* bitsize */
-        FALSE,                 /* pc_relative */
-        0,                     /* bitpos */
-        complain_overflow_dont,        /* complain_on_overflow */
-        bfd_elf_generic_reloc, /* special_function */
-        AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC),     /* name */
-        FALSE,                 /* partial_inplace */
-        0xffff,                /* src_mask */
-        0xffff,                /* dst_mask */
-        FALSE),                /* pcrel_offset */
-
   HOWTO (AARCH64_R (TLSIE_ADR_GOTTPREL_PAGE21),        /* type */
         12,                    /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
@@ -1122,6 +1094,34 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
         0x1ffffc,              /* dst_mask */
         FALSE),                /* pcrel_offset */
 
+  HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G0_NC),      /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_dont,        /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G0_NC),     /* name */
+        FALSE,                 /* partial_inplace */
+        0xffff,                /* src_mask */
+        0xffff,                /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
+  HOWTO64 (AARCH64_R (TLSIE_MOVW_GOTTPREL_G1), /* type */
+        16,                    /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_unsigned,    /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        AARCH64_R_STR (TLSIE_MOVW_GOTTPREL_G1),        /* name */
+        FALSE,                 /* partial_inplace */
+        0xffff,                /* src_mask */
+        0xffff,                /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
   /* ADD: bit[23:12] of byte offset to module TLS base address.  */
   HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_HI12),    /* type */
         12,                    /* rightshift */
@@ -4506,6 +4506,8 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type)
     case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
       return GOT_TLS_IE;
 
     default:
@@ -5476,6 +5478,8 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
 
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G1:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
       if (globals->root.sgot == NULL)
        return bfd_reloc_notsupported;
 
@@ -6120,6 +6124,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
        case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
        case BFD_RELOC_AARCH64_TLSIE_LDNN_GOTTPREL_LO12_NC:
        case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
          if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx))
            {
              bfd_boolean need_relocs = FALSE;
@@ -6566,6 +6572,8 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
        case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
        case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
        case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
        case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
        case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
        case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
@@ -7041,6 +7049,8 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
        case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
        case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+       case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
        case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
        case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
        case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
index b57471e381816a472a291d08926eb72549322240..47e19779e11652f21ca7303a84f780c56d68f066 100644 (file)
@@ -335,6 +335,8 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
     case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1:
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G1:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
@@ -492,6 +494,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
       value = value + addend;
       break;
 
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
       value = (value + addend) & (bfd_vma) 0xffff0000;
@@ -502,6 +505,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
       value = (value + addend) & ~(bfd_vma) 0xfff;
       break;
 
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
       value = (value + addend) & (bfd_vma) 0xffff;
index 3d3d586c12d67f1915f587f54583a782ea03f40a..03bb05770e8eb134a0398e61b80326d544808714 100644 (file)
@@ -2757,12 +2757,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC",
   "BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC",
   "BFD_RELOC_AARCH64_TLSGD_MOVW_G1",
-  "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1",
-  "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC",
   "BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21",
   "BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC",
   "BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC",
   "BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19",
+  "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC",
+  "BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1",
   "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12",
   "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12",
   "BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC",
index a08019169d9782a45f6003acca60b7a63bacc2b3..18ca7bbf3837ea2ee7f230b12ef36a75271e16e2 100644 (file)
@@ -6838,27 +6838,27 @@ ENUM
 ENUMDOC
   AArch64 TLS General Dynamic relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1
+  BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC
+  BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21
+  BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
+  BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC
+  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
-  BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19
+  BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1
 ENUMDOC
   AArch64 TLS INITIAL EXEC relocation.
 ENUM
index 5fc9cae3cc8ce873ab6af8343f62a07fef60ee4e..38175b1efdf4c5ac2022302458032f4b42785541 100644 (file)
@@ -1,3 +1,11 @@
+2015-10-02  Renlin Li <renlin.li@arm.com>
+
+       * config/tc-aarch64.c (reloc_table): Add two entries for
+       gottprel_g0_nc and gottprel_g1.
+       (process_movw_reloc_info): Add support.
+       (md_apply_fix): Likewise.
+       (aarch64_force_relocation): Likewise.
+
 2015-10-02  Renlin Li <renlin.li@arm.com>
 
        * config/tc-aarch64.c (reloc_table): New relocation modifier tlsgd_g0_nc.
index a13ba55c1ae55bc9805787a2a945347ea300fd14..8d6f1f9e019ea8ab8210ee8f3790ca93f4a68c5c 100644 (file)
@@ -2482,6 +2482,24 @@ static struct reloc_table_entry reloc_table[] = {
    BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
    0},
 
+  /* Get to the page containing GOT TLS entry for a symbol */
+  {"gottprel_g0_nc", 0,
+   0,                          /* adr_type */
+   0,
+   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,
+   0,
+   0,
+   0},
+
+  /* Get to the page containing GOT TLS entry for a symbol */
+  {"gottprel_g1", 0,
+   0,                          /* adr_type */
+   0,
+   BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1,
+   0,
+   0,
+   0},
+
   /* Get to the page containing GOT TLS entry for a symbol */
   {"tlsgd", 0,
    BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, /* adr_type */
@@ -4706,6 +4724,7 @@ process_movw_reloc_info (void)
     case BFD_RELOC_AARCH64_MOVW_G0_S:
     case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC:
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
@@ -4717,6 +4736,7 @@ process_movw_reloc_info (void)
     case BFD_RELOC_AARCH64_MOVW_G1_S:
     case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1:
     case BFD_RELOC_AARCH64_TLSGD_MOVW_G1:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1:
     case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC:
     case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
@@ -6942,6 +6962,8 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
     case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
     case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12:
     case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
     case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
@@ -7172,7 +7194,9 @@ aarch64_force_relocation (struct fix *fixp)
     case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
-    case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
+    case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
+   case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12:
     case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
     case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
index cbc37a86ebdb78612858c5569e96d61a4f14d8ee..ce49c444cfd984a70c9ebe462039c3e1474354f0 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-02  Renlin Li <renlin.li@arm.com>
+
+       * gas/aarch64/reloc-gottprel_g0_nc.d: New.
+       * gas/aarch64/reloc-gottprel_g0_nc.s: New.
+       * gas/aarch64/reloc-gottprel_g1.d: New.
+       * gas/aarch64/reloc-gottprel_g1.s: New.
+
 2015-10-02  Renlin Li <renlin.li@arm.com>
 
     * gas/aarch64/reloc-tlsgd_g0_nc.d: New.
diff --git a/gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.d b/gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.d
new file mode 100644 (file)
index 0000000..07c78c3
--- /dev/null
@@ -0,0 +1,9 @@
+#objdump: -dr
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0000000000000000 <.*>:
+   0:  f280001c        movk    x28, #0x0
+                       0: R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC  x
diff --git a/gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.s b/gas/testsuite/gas/aarch64/reloc-gottprel_g0_nc.s
new file mode 100644 (file)
index 0000000..c8178ff
--- /dev/null
@@ -0,0 +1,4 @@
+// Test file for AArch64 GAS -- gottprel_g0_nc
+
+func:
+       movk x28, #:gottprel_g0_nc:x
diff --git a/gas/testsuite/gas/aarch64/reloc-gottprel_g1.d b/gas/testsuite/gas/aarch64/reloc-gottprel_g1.d
new file mode 100644 (file)
index 0000000..4da88cf
--- /dev/null
@@ -0,0 +1,9 @@
+#objdump: -dr
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0000000000000000 <.*>:
+   0:  d2a0001c        movz    x28, #0x0, lsl #16
+                       0: R_AARCH64_TLSIE_MOVW_GOTTPREL_G1     x
diff --git a/gas/testsuite/gas/aarch64/reloc-gottprel_g1.s b/gas/testsuite/gas/aarch64/reloc-gottprel_g1.s
new file mode 100644 (file)
index 0000000..64491f7
--- /dev/null
@@ -0,0 +1,4 @@
+// Test file for AArch64 GAS -- gottprel_g1
+
+func:
+       movz x28, #:gottprel_g1:x
index e755b8a58a60e7f6584751f602ff11cd668d5a74..e486bbaf10631b4726701dac8bcce581e6a85028 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-02  Renlin Li  <renlin.li@arm.com>
+
+       * ld-aarch64/tls-large-ie.d: New.
+       * ld-aarch64/tls-large-ie.s: New.
+       * ld-aarch64/aarch64-elf.exp: Run new test.
+
 2015-10-02  Renlin Li  <renlin.li@arm.com>
 
        * ld-aarch64/emit-relocs-516.d: New.
index 3cafff3fe3f26c2e38d87db3de9ba70fa664108c..d0da92f46f0182e8ab4e53d8f44d6e465acfbad2 100644 (file)
@@ -197,6 +197,7 @@ run_dump_test "tls-tiny-desc"
 run_dump_test "tls-tiny-desc-ie"
 run_dump_test "tls-tiny-desc-le"
 run_dump_test "tls-tiny-ie"
+run_dump_test "tls-large-ie"
 run_dump_test "tls-tiny-ld"
 run_dump_test "tls-small-ld"
 run_dump_test "tlsle"
diff --git a/ld/testsuite/ld-aarch64/tls-large-ie.d b/ld/testsuite/ld-aarch64/tls-large-ie.d
new file mode 100644 (file)
index 0000000..dd0a14d
--- /dev/null
@@ -0,0 +1,19 @@
+#source: tls-large-ie.s
+#ld: -shared -T relocs.ld -e0
+#objdump: -dr
+#...
+
+Disassembly of section .text:
+
+0000000000010000 \<test\>:
+   10000:      58000121        ldr     x1, 10024 \<test\+0x24\>
+   10004:      10000102        adr     x2, 10024 \<test\+0x24\>
+   10008:      8b020021        add     x1, x1, x2
+   1000c:      d53bd042        mrs     x2, tpidr_el0
+   10010:      d2a00000        movz    x0, #0x0, lsl #16
+   10014:      f2800100        movk    x0, #0x8
+   10018:      f8606820        ldr     x0, \[x1,x0\]
+   1001c:      8b020000        add     x0, x0, x2
+   10020:      d503201f        nop
+   10024:      0000ffdc        .word   0x0000ffdc
+   10028:      00000000        .word   0x00000000
diff --git a/ld/testsuite/ld-aarch64/tls-large-ie.s b/ld/testsuite/ld-aarch64/tls-large-ie.s
new file mode 100644 (file)
index 0000000..89a2e6b
--- /dev/null
@@ -0,0 +1,15 @@
+       .global var
+       .text
+test:
+       ldr x1, .Lgot
+       adr x2, .Lgot
+       add x1, x1, x2
+
+       mrs x2, tpidr_el0
+       movz x0, #:gottprel_g1:var
+       movk x0, #:gottprel_g0_nc:var
+       ldr x0, [x1, x0]
+       add x0, x0, x2
+       nop
+
+.Lgot: .xword _GLOBAL_OFFSET_TABLE_ - .