aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-03-02 10:47:25 +0000
committerNick Clifton <nickc@redhat.com>2018-03-02 10:49:20 +0000
commit9a2ebffd4dd9cffac395177e997f6f47408b4782 (patch)
treeb877a3c6e100f7c457d4215c69bf0aa93666b0cf /ld/emultempl
parente7da50fa4b4f770240feda51ba60f6255073e54f (diff)
downloadgdb-9a2ebffd4dd9cffac395177e997f6f47408b4782.zip
gdb-9a2ebffd4dd9cffac395177e997f6f47408b4782.tar.gz
gdb-9a2ebffd4dd9cffac395177e997f6f47408b4782.tar.bz2
Ensure 8-byte alignment for AArch64 stubs.
PR 22903 bfd * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch and nop instead of 4. (elfNN_arch64_build_stubs): Add nop after branch. Increase size by 8 instead of 4. ld * emultempl/aarch64elf.em (elf${ELFSIZE}_aarch64_add_stub_section): Give stub_sec 8 byte alignment. * emulparams/aarch64cloudabi.sh (NOP): Set to 0x1f2003d5. * emulparams/aarch64elf.sh (NOP): Likewise. * emulparams/aarch64elf32.sh (NOP): Likewise. * emulparams/aarch64fbsd.sh (NOP): Likewise. * emulparams/aarch64linux.sh (NOP): Likewise. * emulparams/aarch64linux32.sh (NOP): Likewise. * testsuite/ld-aarch64/erratum835769.d: Adjust for added nop. * testsuite/ld-aarch64/erratum843419.d: Likewise. * testsuite/ld-aarch64/farcall-b-defsym.d: Likewise. * testsuite/ld-aarch64/farcall-b-none-function.d: Likewise. * testsuite/ld-aarch64/farcall-b-plt.d: Likewise. * testsuite/ld-aarch64/farcall-b-section.d: Likewise. * testsuite/ld-aarch64/farcall-b.d: Likewise. * testsuite/ld-aarch64/farcall-back.d: Likewise. * testsuite/ld-aarch64/farcall-bl-defsym.d: Likewise. * testsuite/ld-aarch64/farcall-bl-none-function.d: Likewise. * testsuite/ld-aarch64/farcall-bl-plt.d: Likewise. * testsuite/ld-aarch64/farcall-bl-section.d: Likewise. * testsuite/ld-aarch64/farcall-bl.d: Likewise.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/aarch64elf.em4
1 files changed, 3 insertions, 1 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index 34d03f3..fe0255c 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -174,7 +174,9 @@ elf${ELFSIZE}_aarch64_add_stub_section (const char *stub_sec_name,
if (stub_sec == NULL)
goto err_ret;
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 2);
+ /* Long branch stubs contain a 64-bit address, so the section requires
+ 8 byte alignment. */
+ bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
output_section = input_section->output_section;
os = lang_output_section_get (output_section);