[PATCH] D49849: Add R_HEX_12_X and R_HEX_32_6_X

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 26 05:47:17 PDT 2018


sidneym created this revision.
sidneym added reviewers: ruiu, kparzysz, bcain, shankare.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.

Adds 12_X and associated extender 32_6_X.   Updates testcase.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49849

Files:
  ELF/Arch/Hexagon.cpp
  test/ELF/hexagon.s


Index: test/ELF/hexagon.s
===================================================================
--- test/ELF/hexagon.s
+++ 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
Index: ELF/Arch/Hexagon.cpp
===================================================================
--- ELF/Arch/Hexagon.cpp
+++ ELF/Arch/Hexagon.cpp
@@ -70,6 +70,12 @@
   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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49849.157469.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180726/50615bb0/attachment.bin>


More information about the llvm-commits mailing list