From 24dd580891ed5fc331758d608b16d636eabd1ad3 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Mon, 2 Feb 2015 11:46:45 -0800 Subject: [PATCH] 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 gold/ * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for executable output file. --- gold/ChangeLog | 5 +++++ gold/x86_64.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 601d11b5ba3..399588e3f6a 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2015-02-02 Cary Coutant + + * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for + executable output file. + 2015-01-22 Han Shen * arm.cc (Target_arm::Target_arm): Add initialization for new members. diff --git a/gold/x86_64.cc b/gold/x86_64.cc index a4aebc82c2c..4543c8a8abc 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -3784,7 +3784,9 @@ Target_x86_64::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::Relocate::tls_ie_to_le(relinfo, relnum, NULL, rela, -- 2.30.2