x86-64: Move the error_alignment label forward

Move the error_alignment label forward to avoid clang warning on

if (!bfd_set_section_alignment (ebfd, sec, 2))
  goto error_alignment;

htab = elf_x86_64_hash_table (info);

error_alignment:
  info->callbacks->einfo (_("%F%A: failed to align section\n"), sec);
                             "%F" causes a fatal linker error and
			     immediate exit.

sec = htab->elf.sgotplt;

Also fix alignment on program property note section.

	* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
	the error_alignment label forward.  Properly align program
	property note section.
This commit is contained in:
H.J. Lu 2017-06-22 14:26:09 -07:00
parent 922109c718
commit 5d8763a382
2 changed files with 14 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
the error_alignment label forward. Properly align program
property note section.
2017-06-22 Eric Christopher <echristo@gmail.com>
* elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than

View File

@ -7407,8 +7407,13 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
if (sec == NULL)
info->callbacks->einfo (_("%F: failed to create GNU property section\n"));
if (!bfd_set_section_alignment (ebfd, sec, 2))
goto error_alignment;
if (!bfd_set_section_alignment (ebfd, sec,
ABI_64_P (ebfd) ? 3 : 2))
{
error_alignment:
info->callbacks->einfo (_("%F%A: failed to align section\n"),
sec);
}
elf_section_type (sec) = SHT_NOTE;
}
@ -7567,11 +7572,7 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
properly aligned even if create_dynamic_sections isn't called. */
sec = htab->elf.sgot;
if (!bfd_set_section_alignment (dynobj, sec, 3))
{
error_alignment:
info->callbacks->einfo (_("%F%A: failed to align section\n"),
sec);
}
goto error_alignment;
sec = htab->elf.sgotplt;
if (!bfd_set_section_alignment (dynobj, sec, 3))