gold linker v2.22: Remove unnecessary assertions
authorJohn Marino <dragonflybsd@marino.st>
Tue, 3 Jan 2012 16:51:24 +0000 (17:51 +0100)
committerFran├žois Tigeot <ftigeot@wolfpond.org>
Tue, 3 Jan 2012 17:47:50 +0000 (18:47 +0100)
Fixes this error: internal error in relocate_tls
Reported as binutils bug 13359
<http://sourceware.org/bugzilla/show_bug.cgi?id=13359>
Applied to trunk 2011-10-31
Backported to 2.22 branch on 2011-12-19

contrib/binutils-2.22/README.DRAGONFLY
contrib/binutils-2.22/gold/i386.cc
contrib/binutils-2.22/gold/x86_64.cc

index 8416e5b..fc5cf71 100644 (file)
@@ -12,6 +12,8 @@ A list of files and directories removed is in README.DELETED
 
 Local modifications applied to following files:
        bfd/bfdver.h (new)
+       gold/i386.cc
        gold/options.cc
        gold/options.h
+       gold/x86_64.cc
        ld/ldlex.l
index 445bc68..191a915 100644 (file)
@@ -2709,12 +2709,6 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
             }
           if (optimized_type == tls::TLSOPT_TO_IE)
            {
-             if (tls_segment == NULL)
-               {
-                 gold_assert(parameters->errors()->error_count() > 0
-                             || issue_undefined_symbol_error(gsym));
-                 return;
-               }
              this->tls_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type,
                                  got_offset, view, view_size);
               break;
index e6b0021..2ed62d4 100644 (file)
@@ -3181,12 +3181,6 @@ Target_x86_64::Relocate::relocate_tls(const Relocate_info<64, false>* relinfo,
             }
           if (optimized_type == tls::TLSOPT_TO_IE)
             {
-             if (tls_segment == NULL)
-               {
-                 gold_assert(parameters->errors()->error_count() > 0
-                             || issue_undefined_symbol_error(gsym));
-                 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);