[lld] r343515 - [ELF] [HEXAGON] Add support for PLT_B22_PCREL and HEX_32_PCREL
Sid Manning via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 1 11:27:27 PDT 2018
Author: sidneym
Date: Mon Oct 1 11:27:26 2018
New Revision: 343515
URL: http://llvm.org/viewvc/llvm-project?rev=343515&view=rev
Log:
[ELF] [HEXAGON] Add support for PLT_B22_PCREL and HEX_32_PCREL
Update testcase.
Differential Revision: https://reviews.llvm.org/D52734
Modified:
lld/trunk/ELF/Arch/Hexagon.cpp
lld/trunk/test/ELF/hexagon-shared.s
Modified: lld/trunk/ELF/Arch/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/Hexagon.cpp?rev=343515&r1=343514&r2=343515&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/Hexagon.cpp (original)
+++ lld/trunk/ELF/Arch/Hexagon.cpp Mon Oct 1 11:27:26 2018
@@ -75,8 +75,10 @@ RelExpr Hexagon::getRelExpr(RelType Type
case R_HEX_B15_PCREL:
case R_HEX_B15_PCREL_X:
case R_HEX_6_PCREL_X:
+ case R_HEX_32_PCREL:
return R_PC;
case R_HEX_B22_PCREL:
+ case R_HEX_PLT_B22_PCREL:
case R_HEX_B22_PCREL_X:
case R_HEX_B32_PCREL_X:
return R_PLT_PC;
@@ -182,6 +184,7 @@ void Hexagon::relocateOne(uint8_t *Loc,
or32le(Loc, applyMask(findMaskR16(read32le(Loc)), Val & 0x3f));
break;
case R_HEX_32:
+ case R_HEX_32_PCREL:
or32le(Loc, Val);
break;
case R_HEX_32_6_X:
@@ -203,6 +206,7 @@ void Hexagon::relocateOne(uint8_t *Loc,
or32le(Loc, applyMask(0x00df20fe, Val & 0x3f));
break;
case R_HEX_B22_PCREL:
+ case R_HEX_PLT_B22_PCREL:
or32le(Loc, applyMask(0x1ff3ffe, Val >> 2));
break;
case R_HEX_B22_PCREL_X:
Modified: lld/trunk/test/ELF/hexagon-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/hexagon-shared.s?rev=343515&r1=343514&r2=343515&view=diff
==============================================================================
--- lld/trunk/test/ELF/hexagon-shared.s (original)
+++ lld/trunk/test/ELF/hexagon-shared.s Mon Oct 1 11:27:26 2018
@@ -3,21 +3,29 @@
# RUN: llvm-mc -filetype=obj -triple=hexagon-unknown-elf %S/Inputs/hexagon-shared.s -o %t2.o
# RUN: ld.lld -shared %t2.o -soname %t3.so -o %t3.so
# RUN: ld.lld -shared %t %t3.so -soname %t4.so -o %t4.so
-# RUN: llvm-objdump -d -j .plt %t4.so | FileCheck %s
+# RUN: llvm-objdump -d -j=.plt %t4.so | FileCheck --check-prefix=PLT %s
+# RUN: llvm-objdump -d -j=.text %t4.so | FileCheck --check-prefix=TEXT %s
.global foo
foo:
+# _HEX_32_PCREL
+.word _DYNAMIC - .
call ##bar
+# R_HEX_PLT_B22_PCREL
+call bar at PLT
-# CHECK: { immext(#65472
-# CHECK: r28 = add(pc,##65520) }
-# CHECK: { r14 -= add(r28,#16)
-# CHECK: r15 = memw(r28+#8)
-# CHECK: r28 = memw(r28+#4) }
-# CHECK: { r14 = asr(r14,#2)
-# CHECK: jumpr r28 }
-# CHECK: { trap0(#219) }
-# CHECK: immext(#65472)
-# CHECK: r14 = add(pc,##65488) }
-# CHECK: r28 = memw(r14+#0) }
-# CHECK: jumpr r28 }
+# PLT: { immext(#65472
+# PLT: r28 = add(pc,##65520) }
+# PLT: { r14 -= add(r28,#16)
+# PLT: r15 = memw(r28+#8)
+# PLT: r28 = memw(r28+#4) }
+# PLT: { r14 = asr(r14,#2)
+# PLT: jumpr r28 }
+# PLT: { trap0(#219) }
+# PLT: immext(#65472)
+# PLT: r14 = add(pc,##65488) }
+# PLT: r28 = memw(r14+#0) }
+# PLT: jumpr r28 }
+
+# TEXT: 10000: 00 00 01 00 00010000
+# TEXT: { call 0x10030 }
More information about the llvm-commits
mailing list