aboutsummaryrefslogtreecommitdiff
path: root/bfd
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
parent2207132da48e8347055233edd8cc6b8abffdd0a0 (diff)
downloadfsf-binutils-gdb-430a16a51d442dd9c7f91631388815d54c70481f.zip
fsf-binutils-gdb-430a16a51d442dd9c7f91631388815d54c70481f.tar.gz
fsf-binutils-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')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f85cf92..c02027b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-16 Tristan Gingold <gingold@adacore.com>
+
+ * elflink.c (elf_link_output_extsym): Weaken assertion: if
+ --gc-section is set, there may be no TLS segment.
+
2007-11-19 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (bfd_elf_perform_complex_relocation): Update prototype.
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);
+ }
}
}
}