[PATCH] D51225: Add R_HEX_11 support
Sid Manning via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 24 10:29:57 PDT 2018
sidneym created this revision.
sidneym added reviewers: ruiu, kparzysz, shankare, bcain.
sidneym added a project: lld.
Herald added subscribers: MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Since this is always extended it has just 6 effective bits.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D51225
Files:
ELF/Arch/Hexagon.cpp
test/ELF/hexagon.s
Index: test/ELF/hexagon.s
===================================================================
--- test/ELF/hexagon.s
+++ test/ELF/hexagon.s
@@ -194,3 +194,10 @@
# 0xb0000000
r0 = add(r1, ##_start)
# CHECK: b001c000 r0 = add(r1,##69632) }
+
+# R_HEX_11_X
+r0 = memw(r1+##_start)
+# CHECK: r0 = memw(r1+##69632)
+
+memw(r0+##_start) = r1
+# CHECK: memw(r0+##69632) = r1
Index: ELF/Arch/Hexagon.cpp
===================================================================
--- ELF/Arch/Hexagon.cpp
+++ ELF/Arch/Hexagon.cpp
@@ -112,6 +112,12 @@
return 0x00001fe0;
}
+static uint32_t findMaskR11(uint32_t Insn) {
+ if ((0xff000000 & Insn) == 0xa1000000)
+ return 0x060020ff;
+ return 0x06003fe0;
+}
+
static uint32_t findMaskR16(uint32_t Insn) {
if ((0xff000000 & Insn) == 0x48000000)
return 0x061f20ff;
@@ -140,6 +146,9 @@
case R_HEX_8_X:
or32le(Loc, applyMask(findMaskR8(read32le(Loc)), Val));
break;
+ case R_HEX_11_X:
+ or32le(Loc, applyMask(findMaskR11(read32le(Loc)), Val & 0x3f));
+ break;
case R_HEX_12_X:
or32le(Loc, applyMask(0x000007e0, Val));
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51225.162413.patch
Type: text/x-patch
Size: 1109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180824/3549d833/attachment.bin>
More information about the llvm-commits
mailing list