[JITLink][AArch46] Update aarch64 pointer jump stub sequence, add utilities.
authorLang Hames <lhames@gmail.com>
Mon, 31 Oct 2022 05:14:30 +0000 (22:14 -0700)
committerLang Hames <lhames@gmail.com>
Mon, 31 Oct 2022 15:41:20 +0000 (08:41 -0700)
commit5af9e648ae10c50d94ab169f65907e12f210ec99
tree3e8c9dc650f7f55902b43b5856d37afb079e39f4
parent2406ba1563d5d2805cee1d41c29f2837e2fd5bd7
[JITLink][AArch46] Update aarch64 pointer jump stub sequence, add utilities.

Updates the aarch64 pointer jump stub sequence to:

ADRP x16, <ptr>@page21
LDR  x16, [x16, <ptr>@pageoff12]
BR   x16

from:

LDR  x16, <ptr>@ldrimm19
BR   x16

The old sequence can only reference pointers within +/-1Mb, which may not be
enough for large object files. The new sequence can reach pointers within
+/-4Gb. (A future pre-fixup-pass could apply range-based optimizations to
turn this into an ldr-br-nop sequence.)

Also adds createPointerJumpStubBlock and createAnonymousPointerJumpStub
utilities along the same lines as their x86-64 counterparts.

The PLTTableManager is updated to use the new utility functions.
llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
llvm/lib/ExecutionEngine/JITLink/aarch64.cpp