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; 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