From 13755f406d6615e0750213edb04a023ec2ba7b9b Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 2 Aug 2018 16:13:49 -0700 Subject: [PATCH] RISC-V: Fix TLS and --gc-sections conflict. bfd/ * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn, add SEC_LINKER_CREATED flag. --- bfd/ChangeLog | 5 +++++ bfd/elfnn-riscv.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1751cbce86b..ec4077fb41e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2018-08-02 Jim Wilson + + * elfnn-riscv.c (riscv_elf_create_dynamic_sections): For .tdata.dyn, + add SEC_LINKER_CREATED flag. + 2018-08-01 Nick Clifton * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 934704a87e7..4be3eceda88 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -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 -- 2.30.2