Add support for R_AARCH64_TLSLE_LDST8_TPREL_LO12, etc.
authorCary Coutant <ccoutant@gmail.com>
Wed, 28 Mar 2018 01:24:48 +0000 (18:24 -0700)
committerCary Coutant <ccoutant@gmail.com>
Wed, 28 Mar 2018 16:10:25 +0000 (09:10 -0700)
elfcpp/
PR gold/22969
* aarch64.h: Fix spelling of R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC.
gold/
PR gold/22969
* aarch64-reloc.def: Add TLSLE_LDST* relocations.
* aarch64.cc (Target_aarch64::optimize_tls_reloc): Likewise.
(Target_aarch64::Scan::local): Likewise.
(Target_aarch64::Scan::global): Likewise.
(Target_aarch64::Relocate::relocate): Likewise.
(Target_aarch64::Relocate::relocate_tls): Likewise.

elfcpp/ChangeLog
elfcpp/aarch64.h
gold/ChangeLog
gold/aarch64-reloc.def
gold/aarch64.cc

index 0c253048be8b2ced8a3301af84736e521136ff01..776908fbfeb536b089780cc6d96270522a5af1d9 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-28  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/22969
+       * aarch64.h: Fix spelling of R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC.
+
 2018-01-13  Nick Clifton  <nickc@redhat.com>
 
        2.30 branch created.
index 935a4d70f403fa751865b2106d84f3d2f371cc5a..eb1ce6ae79b61b18f4b67bb6ccd9e444bd69d386 100644 (file)
@@ -146,7 +146,7 @@ enum
   R_AARCH64_TLSLE_LDST8_TPREL_LO12 = 552,      // TPREL(S+A)
   R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC = 553,   // TPREL(S+A)
   R_AARCH64_TLSLE_LDST16_TPREL_LO12 = 554,     // TPREL(S+A)
-  R_AARCH64_TLSLE_LSDT16_TPREL_LO12_NC = 555,  // TPREL(S+A)
+  R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC = 555,  // TPREL(S+A)
   R_AARCH64_TLSLE_LDST32_TPREL_LO12 = 556,     // TPREL(S+A)
   R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC = 557,  // TPREL(S+A)
   R_AARCH64_TLSLE_LDST64_TPREL_LO12 = 558,     // TPREL(S+A)
index 38a2ecf4b7b2ce065408aa06aa63e5ef8bbb5cc3..1ba3414f433f53732f7564f5ccb59fd005ef9b09 100644 (file)
@@ -1,10 +1,19 @@
+2018-03-28  Cary Coutant  <ccoutant@gmail.com>
+
+       PR gold/22969
+       * aarch64-reloc.def: Add TLSLE_LDST* relocations.
+       * aarch64.cc (Target_aarch64::optimize_tls_reloc): Likewise.
+       (Target_aarch64::Scan::local): Likewise.
+       (Target_aarch64::Scan::global): Likewise.
+       (Target_aarch64::Relocate::relocate): Likewise.
+       (Target_aarch64::Relocate::relocate_tls): Likewise.
+
 2018-03-27  Roland McGrath  <mcgrathr@google.com>
 
        * testsuite/split_x86_64.sh: Fix bad regexp.
 
 2018-03-26  Cary Coutant  <ccoutant@gmail.com>
 
-gold/
        PR gold/22868
        * plugin.cc (Sized_pluginobj::do_add_symbols): Use a real section
        index instead of SHN_ABS for defined symbols.
index 2fc0059a7862ec1be663fffc1715c8249d68e8a7..b8528e403858ab8dca8ebbd086207a62972d4253 100644 (file)
@@ -108,6 +108,14 @@ ARD(TLSLE_MOVW_TPREL_G0_NC       , STATIC ,  AARCH64   ,    Y,   0,    0,0
 ARD(TLSLE_ADD_TPREL_HI12         , STATIC ,  AARCH64   ,    Y,  -1,    0,24               ,   12,23 , Symbol::TLS_REF ,                              ADD   )
 ARD(TLSLE_ADD_TPREL_LO12         , STATIC ,  AARCH64   ,    Y,  -1,    0,12               ,    0,11 , Symbol::TLS_REF ,                              ADD   )
 ARD(TLSLE_ADD_TPREL_LO12_NC      , STATIC ,  AARCH64   ,    Y,  -1,    0,0                ,    0,11 , Symbol::TLS_REF ,                              ADD   )
+ARD(TLSLE_LDST8_TPREL_LO12       , STATIC ,  AARCH64   ,    Y,  -1,    0,12               ,    0,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST8_TPREL_LO12_NC    , STATIC ,  AARCH64   ,    Y,  -1,    0,0                ,    0,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST16_TPREL_LO12      , STATIC ,  AARCH64   ,    Y,  -1,    0,12               ,    1,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST16_TPREL_LO12_NC   , STATIC ,  AARCH64   ,    Y,  -1,    0,0                ,    1,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST32_TPREL_LO12      , STATIC ,  AARCH64   ,    Y,  -1,    0,12               ,    2,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST32_TPREL_LO12_NC   , STATIC ,  AARCH64   ,    Y,  -1,    0,0                ,    2,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST64_TPREL_LO12      , STATIC ,  AARCH64   ,    Y,  -1,    0,12               ,    3,11 , Symbol::TLS_REF ,                              LDST  )
+ARD(TLSLE_LDST64_TPREL_LO12_NC   , STATIC ,  AARCH64   ,    Y,  -1,    0,0                ,    3,11 , Symbol::TLS_REF ,                              LDST  )
 // Above is from Table 4-18, Local Exec TLS relocations, 544-571.
 
 ARD(TLSDESC_ADR_PAGE21           , STATIC ,  AARCH64   ,    Y,  -1,    32,32              ,   12,32 , Symbol::TLS_REF ,                              ADRP  )
index 1abdb27f0dbb73794842a8596e4dd23a992ea837..ecb400b27439e2846008ef6ef2d324a80cf6935c 100644 (file)
@@ -5916,6 +5916,14 @@ Target_aarch64<size, big_endian>::optimize_tls_reloc(bool is_final,
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
       // When we already have Local-Exec, there is nothing further we
       // can do.
       return tls::TLSOPT_NONE;
@@ -6262,6 +6270,14 @@ Target_aarch64<size, big_endian>::Scan::local(
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
       {
        layout->set_has_static_tls();
        bool output_is_shared = parameters->options().shared();
@@ -6679,7 +6695,15 @@ Target_aarch64<size, big_endian>::Scan::global(
     case elfcpp::R_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12:
-    case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:  // Local executable
+    case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:  // Local executable
       layout->set_has_static_tls();
       if (parameters->options().shared())
        gold_error(_("%s: unsupported TLSLE reloc type %u in shared objects."),
@@ -7276,6 +7300,14 @@ Target_aarch64<size, big_endian>::Relocate::relocate(
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
     case elfcpp::R_AARCH64_TLSDESC_ADR_PAGE21:
     case elfcpp::R_AARCH64_TLSDESC_LD64_LO12:
     case elfcpp::R_AARCH64_TLSDESC_ADD_LO12:
@@ -7555,6 +7587,14 @@ Target_aarch64<size, big_endian>::Relocate::relocate_tls(
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_HI12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12:
     case elfcpp::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12:
+    case elfcpp::R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
       {
        gold_assert(tls_segment != NULL);
        AArch64_address value = psymval->value(object, 0);