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
    ![Image](https://github.com/user-attachments/assets/4dcebe1d-774d-48d4-9905-7a47206fd3ff)

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.

![Image](https://github.com/user-attachments/assets/6a087092-a61e-47c4-a51a-79c779d865a0)

💻 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

Reply via email to