x86: Pass "%F%P:" to linker callback in case of error

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.
This commit is contained in:
H.J. Lu 2017-11-17 04:09:12 -08:00
parent 6a6196fc71
commit 2c244f9b09
2 changed files with 15 additions and 10 deletions

View 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

View 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;