[lld] r339371 - [ELF][HEXAGON] Add R_HEX_HI16/R_HEX_LO16 relocations
Sid Manning via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 13:04:54 PDT 2018
Author: sidneym
Date: Thu Aug 9 13:04:53 2018
New Revision: 339371
URL: http://llvm.org/viewvc/llvm-project?rev=339371&view=rev
Log:
[ELF][HEXAGON] Add R_HEX_HI16/R_HEX_LO16 relocations
Differential Revision: https://reviews.llvm.org/D50520
Modified:
lld/trunk/ELF/Arch/Hexagon.cpp
lld/trunk/test/ELF/hexagon.s
Modified: lld/trunk/ELF/Arch/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/Hexagon.cpp?rev=339371&r1=339370&r2=339371&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/Hexagon.cpp (original)
+++ lld/trunk/ELF/Arch/Hexagon.cpp Thu Aug 9 13:04:53 2018
@@ -135,6 +135,12 @@ void Hexagon::relocateOne(uint8_t *Loc,
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;
Modified: lld/trunk/test/ELF/hexagon.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/hexagon.s?rev=339371&r1=339370&r2=339371&view=diff
==============================================================================
--- lld/trunk/test/ELF/hexagon.s (original)
+++ lld/trunk/test/ELF/hexagon.s Thu Aug 9 13:04:53 2018
@@ -151,3 +151,11 @@ r0=add(r1,mpyi(r2,##_start))
# 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
More information about the llvm-commits
mailing list