[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


================
@@ -591,15 +603,15 @@ class AndroidPackedRelocationSection final : public RelocationBaseSection {
 };
 
 struct RelativeReloc {
-  uint64_t getOffset() const { return inputSec->getVA(offsetInSec); }
+  uint64_t getOffset() const { return inputSec->getVA(reloc->offset); }
 
   const InputSectionBase *inputSec;
-  uint64_t offsetInSec;
+  Relocation *reloc;
----------------
kovdan01 wrote:

Is adding such indirection applicable here? We need extra info like `sym` and `addend` to be able to convert a relr AUTH reloc to a rela one (see `Writer<ELFT>::finalizeAddressDependentContent()` in e9b53374522fca221414aac3d5a3b225e7fc73d4). If iterating through a vector with `RelativeReloc` items is a hot path, we might potentially encounter a performance decrease here. Is this a known bottle-neck? If yes, what benchmarks (for example, which particular tests from llvm-test-suite) test this?


https://github.com/llvm/llvm-project/pull/72714


More information about the llvm-commits mailing list