[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 12:59:10 PST 2024


================
@@ -2619,6 +2623,42 @@ static uint32_t getAndFeatures() {
   return ret;
 }
 
+static void getAArch64PauthInfo() {
----------------
kovdan01 wrote:

I've renamed `uint32_t getAndFeatures` to `void readSecurityNotes` and merged `getAArch64PauthInfo` into it. As far as I understood, your intention was to avoid multiple loops over `ctx.objectFiles`, so, I've put processing of both `andFeatures` and `aarch64PauthAbiTag` into a single loop. I'm not sure if it increases readability though - I personally prefer smaller functions doing simple separate tasks. And we also still need `std::find_if` over `ctx.objectFiles` before the loop to find the first non-empty tag in order to emit `-z pauth-report`-related messages. Such `std::find_if` is effectively an extra iteration over `ctx.objectFiles` which can't be easily avoided, and I'm not sure if handling both `andFeatures` and `aarch64PauthAbiTag` in a single loop inside a single function gives any extra value.

See 1448a4a4e0e3cb70358558579e97fce3f0990356



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


More information about the llvm-commits mailing list