]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Disable use of TLS copy relocs.
authorJim Wilson <jimw@sifive.com>
Thu, 9 Jan 2020 01:04:45 +0000 (01:04 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 9 Jan 2020 01:04:45 +0000 (17:04 -0800)
Musl and lld don't support TLS copy relocs, and don't want to add support
for this feature which is unique to RISC-V.  Only GNU ld and glibc support
them.  In the pasbi discussion, people have pointed out various problems
with using them, so we are deprecating them.  There doesn't seem to be an
ABI break from dropping them so this patch modifies gcc to stop creating
them.  I'm using an ifdef for now in case a problem turns up and the code
has to be re-enabled.  The plan is to add an initial to local exec
relaxation as a replacement, though this has not been defined or
implemented yet.

gcc/
* config/riscv/riscv.c (riscv_legitimize_tls_address): Ifdef out
use of TLS_MODEL_LOCAL_EXEC when not pic.

From-SVN: r280025

gcc/ChangeLog
gcc/config/riscv/riscv.c

index 838f564ca90efa313b3e74cd1a37162d51424cae..4587da982b45ca3fd441b1f779fd6f4a1fdd12c3 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-08  Jim Wilson  <jimw@sifive.com>
+
+       * config/riscv/riscv.c (riscv_legitimize_tls_address): Ifdef out
+       use of TLS_MODEL_LOCAL_EXEC when not pic.
+
 2020-01-08  David Malcolm  <dmalcolm@redhat.com>
 
        * hash-map-tests.c (selftest::test_map_of_strings_to_int): Fix
index 3e0bedaf145e5a496b2ea21aff765dd9bb361fd2..4ba811126feb866f39ab4cf0a26bf4cb550d3ed3 100644 (file)
@@ -1257,9 +1257,12 @@ riscv_legitimize_tls_address (rtx loc)
   rtx dest, tp, tmp;
   enum tls_model model = SYMBOL_REF_TLS_MODEL (loc);
 
+#if 0
+  /* TLS copy relocs are now deprecated and should not be used.  */
   /* Since we support TLS copy relocs, non-PIC TLS accesses may all use LE.  */
   if (!flag_pic)
     model = TLS_MODEL_LOCAL_EXEC;
+#endif
 
   switch (model)
     {