[lld][Hexagon] Support predicated-add GOT_16_X mask lookup (#111896)
authorBrian Cain <bcain@quicinc.com>
Fri, 11 Oct 2024 19:31:41 +0000 (14:31 -0500)
committerTobias Hieta <tobias@hieta.se>
Tue, 15 Oct 2024 06:56:21 +0000 (08:56 +0200)
commitf8cf339563e2f38487de15ce11eddc4ea6c883af
treeff89831c176bb0a912f6e86877c9a99f0f38ba2c
parent35bd5ff4ca7095baeb1f157491e81e3277a0ae34
[lld][Hexagon] Support predicated-add GOT_16_X mask lookup (#111896)

When encountering an instruction like `if (p0) r0 = add(r0,##bar@GOT)`,
lld would fail with:
```
ld.lld: error: unrecognized instruction for 16_X type: 0x7400C000
```

This issue was encountered while building libreadline with clang 19.1.0.

Fixes: #111876
(cherry picked from commit 77aa8257acbd773c0c430cd962da1bcfbd5ee94b)
lld/ELF/Arch/Hexagon.cpp
lld/test/ELF/hexagon-shared.s