[JITLink][AArch32] Multi-stub support for armv7/thumbv7 (#78371)
commite5ca202ef8870f3b46cc19a7a62624e6908be9a8
authorStefan Gränitz <stefan.graenitz@gmail.com>
Tue, 23 Jan 2024 01:59:30 +0000 (23 02:59 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 01:59:30 +0000 (23 02:59 +0100)
tree18e3549fbe72be58917ad63b7be0d68b9ac390dd
parentb8e708b9d39862c2b7595c02e7bdc4878a2d7186
[JITLink][AArch32] Multi-stub support for armv7/thumbv7 (#78371)

We want to emit stubs that match the instruction set state of the
relocation site. This is important for branches that have no built-in
switch for the instruction set state. It's the case for Jump24
relocations. Relocations on instructions that support switching on
the fly will be rewritten in a relaxation step in the future. This
affects Call relocations on `BL`/`BLX` instructions.

In this patch, the StubManager gains a second stub symbol slot for each
target and selects which one to use based on the relocation type. For
testing, we select the appropriate slot with a stub-kind filter, i.e.
`arm` or `thumb`. With that we can implement Armv7 stubs and test
that we can have both kinds of stubs for a single external symbol.
llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
llvm/lib/ExecutionEngine/JITLink/aarch32.cpp
llvm/test/ExecutionEngine/JITLink/AArch32/ELF_stubs_arm.s [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/AArch32/ELF_stubs_multi.s [new file with mode: 0644]
llvm/tools/llvm-jitlink/llvm-jitlink.cpp