RISC-V: Fix TLS and --gc-sections conflict.
authorJim Wilson <jimw@sifive.com>
Thu, 2 Aug 2018 23:13:49 +0000 (16:13 -0700)
committerJim Wilson <jimw@sifive.com>
Thu, 2 Aug 2018 23:13:49 +0000 (16:13 -0700)
bfd/
* elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
add SEC_LINKER_CREATED flag.

bfd/ChangeLog
bfd/elfnn-riscv.c

index 1751cbce86b4f4bf0a8d7bd5745b3ff6616f2fa1..ec4077fb41efe4c896f9d52bb74b9b76d7ba074e 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-02  Jim Wilson  <jimw@sifive.com>
+
+       * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn,
+       add SEC_LINKER_CREATED flag.
+
 2018-08-01  Nick Clifton  <nickc@redhat.com>
 
        * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings
index 934704a87e78604b526f1a7c8f138a471bb46c5b..4be3eceda88ac33e7f384f50e90ce15394bad947 100644 (file)
@@ -353,7 +353,8 @@ riscv_elf_create_dynamic_sections (bfd *dynobj,
     {
       htab->sdyntdata =
        bfd_make_section_anyway_with_flags (dynobj, ".tdata.dyn",
-                                           SEC_ALLOC | SEC_THREAD_LOCAL);
+                                           (SEC_ALLOC | SEC_THREAD_LOCAL
+                                            | SEC_LINKER_CREATED));
     }
 
   if (!htab->elf.splt || !htab->elf.srelplt || !htab->elf.sdynbss