[all-commits] [llvm/llvm-project] 9832c9: [JITLink][LoongArch] Ignore R_LARCH_RELAX and chec...
ZhaoQi via All-commits
all-commits at lists.llvm.org
Thu Jan 9 17:58:52 PST 2025
Branch: refs/heads/users/zhaoqi5/jitlink-relax-align
Home: https://github.com/llvm/llvm-project
Commit: 9832c9f5a2a71c1df4b6ce2f109bf989973dadce
https://github.com/llvm/llvm-project/commit/9832c9f5a2a71c1df4b6ce2f109bf989973dadce
Author: Qi Zhao <zhaoqi01 at loongson.cn>
Date: 2025-01-10 (Fri, 10 Jan 2025)
Changed paths:
M llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
Log Message:
-----------
[JITLink][LoongArch] Ignore R_LARCH_RELAX and check R_LARCH_ALIGN
Linker relaxation is not implemented for jitlink now (maybe
implement in the future). But if relaxation is enabled by clang,
R_LARCH_RELAX and R_LARCH_ALIGN relocations will be emitted.
So we just ignore linker relaxation and check the alignment now.
If not, interpreting C++ code using clang-repl when relaxation
is enabled will occur error: `JIT session error: Unsupported
loongarch relocation:102: R_LARCH_ALIGN`.
Similar to: https://github.com/llvm/llvm-project/commit/f5b5398ebf7da1ab54f6793331bca8fbc3340f14.
Commit: 91aea9bdf601af969a5d57089223af919e0afdc1
https://github.com/llvm/llvm-project/commit/91aea9bdf601af969a5d57089223af919e0afdc1
Author: Qi Zhao <zhaoqi01 at loongson.cn>
Date: 2025-01-10 (Fri, 10 Jan 2025)
Changed paths:
M llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
M llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
M llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp
M llvm/lib/ExecutionEngine/JITLink/loongarch.cpp
A llvm/test/ExecutionEngine/JITLink/LoongArch/ELF_relax_align.s
Log Message:
-----------
[JITLink][LoongArch] Support R_LARCH_ALIGN relaxation
Linker relaxation is not implemented for jitlink now. But if
relaxation is enabled by clang, R_LARCH_RELAX and R_LARCH_ALIGN
relocations will be emitted.
This commit adapts lld's algorithm to jitlink. Currently, only
relaxing R_LARCH_ALIGN is implemented. Other relaxable relocs
can be implemented in the future.
Without this, interpreting C++ code using clang-repl or running
ir using lli when relaxation is enabled will occur error: `JIT
session error: Unsupported loongarch relocation:102: R_LARCH_ALIGN`.
Similar to https://github.com/llvm/llvm-project/commit/310473c536dd4837934832d1b5454d212f15d5cc but only implement align.
Compare: https://github.com/llvm/llvm-project/compare/41de630041d8...91aea9bdf601
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list