[all-commits] [llvm/llvm-project] 95dcb8: [llvm-jitlink] Support plain AArch32 stubs in jitl...
Stefan Gränitz via All-commits
all-commits at lists.llvm.org
Fri Nov 24 12:41:13 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 95dcb8b49dd3bb0fcb9f020fe931632a0ddf4994
https://github.com/llvm/llvm-project/commit/95dcb8b49dd3bb0fcb9f020fe931632a0ddf4994
Author: Stefan Gränitz <stefan.graenitz at gmail.com>
Date: 2023-11-24 (Fri, 24 Nov 2023)
Changed paths:
M llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
A llvm/test/ExecutionEngine/JITLink/AArch32/ELF_thumb_stubs.s
M llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
Log Message:
-----------
[llvm-jitlink] Support plain AArch32 stubs in jitlink-check's stub_addr() expressions (#73268)
We want to use regular `stub_addr()` expressions in `jitlink-check` lines to test the generation of stubs in AArch32, but we don't want this to require a standardized GOT-based PLT implementation. In terms of performance and binary size it doesn't seem beneficial. And in terms of patching branch targets, we should be able to handle range-extension- and interworking-stubs without a lot of extra logic.
In order to allow such AArch32 stubs we add a separate path for `stub_addr()` expressions in `llvm-jitlink-elf`. The relocations in our stubs are not pointing to the GOT, but to the external symbol directly. Thus, we have to avoid access to the block of the edge target. Instead we only return the symbol name, which is enough to use `stub_addr()` expressions in tests.
The name of the AArch32 stubs section differs from the conventional `$__STUBS` on purpose. It allows to add a regular PLT/GOT implementation as an orthogonal feature in the future. In order to also allow decoding of stub target addresses in the future, we mention the stub flavor in the section name as well.
More information about the All-commits
mailing list