Review Request: Fix for a bug found in applying R_AARCH64_ADR_GOT_PAGE relocation


While working on lld, I observed that applying R_AARCH64_ADR_GOT_PAGE relocation causes a hello-world program to crash with SIGSEGV when compiled/linked with the trunk versions of clang/lld on AArch64.

As per my understanding, this is due to a bug in the implementation of relocR_AARCH64_ADR_GOT_PAGE() in file AArch64RelocationHandler.cpp. This seems to be a regression compared to the stable version RELEASE_360 of lld.

The generated code sequence with the bug is:

AArch64RelocationHandler.cpp.patch (662 Bytes)