PowerPC64 call lacks nop error
authorAlan Modra <amodra@gmail.com>
Fri, 29 Aug 2014 01:22:50 +0000 (10:52 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 29 Aug 2014 01:22:50 +0000 (10:52 +0930)
* elf64-ppc.c (ppc64_elf_relocate_section): Report a different
error for calls via a toc adjusting stub without a nop.

bfd/ChangeLog
bfd/elf64-ppc.c

index 3c914be279c9ae2683b09488b9af1f182421c81d..fae94fd00a516584659f42e960be7bff3b44c325 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-29  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (ppc64_elf_relocate_section): Report a different
+       error for calls via a toc adjusting stub without a nop.
+
 2014-08-29  Alan Modra  <amodra@gmail.com>
 
        * vms-alpha.c (alpha_vma_object_p): Don't return file_truncated
index 2b9b07ecf6df5b2d3126ed7fc7224c4fa6503b6e..123a33a0dae1498502a6e3d34ae0095f27076f6c 100644 (file)
@@ -13761,10 +13761,17 @@ ppc64_elf_relocate_section (bfd *output_bfd,
 
              if (!can_plt_call)
                {
-                 info->callbacks->einfo
-                   (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
-                      "recompile with -fPIC\n"),
-                    input_bfd, input_section, rel->r_offset, sym_name);
+                 if (stub_entry->stub_type == ppc_stub_plt_call
+                     || stub_entry->stub_type == ppc_stub_plt_call_r2save)
+                   info->callbacks->einfo
+                     (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+                        "recompile with -fPIC\n"),
+                      input_bfd, input_section, rel->r_offset, sym_name);
+                 else
+                   info->callbacks->einfo
+                     (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+                        "(-mcmodel=small toc adjust stub)\n"),
+                      input_bfd, input_section, rel->r_offset, sym_name);
 
                  bfd_set_error (bfd_error_bad_value);
                  ret = FALSE;