"maint test-settings set/show" -> "maint set/show test-settings"
[deliverable/binutils-gdb.git] / gold / powerpc.cc
index 1f2407130b243a1733e8c8256ac1e14fd1a850e9..6f0be0975a2568a98bd205d29719cc0a346a7b57 100644 (file)
@@ -4733,6 +4733,9 @@ class Stub_table : public Output_relaxed_input_section
     return bytes;
   }
 
+  void
+  plt_error(const Plt_stub_key& p);
+
   // Write out stubs.
   void
   do_write(Output_file*);
@@ -5384,6 +5387,19 @@ Stub_table<size, big_endian>::define_stub_syms(Symbol_table* symtab)
     }
 }
 
+template<int size, bool big_endian>
+void
+Stub_table<size, big_endian>::plt_error(const Plt_stub_key& p)
+{
+  if (p.sym_)
+    gold_error(_("linkage table error against `%s'"),
+              p.sym_->demangled_name().c_str());
+  else
+    gold_error(_("linkage table error against `%s:[local %u]'"),
+              p.object_->name().c_str(),
+              p.locsym_);
+}
+
 // Write out plt and long branch stub code.
 
 template<int size, bool big_endian>
@@ -5424,9 +5440,7 @@ Stub_table<size, big_endian>::do_write(Output_file* of)
              Address off = plt_addr - got_addr;
 
              if (off + 0x80008000 > 0xffffffff || (off & 7) != 0)
-               gold_error(_("%s: linkage table error against `%s'"),
-                          cs->first.object_->name().c_str(),
-                          cs->first.sym_->demangled_name().c_str());
+               this->plt_error(cs->first);
 
              bool plt_load_toc = this->targ_->abiversion() < 2;
              bool static_chain
@@ -5871,8 +5885,7 @@ Output_data_glink<size, big_endian>::do_write(Output_file* of)
          Address off = plt_addr - my_addr;
 
          if (off + 0x80008000 > 0xffffffff || (off & 3) != 0)
-           gold_error(_("%s: linkage table error against `%s'"),
-                      ge->first->object()->name().c_str(),
+           gold_error(_("linkage table error against `%s'"),
                       ge->first->demangled_name().c_str());
 
          write_insn<big_endian>(p, addis_12_12 + ha(off)),     p += 4;
@@ -8973,7 +8986,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
                  size_t reloc_count = shdr.get_sh_size() / reloc_size;
                  if (size == 64
                      && ent->r2save_
-                     && relnum + 1 < reloc_count)
+                     && relnum < reloc_count - 1)
                    {
                      Reltype next_rela(preloc + reloc_size);
                      if (elfcpp::elf_r_type<size>(next_rela.get_r_info())
@@ -9744,7 +9757,7 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
          //            addi 2,2,.TOC.@l
          // if .TOC. is in range.  */
          if (value + address - 4 + 0x80008000 <= 0xffffffff
-             && relnum != 0
+             && relnum + 1 > 1
              && preloc != NULL
              && target->abiversion() >= 2
              && !parameters->options().output_is_position_independent()
This page took 0.106445 seconds and 4 git commands to generate.