[lld] r313850 - [AArch64] Properly check alignment for AARCH64_LD_PREL_LO19.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 20 17:26:28 PDT 2017
Author: davide
Date: Wed Sep 20 17:26:28 2017
New Revision: 313850
URL: http://llvm.org/viewvc/llvm-project?rev=313850&view=rev
Log:
[AArch64] Properly check alignment for AARCH64_LD_PREL_LO19.
Follow-up suggested by Peter Smith.
Added:
lld/trunk/test/ELF/aarch64-load-alignment.s
Modified:
lld/trunk/ELF/Arch/AArch64.cpp
Modified: lld/trunk/ELF/Arch/AArch64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/AArch64.cpp?rev=313850&r1=313849&r2=313850&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/AArch64.cpp (original)
+++ lld/trunk/ELF/Arch/AArch64.cpp Wed Sep 20 17:26:28 2017
@@ -249,6 +249,7 @@ void AArch64::relocateOne(uint8_t *Loc,
break;
case R_AARCH64_CONDBR19:
case R_AARCH64_LD_PREL_LO19:
+ checkAlignment<4>(Loc, Val, Type);
checkInt<21>(Loc, Val, Type);
or32le(Loc, (Val & 0x1FFFFC) << 3);
break;
Added: lld/trunk/test/ELF/aarch64-load-alignment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/aarch64-load-alignment.s?rev=313850&view=auto
==============================================================================
--- lld/trunk/test/ELF/aarch64-load-alignment.s (added)
+++ lld/trunk/test/ELF/aarch64-load-alignment.s Wed Sep 20 17:26:28 2017
@@ -0,0 +1,11 @@
+# REQUIRES: aarch64
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-none %s -o %t.o
+# RUN: not ld.lld -shared %t.o -o %t 2>&1 | FileCheck %s
+
+# CHECK: improper alignment for relocation R_AARCH64_LD_PREL_LO19
+
+ ldr x8, patatino
+ .data
+ .zero 5
+patatino:
More information about the llvm-commits
mailing list