[PATCH] D127061: [JITLink][ELF/AARCH64] Implement Procedure Linkage Table

Sunho Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 17:59:21 PDT 2022


sunho created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
sunho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch implements Procedure Linkage Table (PLT) for ELF/AARCH64. The aarch64 linux calling convention also uses r16 as the intra-procedure-call scratch register same as MachO/ARM64. We can use the same stub sequence for this reason.

Also, BR regiseter doesn't touch X30 register. External function call by BL instruction (touched by CALL26 relocation) will set X30 to the original PC + 4, which is the intended behavior. External function call by B instruction (touched by JUMP26 relocation) doesn't requite to set X30, so the patch will be correct in this case too.

Reference: https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#611general-purpose-registers


https://reviews.llvm.org/D127061

Files:
  llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
  llvm/test/ExecutionEngine/JITLink/AArch64/ELF_aarch64_relocations.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127061.434300.patch
Type: text/x-patch
Size: 4705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220605/7709382d/attachment.bin>


More information about the llvm-commits mailing list