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