[llvm] [AArch64] Bugfix when using execute-only and memtag sanitizer together (PR #133084)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 31 07:42:37 PDT 2025


================
@@ -511,11 +511,17 @@ void AArch64TargetELFStreamer::finish() {
       })) {
     auto *Text =
         static_cast<MCSectionELF *>(Ctx.getObjectFileInfo()->getTextSection());
-    for (auto &F : *Text)
-      if (auto *DF = dyn_cast<MCDataFragment>(&F))
-        if (!DF->getContents().empty())
-          return;
-    Text->setFlags(Text->getFlags() | ELF::SHF_AARCH64_PURECODE);
+    bool Empty = true;
+    for (auto &F : *Text) {
+      if (auto *DF = dyn_cast<MCDataFragment>(&F)) {
+        if (!DF->getContents().empty()) {
+          Empty = false;
+          break;
+        }
+      }
+    }
----------------
paulwalker-arm wrote:

Ok. Thanks for checking.

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


More information about the llvm-commits mailing list