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/elf64-x86-64.c | |
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/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |