summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Arch/Hexagon.cpp6
-rw-r--r--lld/test/ELF/hexagon.s7
2 files changed, 13 insertions, 0 deletions
diff --git a/lld/ELF/Arch/Hexagon.cpp b/lld/ELF/Arch/Hexagon.cpp
index 2d5c23fd5ad..ff5e862bafa 100644
--- a/lld/ELF/Arch/Hexagon.cpp
+++ b/lld/ELF/Arch/Hexagon.cpp
@@ -70,6 +70,12 @@ void Hexagon::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const {
switch (Type) {
case R_HEX_NONE:
break;
+ case R_HEX_12_X:
+ or32le(Loc, applyMask(0x000007e0, Val));
+ break;
+ case R_HEX_32_6_X:
+ or32le(Loc, applyMask(0x0fff3fff, Val >> 6));
+ break;
case R_HEX_B15_PCREL:
or32le(Loc, applyMask(0x00df20fe, Val >> 2));
break;
diff --git a/lld/test/ELF/hexagon.s b/lld/test/ELF/hexagon.s
index 8c824ea3c78..1b3273374c6 100644
--- a/lld/test/ELF/hexagon.s
+++ b/lld/test/ELF/hexagon.s
@@ -4,6 +4,13 @@
# RUN: ld.lld %t2 %t -o %t3
# RUN: llvm-objdump -d %t3 | FileCheck %s
+# Note: 69632 == 0x11000
+# R_HEX_32_6_X
+# R_HEX_12_X
+if (p0) r0 = ##_start
+# CHECK: immext(#69632)
+# CHECK: if (p0) r0 = ##69632
+
# R_HEX_B15_PCREL
if (p0) jump:nt #_start
# CHECK: if (p0) jump:nt 0x11000
OpenPOWER on IntegriCloud