[PATCH] D49394: Add R_HEX_B15_PCREL relocation

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 13:32:51 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD337494: [ELF][HEXAGON] Add support for R_HEX_B15_PCREL (authored by sidneym, committed by ).

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49394

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,10 @@
 # RUN: ld.lld %t2 %t  -o %t3
 # RUN: llvm-objdump -d  %t3 | FileCheck %s
 
+# R_HEX_B15_PCREL
+if (p0) jump:nt #_start
+# CHECK: if (p0) jump:nt 0x11000
+
 # R_HEX_B22_PCREL
 call #_start
 # CHECK: call 0x11000
Index: ELF/Arch/Hexagon.cpp
===================================================================
--- ELF/Arch/Hexagon.cpp
+++ ELF/Arch/Hexagon.cpp
@@ -53,6 +53,7 @@
 RelExpr Hexagon::getRelExpr(RelType Type, const Symbol &S,
                             const uint8_t *Loc) const {
   switch (Type) {
+  case R_HEX_B15_PCREL:
   case R_HEX_B22_PCREL:
   case R_HEX_B22_PCREL_X:
   case R_HEX_B32_PCREL_X:
@@ -68,6 +69,9 @@
   switch (Type) {
   case R_HEX_NONE:
     break;
+  case R_HEX_B15_PCREL:
+    or32le(Loc, applyMask(0x00df20fe, Val >> 2));
+    break;
   case R_HEX_B22_PCREL:
     or32le(Loc, applyMask(0x1ff3ffe, Val >> 2));
     break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49394.156348.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180719/7ab4f95e/attachment.bin>


More information about the llvm-commits mailing list