[llvm] [ARM] Use .reloc for dso_local weak symbols in PIC mode instead of GOT indirection (PR #209660)

dong jianqiang via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 09:52:45 PDT 2026


dongjianqiang2 wrote:

> **[antmox](/antmox) **

Thanks for flagging this. Found the root cause in the buildbot's stage 2 link log:

`  /usr/bin/ld: ...BTFDebug.cpp.o...: R_ARM_REL32 used with TLS symbol _ZN4llvm3sys7sandbox7EnabledE`

The .reloc branch was missing a !GV->isThreadLocal() check, so it emitted R_ARM_REL32 for llvm::sys::sandbox::Enabled (an inline LLVM_THREAD_LOCAL weak variable). TLS symbols need TLS-specific relocations, not R_ARM_REL32 — the wrong relocation crashed stage 2 in the BPF Assembly Printer. #212545

Fix: add !GV->isThreadLocal(). Opening a PR shortly. 

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


More information about the llvm-commits mailing list