[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 13:05:33 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD339371: [ELF][HEXAGON] Add R_HEX_HI16/R_HEX_LO16 relocations (authored by sidneym, committed by ).

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.159982.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180809/9766f017/attachment.bin>


More information about the llvm-commits mailing list