This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold commit] Fix bug with previous patch for unresolved TLS symbol
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Alan Modra <amodra at gmail dot com>
- Date: Mon, 2 Feb 2015 11:49:46 -0800
- Subject: [gold commit] Fix bug with previous patch for unresolved TLS symbol
- Authentication-results: sourceware.org; auth=none
I needed to check that the output is executable before assuming that we
can replace the reference with zero.
-cary
2015-02-02 Cary Coutant <ccoutant@google.com>
gold/
* x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
executable output file.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index a4aebc8..4543c8a 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -3784,7 +3784,9 @@ Target_x86_64<size>::Relocate::relocate_tls(
break;
case elfcpp::R_X86_64_GOTTPOFF: // Initial-exec
- if (gsym != NULL && gsym->is_undefined())
+ if (gsym != NULL
+ && gsym->is_undefined()
+ && parameters->options().output_is_executable())
{
Target_x86_64<size>::Relocate::tls_ie_to_le(relinfo, relnum,
NULL, rela,