[PATCH] D16166: [ELF/AArch64] Support R_AARCH64_LDST128_ABS_LO12_NC relocation
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 17:18:52 PST 2016
davide created this revision.
davide added reviewers: ruiu, rafael, grimar.
davide added a subscriber: llvm-commits.
Herald added subscribers: emaste, rengolin, aemerson.
This is needed to self-host lld on FreeBSD. I've been sitting with this (and other relocation patches) in my local tree for a while.
http://reviews.llvm.org/D16166
Files:
ELF/Target.cpp
test/ELF/aarch64-relocs.s
Index: test/ELF/aarch64-relocs.s
===================================================================
--- test/ELF/aarch64-relocs.s
+++ test/ELF/aarch64-relocs.s
@@ -120,3 +120,19 @@
# CHECK: Disassembly of section .R_AARCH64_LDST8_ABS_LO12_NC:
# CHECK-NEXT: ldst8:
# CHECK-NEXT: 11044: ab 21 81 39 ldrsb x11, [x13, #72]
+
+.section .R_AARCH64_LDST128_ABS_LO12_NC,"ax", at progbits
+ldst128:
+ ldr q20, [x19, #:lo12:foo128]
+foo128:
+ .asciz "foo"
+ .size mystr, 3
+
+# S = 0x1104c, A = 0x4
+# R = ((S + A) & 0xFF8) << 6 = 0x00001400
+# 0x00001400 | 0x3dc00274 = 0x3dc01674
+# CHECK: Disassembly of section .R_AARCH64_LDST128_ABS_LO12_NC:
+# CHECK: ldst128:
+# CHECK: 1104c: 74 16 c0 3d ldr q20, [x19, #80]
+#foo128:
+# 11050: 66 6f 6f 00 .word
Index: ELF/Target.cpp
===================================================================
--- ELF/Target.cpp
+++ ELF/Target.cpp
@@ -1269,6 +1269,7 @@
case R_AARCH64_LDST8_ABS_LO12_NC:
case R_AARCH64_LDST32_ABS_LO12_NC:
case R_AARCH64_LDST64_ABS_LO12_NC:
+ case R_AARCH64_LDST128_ABS_LO12_NC:
if (auto *SS = dyn_cast<SharedSymbol<ELF64LE>>(&S))
return SS->Sym.getType() == STT_OBJECT;
return false;
@@ -1376,6 +1377,9 @@
checkAlignment<8>(SA, Type);
or32le(Loc, (SA & 0xFF8) << 7);
break;
+ case R_AARCH64_LDST128_ABS_LO12_NC:
+ or32le(Loc, (SA & 0x0FF8) << 6);
+ break;
case R_AARCH64_LDST8_ABS_LO12_NC:
or32le(Loc, (SA & 0xFFF) << 10);
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16166.44817.patch
Type: text/x-patch
Size: 1493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160114/45b08316/attachment.bin>
More information about the llvm-commits
mailing list