summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorSid Manning <sidneym@codeaurora.org>2018-07-29 11:59:38 +0000
committerSid Manning <sidneym@codeaurora.org>2018-07-29 11:59:38 +0000
commitbff671945044fd90c91bfddf65fd3f7e020c681f (patch)
tree3d67044764f7ab115202a26737b5b69efb3326ed /lld
parent6bc5d5c6db58519db796f328ada39ce815571759 (diff)
downloadbcm5719-llvm-bff671945044fd90c91bfddf65fd3f7e020c681f.tar.gz
bcm5719-llvm-bff671945044fd90c91bfddf65fd3f7e020c681f.zip
[ELF][HEXAGON] Add R_HEX_32_6_X and R_HEX_12_X
And add a test. llvm-svn: 338213
Diffstat (limited to 'lld')
-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