Hi,
While testing PR #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: #132114
Any insight from ARM or BOLT maintainers would be appreciated!
Thanks,
Zichen Li