aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2015-02-02 11:46:45 -0800
committerCary Coutant <ccoutant@google.com>2015-02-02 11:46:45 -0800
commit24dd580891ed5fc331758d608b16d636eabd1ad3 (patch)
tree467621b715ec2568cf11d607e5647f8b2d28d92b /gold/x86_64.cc
parentaa3de2670f9f9327b25c47546c0005d4a80da546 (diff)
downloadfsf-binutils-gdb-24dd580891ed5fc331758d608b16d636eabd1ad3.zip
fsf-binutils-gdb-24dd580891ed5fc331758d608b16d636eabd1ad3.tar.gz
fsf-binutils-gdb-24dd580891ed5fc331758d608b16d636eabd1ad3.tar.bz2
Fix bug with previous patch for unresolved TLS symbol.
We need to check that the output is executable before assuming that we can replace the reference with zero. 2015-02-02 Cary Coutant <ccoutant@google.com> gold/ * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for executable output file.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc4
1 files changed, 3 insertions, 1 deletions
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,