aboutsummaryrefslogtreecommitdiff
path: root/gold/i386.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-05-16 20:44:22 +0000
committerIan Lance Taylor <ian@airs.com>2008-05-16 20:44:22 +0000
commit497897f98cc3ae32477afbbf00fd871372a69ce7 (patch)
tree8dec774b757ecdf7a4a9bb2e81d9407803c40411 /gold/i386.cc
parent7c0d47a533c297ddb977c00493133115ef8c23eb (diff)
downloadgdb-497897f98cc3ae32477afbbf00fd871372a69ce7.zip
gdb-497897f98cc3ae32477afbbf00fd871372a69ce7.tar.gz
gdb-497897f98cc3ae32477afbbf00fd871372a69ce7.tar.bz2
* i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we know the dynamic type. * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_ field. Initialize it in constructor. (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD. Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block reloc.
Diffstat (limited to 'gold/i386.cc')
-rw-r--r--gold/i386.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gold/i386.cc b/gold/i386.cc
index 9f86229..1d04f4f 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -1843,6 +1843,7 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
case elfcpp::R_386_TLS_GOTDESC: // Global-dynamic (from ~oliva url)
case elfcpp::R_386_TLS_DESC_CALL:
+ this->local_dynamic_type_ = LOCAL_DYNAMIC_GNU;
if (optimized_type == tls::TLSOPT_TO_LE)
{
gold_assert(tls_segment != NULL);
@@ -1927,7 +1928,8 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
// This reloc can appear in debugging sections, in which case we
// won't see the TLS_LDM reloc. The local_dynamic_type field
// tells us this.
- if (optimized_type == tls::TLSOPT_TO_LE)
+ if (optimized_type == tls::TLSOPT_TO_LE
+ && this->local_dynamic_type_ != LOCAL_DYNAMIC_NONE)
{
gold_assert(tls_segment != NULL);
value -= tls_segment->memsz();