[PATCH] D50520: Add support for Hexagon's R_HEX_HI16/R_HEX_LO16 relocations.
Sid Manning via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 10:20:19 PDT 2018
sidneym created this revision.
sidneym added reviewers: ruiu, kparzysz, bcain, shankare.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.
Add HI/LO relocations and testcase.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D50520
Files:
ELF/Arch/Hexagon.cpp
test/ELF/hexagon.s
Index: test/ELF/hexagon.s
===================================================================
--- test/ELF/hexagon.s
+++ test/ELF/hexagon.s
@@ -151,3 +151,11 @@
# R_HEX_6_X
{ r0 = ##_start; r2 = r16 }
# CHECK: 28003082 r0 = ##69632; r2 = r16 }
+
+# R_HEX_HI16
+r0.h = #HI(_start)
+# CHECK: r0.h = #1
+
+# R_HEX_LO16
+r0.l = #LO(_start)
+# CHECK: r0.l = #4096
Index: ELF/Arch/Hexagon.cpp
===================================================================
--- ELF/Arch/Hexagon.cpp
+++ ELF/Arch/Hexagon.cpp
@@ -135,6 +135,12 @@
case R_HEX_B32_PCREL_X:
or32le(Loc, applyMask(0x0fff3fff, Val >> 6));
break;
+ case R_HEX_HI16:
+ or32le(Loc, applyMask(0x00c03fff, Val >> 16));
+ break;
+ case R_HEX_LO16:
+ or32le(Loc, applyMask(0x00c03fff, Val));
+ break;
default:
error(getErrorLocation(Loc) + "unrecognized reloc " + toString(Type));
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50520.159949.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180809/3540045b/attachment-0001.bin>
More information about the llvm-commits
mailing list