Align x86-64 .got/.got.plt sections to 8 bytes

Align x86-64 .got and .got.plt sections to their entry size.

	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
	.got/.got.plt sections to 8 bytes.
This commit is contained in:
H.J. Lu 2016-07-12 15:33:47 -07:00
parent e0f3fd7c44
commit 37567a2cdd
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-07-12 H.J. Lu <hongjiu.lu@intel.com>
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
.got/.got.plt sections to 8 bytes.
2016-07-12 Nick Clifton <nickc@redhat.com>
* binary.c (binary_set_section_contents): Second grammar fix.

View File

@ -1162,6 +1162,17 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj,
|| !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3))
return FALSE;
}
/* Align .got section to its entry size. */
if (htab->elf.sgot != NULL
&& !bfd_set_section_alignment (dynobj, htab->elf.sgot, 3))
return FALSE;
/* Align .got.plt section to its entry size. */
if (htab->elf.sgotplt != NULL
&& !bfd_set_section_alignment (dynobj, htab->elf.sgotplt, 3))
return FALSE;
return TRUE;
}