]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Pass "%F%P:" to linker callback in case of error
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 17 Nov 2017 12:09:12 +0000 (04:09 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 17 Nov 2017 12:09:12 +0000 (04:09 -0800)
We should pass "%F%P:" to  linker callback in case of error.  Otherwise,
linker will report:

: failed to create GNU property section

* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
"%F%P:", instead of "%F:", to linker callback in case of error.

bfd/ChangeLog
bfd/elfxx-x86.c

index 8ac776505f670596b6ea734c0d982336569f4531..d2ad3d3f39efdafa5675e25e2ac8e1666680c7b6 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
+       "%F%P:", instead of "%F:", to linker callback in case of error.
+
 2017-11-16  Nick Clifton  <nickc@redhat.com>
 
        PR 22421
index df21d4eb865e056ae6a4500124e080d392c72495..e58e3d0ebb4278860cd0855dce5dfe54cc6fa3e2 100644 (file)
@@ -2401,7 +2401,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                              | SEC_HAS_CONTENTS
                                              | SEC_DATA));
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create GNU property section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
 
          if (!bfd_set_section_alignment (ebfd, sec, class_align))
            {
@@ -2556,7 +2556,7 @@ error_alignment:
       && !elf_vxworks_create_dynamic_sections (dynobj, info,
                                               &htab->srelplt2))
     {
-      info->callbacks->einfo (_("%F: failed to create VxWorks dynamic sections\n"));
+      info->callbacks->einfo (_("%F%P: failed to create VxWorks dynamic sections\n"));
       return pbfd;
     }
 
@@ -2565,7 +2565,7 @@ error_alignment:
      don't need to do it in check_relocs.  */
   if (htab->elf.sgot == NULL
       && !_bfd_elf_create_got_section (dynobj, info))
-    info->callbacks->einfo (_("%F: failed to create GOT sections\n"));
+    info->callbacks->einfo (_("%F%P: failed to create GOT sections\n"));
 
   got_align = (bed->target_id == X86_64_ELF_DATA) ? 3 : 2;
 
@@ -2583,7 +2583,7 @@ error_alignment:
   /* Create the ifunc sections here so that check_relocs can be
      simplified.  */
   if (!_bfd_elf_create_ifunc_sections (dynobj, info))
-    info->callbacks->einfo (_("%F: failed to create ifunc sections\n"));
+    info->callbacks->einfo (_("%F%P: failed to create ifunc sections\n"));
 
   plt_alignment = bfd_log2 (htab->plt.plt_entry_size);
 
@@ -2624,7 +2624,7 @@ error_alignment:
                                                    ".plt.got",
                                                    pltflags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create GOT PLT section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
 
          if (!bfd_set_section_alignment (dynobj, sec,
                                          non_lazy_plt_alignment))
@@ -2645,7 +2645,7 @@ error_alignment:
                                                            ".plt.sec",
                                                            pltflags);
                  if (sec == NULL)
-                   info->callbacks->einfo (_("%F: failed to create IBT-enabled PLT section\n"));
+                   info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
 
                  if (!bfd_set_section_alignment (dynobj, sec,
                                                  plt_alignment))
@@ -2660,7 +2660,7 @@ error_alignment:
                                                            ".plt.sec",
                                                            pltflags);
                  if (sec == NULL)
-                   info->callbacks->einfo (_("%F: failed to create BND PLT section\n"));
+                   info->callbacks->einfo (_("%F%P: failed to create BND PLT section\n"));
 
                  if (!bfd_set_section_alignment (dynobj, sec,
                                                  non_lazy_plt_alignment))
@@ -2681,7 +2681,7 @@ error_alignment:
                                                    ".eh_frame",
                                                    flags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create PLT .eh_frame section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
 
          if (!bfd_set_section_alignment (dynobj, sec, class_align))
            goto error_alignment;
@@ -2694,7 +2694,7 @@ error_alignment:
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F: failed to create GOT PLT .eh_frame section\n"));
+               info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (dynobj, sec, class_align))
                goto error_alignment;
@@ -2708,7 +2708,7 @@ error_alignment:
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F: failed to create the second PLT .eh_frame section\n"));
+               info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (dynobj, sec, class_align))
                goto error_alignment;