[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22903] [AArch64] Insufficient veneer stub alignment
From: |
wilson at gcc dot gnu.org |
Subject: |
[Bug ld/22903] [AArch64] Insufficient veneer stub alignment |
Date: |
Thu, 01 Mar 2018 23:20:05 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22903
--- Comment #7 from Jim Wilson <wilson at gcc dot gnu.org> ---
I don't particularly care how this gets fixed.
Your patch seems to have a flaw. You are skipping over the first 4 bytes of
the stub if it isn't aligned, but you aren't increasing the size of the stub to
allow for alignment padding, which means you end up writing past the allocated
area. You can see the problem with the testcase the original poster put in
this PR. The first stub has its last word overwritten by the nop emitted for
the second stub, and the second stub has its last word chopped off.
My patch seems a little cleaner, as it just adds a nop to ensure that the first
stub is aligned. The only problem I know of with my patch is that we can get
zero bytes added at the end of the text section sometimes, which prevents the
branch Marcus added at the start of the stub section from working as intended.
That can be seen in the testcase in this bug report, where 0x100c is a 0. I
tried your suggestion of setting NOP in ld/emulparams/aarch64elf.sh, that does
work, except I needed to add
NOP=0x1f2003d5
and I needed to add it to the aarch64linux.sh file. Probably every
*aarch64*.sh file needs to be fixed.
My patch unfortunately does not apply as is, as some of the linker testcase *.d
files have been modified since I originally wrote my patch. It doesn't look
too hard to fix though.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, nickc at redhat dot com, 2018/03/01
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, pexu at sourceware dot mail.kapsi.fi, 2018/03/01
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, pexu at sourceware dot mail.kapsi.fi, 2018/03/01
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, pexu at sourceware dot mail.kapsi.fi, 2018/03/01
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment,
wilson at gcc dot gnu.org <=
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, cvs-commit at gcc dot gnu.org, 2018/03/02
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, nickc at redhat dot com, 2018/03/02
- [Bug ld/22903] [AArch64] Insufficient veneer stub alignment, jeremip11 at gmail dot com, 2018/03/31