aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-11-20 15:08:25 +0000
committerNick Clifton <nickc@redhat.com>2007-11-20 15:08:25 +0000
commit430a16a51d442dd9c7f91631388815d54c70481f (patch)
tree55b2da5727325f2f8c2600aac85cd4d119e4db05 /bfd/elflink.c
parent2207132da48e8347055233edd8cc6b8abffdd0a0 (diff)
downloadgdb-430a16a51d442dd9c7f91631388815d54c70481f.zip
gdb-430a16a51d442dd9c7f91631388815d54c70481f.tar.gz
gdb-430a16a51d442dd9c7f91631388815d54c70481f.tar.bz2
* elflink.c (elf_link_output_extsym): Weaken assertion: if --gc-section is set, there may be no TLS segment.
* lib/ld-lib.exp (check_gc_sections_available): New proc, based on the version in gcc/testsuite/lib/target-supports.exp. * ld-elf/eld.exp: Use check_gc_sections_available.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 63a8c65..48072f8 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8536,10 +8536,15 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
sym.st_value += input_sec->output_section->vma;
if (h->type == STT_TLS)
{
- /* STT_TLS symbols are relative to PT_TLS segment
- base. */
- BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
- sym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
+ asection *tls_sec = elf_hash_table (finfo->info)->tls_sec;
+ if (tls_sec != NULL)
+ sym.st_value -= tls_sec->vma;
+ else
+ {
+ /* The TLS section may have been garbage collected. */
+ BFD_ASSERT (finfo->info->gc_sections
+ && !input_sec->gc_mark);
+ }
}
}
}