[llvm] [bolt] AArch64: Fix TLSDESC to LE relaxation by mold (PR #190370)

Pavel Iliin via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 04:42:36 PDT 2026


ilinpv wrote:

@awshkulkar thanks for catching this, debugging, and putting together the fix, nice catch!
This looks like the correct fix to me. After TLSDESC to LE relaxation, the remaining TLSDESC relocations may no longer  correspond to the final instructions, so treating them in this case as regular fixups can produce invalid associations, so it is reasonable to ignore these relocations at this point. 
Moreover, in this case we do not actually need these relocations, as the targets can be recovered by recognizing the relaxed veneer patterns (e.g. MOVZ/MOVK) as described in the AArch64 veneer types specification: https://github.com/ARM-software/abi-aa/blob/main/baabielf64/baabielf64.rst
It also appears that the mold-specific relaxation pattern was not previously covered, so adding broader mold-based test coverage for adjustRelocation() would help catch similar corner cases going forward.
I would defer the final decision to the BOLT maintainers for their review and perspective.

https://github.com/llvm/llvm-project/pull/190370


More information about the llvm-commits mailing list