aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-07-08 23:49:11 +0000
committerIan Lance Taylor <ian@airs.com>2011-07-08 23:49:11 +0000
commit62855347684cda4254e2b8f1f80ed95e18ab5b76 (patch)
treeac7dc032f7360ae5b1af58c18bb26d0495c1dcc7 /gold/x86_64.cc
parent67181c72fbaad59e5793cf6bcb8d12d7d211c817 (diff)
downloadgdb-62855347684cda4254e2b8f1f80ed95e18ab5b76.zip
gdb-62855347684cda4254e2b8f1f80ed95e18ab5b76.tar.gz
gdb-62855347684cda4254e2b8f1f80ed95e18ab5b76.tar.bz2
PR gold/12279
* resolve.cc (Symbol_table::should_override): Add fromtype parameter. Change all callers. Give error when linking together TLS and non-TLS symbol. (Symbol_table::should_override_with_special): Add fromtype parameter. Change all callers. * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if there is no TLS segment if we have reported some errors. * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc53
1 files changed, 45 insertions, 8 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index da4efed..182429e 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -3110,7 +3110,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
}
if (optimized_type == tls::TLSOPT_TO_LE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
this->tls_gd_to_le(relinfo, relnum, tls_segment,
rela, r_type, value, view,
view_size);
@@ -3136,7 +3140,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
}
if (optimized_type == tls::TLSOPT_TO_IE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
value = target->got_plt_section()->address() + got_offset;
this->tls_gd_to_ie(relinfo, relnum, tls_segment, rela, r_type,
value, view, address, view_size);
@@ -3165,7 +3173,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
}
if (optimized_type == tls::TLSOPT_TO_LE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
this->tls_desc_gd_to_le(relinfo, relnum, tls_segment,
rela, r_type, value, view,
view_size);
@@ -3200,7 +3212,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
}
if (optimized_type == tls::TLSOPT_TO_IE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
value = target->got_plt_section()->address() + got_offset;
this->tls_desc_gd_to_ie(relinfo, relnum, tls_segment,
rela, r_type, value, view, address,
@@ -3232,7 +3248,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
}
if (optimized_type == tls::TLSOPT_TO_LE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
this->tls_ld_to_le(relinfo, relnum, tls_segment, rela, r_type,
value, view, view_size);
break;
@@ -3262,7 +3282,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
// R_X86_64_TLSLD.
if (optimized_type == tls::TLSOPT_TO_LE && is_executable)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
value -= tls_segment->memsz();
}
Relocate_functions<64, false>::rela32(view, value, addend);
@@ -3272,7 +3296,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
// See R_X86_64_DTPOFF32, just above, for why we check for is_executable.
if (optimized_type == tls::TLSOPT_TO_LE && is_executable)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
value -= tls_segment->memsz();
}
Relocate_functions<64, false>::rela64(view, value, addend);
@@ -3281,7 +3309,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
if (optimized_type == tls::TLSOPT_TO_LE)
{
- gold_assert(tls_segment != NULL);
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
Target_x86_64::Relocate::tls_ie_to_le(relinfo, relnum, tls_segment,
rela, r_type, value, view,
view_size);
@@ -3316,6 +3348,11 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
break;
case elfcpp::R_X86_64_TPOFF32: // Local-exec
+ if (tls_segment == NULL)
+ {
+ gold_assert(parameters->errors()->error_count() > 0);
+ return;
+ }
value -= tls_segment->memsz();
Relocate_functions<64, false>::rela32(view, value, addend);
break;