diff --git a/lld/ELF/Arch/Hexagon.cpp b/lld/ELF/Arch/Hexagon.cpp --- a/lld/ELF/Arch/Hexagon.cpp +++ b/lld/ELF/Arch/Hexagon.cpp @@ -228,6 +228,8 @@ return 0x00df3fe0; if ((0xff000000 & insn) == 0xb0000000) return 0x0fe03fe0; + if ((0xf0000000 & insn) == 0x40000000) + return 0x000020f8; if (isDuplex(insn)) return 0x03f00000; diff --git a/lld/test/ELF/hexagon-tls-le.s b/lld/test/ELF/hexagon-tls-le.s --- a/lld/test/ELF/hexagon-tls-le.s +++ b/lld/test/ELF/hexagon-tls-le.s @@ -35,6 +35,12 @@ # CHECK: { r4 = #-0x10 } r4 = #a@TPREL +# RELOC-NEXT: 0x20 R_HEX_TPREL_32_6_X a 0x0 +# RELOC-NEXT: 0x24 R_HEX_TPREL_16_X a 0x0 +# CHECK: { immext(#0xffffffc0) +# CHECK-NEXT: if (p0) memw(r0+##0xfffffff0) = r1 + if (p0) memw(r0+##a@TPREL)=r1 + .section .tdata,"awT",@progbits .globl a .p2align 2