aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-01-22 11:24:12 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-01-24 08:56:07 -0800
commitd85e71fec0aa4d9d8ca0d8c2401cd8ab69fe2edc (patch)
treec2f6433e306e4666c6c801c25cea4c9725df2146 /ld/emultempl
parent6b6aa828818fa4a5754fb8520751077146d9d16c (diff)
downloadgdb-d85e71fec0aa4d9d8ca0d8c2401cd8ab69fe2edc.zip
gdb-d85e71fec0aa4d9d8ca0d8c2401cd8ab69fe2edc.tar.gz
gdb-d85e71fec0aa4d9d8ca0d8c2401cd8ab69fe2edc.tar.bz2
Improve orphaned TLS section handling
ld/ PR ld/16498 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Improve orphaned TLS section handling. ld/testsuite/ PR ld/16498 * ld-elf/pr16498a.d: New file. * ld-elf/pr16498a.s: Likewise. * ld-elf/pr16498a.t: Likewise.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em6
1 files changed, 6 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index a4f04f1..fda0e68 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1812,6 +1812,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
{ ".rodata",
SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA,
0, 0, 0, 0 },
+ { ".tdata",
+ SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_THREAD_LOCAL,
+ 0, 0, 0, 0 },
{ ".data",
SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_DATA,
0, 0, 0, 0 },
@@ -1835,6 +1838,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
{
orphan_text = 0,
orphan_rodata,
+ orphan_tdata,
orphan_data,
orphan_bss,
orphan_rel,
@@ -1962,6 +1966,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
place = &hold[orphan_bss];
else if ((s->flags & SEC_SMALL_DATA) != 0)
place = &hold[orphan_sdata];
+ else if ((s->flags & SEC_THREAD_LOCAL) != 0)
+ place = &hold[orphan_tdata];
else if ((s->flags & SEC_READONLY) == 0)
place = &hold[orphan_data];
else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))