[all-commits] [llvm/llvm-project] 87c426: [JITLink][ELF][AArch64] Implement Procedure Linkag...

Sunho Kim via All-commits all-commits at lists.llvm.org
Thu Jun 9 22:45:50 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 87c4268329072153f178d554e138166d579f18b9
      https://github.com/llvm/llvm-project/commit/87c4268329072153f178d554e138166d579f18b9
  Author: Sunho Kim <ksunhokim123 at naver.com>
  Date:   2022-06-10 (Fri, 10 Jun 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
    M llvm/test/ExecutionEngine/JITLink/AArch64/ELF_aarch64_relocations.s

  Log Message:
  -----------
  [JITLink][ELF][AArch64] Implement Procedure Linkage Table.

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

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D127061




More information about the All-commits mailing list