[lld] [llvm] [LLD][ELF][AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (3/3) (PR #125689)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 07:04:50 PST 2025


=?utf-8?q?Csan=C3=A1d_Hajd=C3=BA?= <csanad.hajdu at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/125689 at github.com>


================
@@ -2844,6 +2848,40 @@ static void readSecurityNotes(Ctx &ctx) {
     ctx.arg.andFeatures &= ~GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
 }
 
+static void checkExecuteOnly(Ctx &ctx) {
+  if (ctx.arg.emachine != EM_AARCH64)
+    return;
+
+  auto report = [&](StringRef config) -> ELFSyncStream {
+    if (config == "error")
+      return {ctx, DiagLevel::Err};
+    if (config == "warning")
+      return {ctx, DiagLevel::Warn};
+    return {ctx, DiagLevel::None};
+  };
+  auto reportUnless = [&](StringRef config, bool cond) -> ELFSyncStream {
+    if (cond)
+      return {ctx, DiagLevel::None};
+    return report(config);
----------------
smithp35 wrote:

Can report be inlined here. IIUC this is the only use of it?

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


More information about the llvm-commits mailing list