Fix bug with previous patch for unresolved TLS symbol.
authorCary Coutant <ccoutant@google.com>
Mon, 2 Feb 2015 19:46:45 +0000 (11:46 -0800)
committerCary Coutant <ccoutant@google.com>
Mon, 2 Feb 2015 19:46:45 +0000 (11:46 -0800)
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.

gold/ChangeLog
gold/x86_64.cc

index 601d11b5ba36bc03d5ff87288be8706515990cca..399588e3f6acae776acf345c73b74ec8baab04ec 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-02  Cary Coutant  <ccoutant@google.com>
+
+       * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
+       executable output file.
+
 2015-01-22  Han Shen  <shenhan@google.com>
 
        * arm.cc (Target_arm::Target_arm): Add initialization for new members.
index a4aebc82c2cebc90f970ee6e95a498c39eab2de4..4543c8a8abc25f1ba7fea916f676badae0abdf98 100644 (file)
@@ -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,