[JITLink][arm64] Support arm64e JIT'd code (initially enabled for MachO only).
commita432f11a52dd5ec21a3438bdaa8f623e32a3234c
authorLang Hames <lhames@gmail.com>
Thu, 21 Nov 2024 00:57:15 +0000 (21 11:57 +1100)
committerLang Hames <lhames@gmail.com>
Thu, 21 Nov 2024 03:59:52 +0000 (21 14:59 +1100)
treea43e361b4040ab9abfb7678569c090018a1c804f
parent4d6e69143dc449814884ac649583d3b35bc4ae91
[JITLink][arm64] Support arm64e JIT'd code (initially enabled for MachO only).

Adds two new JITLink passes to create and populate a pointer-signing function
that can be called via an allocation-action attached to the LinkGraph:

* createEmptyPointerSigningFunction creates a pointer signing function in a
custome section, reserving sufficient space for the signing code. It should
be run as a post-prune pass (to ensure that memory is reserved prior to
allocation).
* lowerPointer64AuthEdgesToSigningFunction pass populates the signing function
by walking the graph, decoding the ptrauth info (encoded in the edge addend) and
writing an instruction sequence to sign all ptrauth fixup locations.

rdar://61956998
llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
llvm/lib/ExecutionEngine/JITLink/aarch64.cpp
llvm/test/ExecutionEngine/JITLink/AArch64/MachO_ptrauth-globals.s [new file with mode: 0644]