diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-01-10 14:18:11 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-01-10 14:21:21 -0800 |
commit | 52b232b366355b1d0a9d2721e55a6b2b96789b00 (patch) | |
tree | a9075fb3400689a133b6fb9dae2314c9be47c25c /bfd | |
parent | 59a1e29d9e1fc7ed31e66d51899ada46e5dd9a56 (diff) | |
download | gdb-52b232b366355b1d0a9d2721e55a6b2b96789b00.zip gdb-52b232b366355b1d0a9d2721e55a6b2b96789b00.tar.gz gdb-52b232b366355b1d0a9d2721e55a6b2b96789b00.tar.bz2 |
i386/x32: Align .eh_frame section to 4 bytes
.eh_frame section covering PLT sections should be aligned to 4 bytes
for i386 and x32.
bfd/
* elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
to 4 bytes.
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
.eh_frame section to 4 bytes for x32.
(elf_x86_64_check_relocs): Likewise.
ld/
* testsuite/ld-x86-64/pr20830b.d: Updated.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 2 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d6d340c..c45022b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,13 @@ 2017-01-10 H.J. Lu <hongjiu.lu@intel.com> + * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section + to 4 bytes. + * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align + .eh_frame section to 4 bytes for x32. + (elf_x86_64_check_relocs): Likewise. + +2017-01-10 H.J. Lu <hongjiu.lu@intel.com> + PR ld/20830 * elf32-i386.c (elf_i386_eh_frame_plt_got): New. (PLT_GOT_FDE_LENGTH): Likewise. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 982bae6..0860ada 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2395,7 +2395,7 @@ do_size: if (htab->plt_got_eh_frame == NULL || !bfd_set_section_alignment (htab->elf.dynobj, htab->plt_got_eh_frame, - 3)) + 2)) goto error_return; } } diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index b5a949a..1edab04 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1172,7 +1172,8 @@ elf_x86_64_create_dynamic_sections (bfd *dynobj, htab->plt_eh_frame = bfd_make_section_anyway_with_flags (dynobj, ".eh_frame", flags); if (htab->plt_eh_frame == NULL - || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, 3)) + || !bfd_set_section_alignment (dynobj, htab->plt_eh_frame, + ABI_64_P (dynobj) ? 3 : 2)) return FALSE; } @@ -2796,7 +2797,7 @@ do_size: if (htab->plt_got_eh_frame == NULL || !bfd_set_section_alignment (htab->elf.dynobj, htab->plt_got_eh_frame, - 3)) + ABI_64_P (htab->elf.dynobj) ? 3 : 2)) goto error_return; } } |