[JITLink] Add an initial implementation of JITLink for ELF/LoongArch
authorwanglei <wanglei@loongson.cn>
Tue, 17 Jan 2023 07:10:00 +0000 (15:10 +0800)
committerwanglei <wanglei@loongson.cn>
Wed, 18 Jan 2023 06:29:45 +0000 (14:29 +0800)
commit28b6f38d0a841451af7b4893368543382dd5e630
tree00ab262cecbdc4b184e65b3ad974cc1bf579c987
parent205b5f63a835bffc22dccfdaed53ee7dac504be1
[JITLink] Add an initial implementation of JITLink for ELF/LoongArch

This implementation supports basic relocation types and adds EHFrame,
Got/Plt handling passes.
This patch also enables JIT support for LoongArch64.

With this patch, I successfully run hello.ll and simple_throw.ll
(which is generated from test-suite/SingleSource/Regression/C++/EH/simple_throw.cpp)
using the `lli` command with options `--jit-kind=orc --jit-linker=jitlink`.

Note: `hasJIT` property of LoongArch32 remains false as there is no
validation environment.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D141036
llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h [new file with mode: 0644]
llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h [new file with mode: 0644]
llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
llvm/lib/ExecutionEngine/JITLink/ELF.cpp
llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp [new file with mode: 0644]
llvm/lib/ExecutionEngine/JITLink/loongarch.cpp [new file with mode: 0644]
llvm/lib/Target/LoongArch/TargetInfo/LoongArchTargetInfo.cpp
llvm/test/ExecutionEngine/JITLink/LoongArch/ELF_loongarch32_relocations.s [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/LoongArch/ELF_loongarch64_ehframe.s [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/LoongArch/ELF_loongarch64_relocations.s [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/LoongArch/lit.local.cfg [new file with mode: 0644]