It is not used by LLVM, but GCC might generates it when compiling
with -fpie, as indicated by PR#40357 [1].
The testcase depends on https://reviews.llvm.org/D94611 to parse
gotpage_lo15 and https://reviews.llvm.org/D94809 to set the correct
placement of _GLOBAL_OFFSET_TABLE_ as expected by gcc.
Besides the regression check, I build a llvm (clang;clang-tools-extra;
compiler-rt;lld) with -fpie and -DLLVM_ENABLE_PIC=OFF with
gcc9 with DLLVM_ENABLE_LLD=ON to check if the
R_AARCH64_LD64_GOTPAGE_LO15 is handled correctly on large
projects.
The resulted build generates about 445619
R_AARCH64_LD64_GOTPAGE_LO15 relocations and the resulting
llvm shows no regression on check-all.
I think that this should be
From https://github.com/ARM-software/abi-aa/blob/master/aaelf64/aaelf64.rst the expression is: G(GDAT(S+A))-Page(GOT)
Where GOT is "GOT is the address of the Global Offset Table"
Page(p) will be the same as Page(GOT) for many entries close to the start of the GOT.
IIUC the intent is to get an offset from the base of the GOT so that the same register can hold the base of the GOT for the whole function.