[lld] r337829 - [ELF][HEXAGON] Add R_HEX_B15_PCREL_X relocation
Sid Manning via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 24 08:08:13 PDT 2018
Author: sidneym
Date: Tue Jul 24 08:08:13 2018
New Revision: 337829
URL: http://llvm.org/viewvc/llvm-project?rev=337829&view=rev
Log:
[ELF][HEXAGON] Add R_HEX_B15_PCREL_X relocation
Update testcase
Differential Revision: https://reviews.llvm.org/D49567
Modified:
lld/trunk/ELF/Arch/Hexagon.cpp
lld/trunk/test/ELF/hexagon.s
Modified: lld/trunk/ELF/Arch/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/Hexagon.cpp?rev=337829&r1=337828&r2=337829&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/Hexagon.cpp (original)
+++ lld/trunk/ELF/Arch/Hexagon.cpp Tue Jul 24 08:08:13 2018
@@ -54,6 +54,7 @@ RelExpr Hexagon::getRelExpr(RelType Type
const uint8_t *Loc) const {
switch (Type) {
case R_HEX_B15_PCREL:
+ case R_HEX_B15_PCREL_X:
case R_HEX_B22_PCREL:
case R_HEX_B22_PCREL_X:
case R_HEX_B32_PCREL_X:
@@ -72,6 +73,9 @@ void Hexagon::relocateOne(uint8_t *Loc,
case R_HEX_B15_PCREL:
or32le(Loc, applyMask(0x00df20fe, Val >> 2));
break;
+ case R_HEX_B15_PCREL_X:
+ or32le(Loc, applyMask(0x00df20fe, Val & 0x3f));
+ break;
case R_HEX_B22_PCREL:
or32le(Loc, applyMask(0x1ff3ffe, Val >> 2));
break;
Modified: lld/trunk/test/ELF/hexagon.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/hexagon.s?rev=337829&r1=337828&r2=337829&view=diff
==============================================================================
--- lld/trunk/test/ELF/hexagon.s (original)
+++ lld/trunk/test/ELF/hexagon.s Tue Jul 24 08:08:13 2018
@@ -8,6 +8,11 @@
if (p0) jump:nt #_start
# CHECK: if (p0) jump:nt 0x11000
+# R_HEX_B32_PCREL_X
+# R_HEX_B15_PCREL_X
+if (p0) jump:nt ##_start
+# CHECK: if (p0) jump:nt 0x11000
+
# R_HEX_B22_PCREL
call #_start
# CHECK: call 0x11000
More information about the llvm-commits
mailing list