Issue |
143709
|
Summary |
[BOLT][AArch64] Unknown relocation type error (R_AARCH64_P32_ABS16?) during emitAndLink with jump-table-info.s
|
Labels |
BOLT
|
Assignees |
|
Reporter |
whubeibei
|

Hi,
While testing [PR #132114](https://github.com/llvm/llvm-project/pull/132114) (JumpTableReader support) on AArch64, I encountered a linker error related to unknown relocation types during the emitAndLink phase.
🔍 Issue
The error occurs when processing a jump table in .rodata. The relocation type reported is 2, which seems to correspond to R_AARCH64_P32_ABS16.
This happens specifically when using the bolt/test/AArch64/jump-table-info.s example included in the PR.

💻 Reproduction Steps
llvm-mc -filetype=obj -triple aarch64-unknown-unknown jump-table-info.s -o jt.o
clang jt.o jt_main.o -o jt.exe -static
clang --target=aarch64-linux-gnu -static jt.o main.o -llvm-bolt jt.exe -o /dev/null -print-jump-tables
In the final step (running BOLT), the linker reports an unknown relocation type on .rodata.
🧠 Analysis
It appears that after the jump table is recognized, BOLT emits a relocation for each entry in .rodata, which triggers the error.
I'm not familiar with how ARM relocations should be handled here — is this a missing relocation handler, or should the relocations not be emitted at all?
🗂️ Environment
Target: AArch64
Error: Unknown relocation type: 2
Possibly related relocation: R_AARCH64_P32_ABS16
PR: https://github.com/llvm/llvm-project/pull/132114
Any insight from ARM or BOLT maintainers would be appreciated!
Thanks,
Zichen Li
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs