PPC gold doesn't check for overflow properly
authorAlan Modra <amodra@gmail.com>
Thu, 20 Nov 2014 21:45:04 +0000 (08:15 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 20 Nov 2014 21:46:22 +0000 (08:16 +1030)
* powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
for undefined weaks.

gold/ChangeLog
gold/powerpc.cc

index 14b764e4b2452520cb3f947c64220ec37ff5b05b..66c7fca37b0afb1abc7953c2bdbca1ea6538c7b4 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-21  Alan Modra  <amodra@gmail.com>
+
+       * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
+       for undefined weaks.
+
 2014-11-20  Alan Modra  <amodra@gmail.com>
 
        * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
index 0442e56081fffd0d778261b00115d4819fb36aad..4c90e389b85b5cb7a0acaf8b0c7121e67e993be6 100644 (file)
@@ -7672,10 +7672,10 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
       break;
     }
   if (status != Powerpc_relocate_functions<size, big_endian>::STATUS_OK
-      && !has_stub_value
-      && !(gsym != NULL
-          && gsym->is_weak_undefined()
-          && is_branch_reloc(r_type)))
+      && (has_stub_value
+         || !(gsym != NULL
+              && gsym->is_weak_undefined()
+              && is_branch_reloc(r_type))))
     {
       gold_error_at_location(relinfo, relnum, rela.get_r_offset(),
                             _("relocation overflow"));