[lld] [lld][AArch64][ELF][PAC] Support AUTH relocations and AUTH ELF marking (PR #72714)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 28 13:02:04 PST 2024
================
@@ -1734,9 +1742,34 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
in.mipsGot->updateAllocSize();
for (Partition &part : partitions) {
+ // We've put relocations in relrAuthDyn during
+ // RelocationScanner::processAux, but the target VA for some of them might
+ // be wider than 32 bits which does not fit the place for implicit value
+ // of relr AUTH reloc. We can only know the final VA at this point, so
+ // move relocations with large values from relr to rela.
+ if (part.relrAuthDyn) {
+ for (auto it = part.relrAuthDyn->relocs.begin();
+ it != part.relrAuthDyn->relocs.end();) {
+ if (isInt<32>(it->reloc->sym->getVA(it->reloc->addend))) {
+ ++it;
+ continue;
+ }
+ part.relaDyn->addReloc({R_AARCH64_AUTH_RELATIVE, it->inputSec,
----------------
kovdan01 wrote:
As far as I understand, here we run in single-thread mode, and we do not need `std::lock_guard<std::mutex> lock(relocMutex);`. Please let me know if I'm mistaken.
https://github.com/llvm/llvm-project/pull/72714
More information about the llvm-commits
mailing list