[llvm] [BOLT][AArch64] Preserve external branches to non-function symbols (PR #227275)
Adam Bzowski via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 05:50:33 PDT 2026
adam-bzowski-arm wrote:
I think this is a good idea but it is incomplete yet. I currently get a crash (full log attached, [brbe.google.br.log](https://github.com/user-attachments/files/32803974/brbe.google.br.log)):
```text
llvm-bolt: LongJmp.cpp:1704: ClusteredRelaxation::relaxUnconditionalBranches():
Assertion `Target && "expected branch thunk chain"' failed.
```
One problem exposed by this change is that genuine compiler-generated tail calls are sometimes classified as external branches. For example, the destination has a local `STT_FUNC` symbol, but the retained relocation references the `STT_SECTION` `.text` symbol plus an addend. The linker likely canonicalized the relocation this way because the function symbol is local. Consequently, inspecting only the relocation symbol type does not recognize this as a function entry.
With my full-layout prototype, https://github.com/llvm/llvm-project/pull/225728, this case terminates with a diagnostic rather than an assertion failure. I will investigate further.
https://github.com/llvm/llvm-project/pull/227275
More information about the llvm-commits
mailing list