[lld] [lld] [MTE] Drop MTE globals for fully static executables, not ban (PR #68217)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 05:43:49 PDT 2023


================
@@ -3029,10 +3029,20 @@ void LinkerDriver::link(opt::InputArgList &args) {
   // partition.
   copySectionsIntoPartitions();
 
-  if (config->emachine == EM_AARCH64 &&
-      config->androidMemtagMode != ELF::NT_MEMTAG_LEVEL_NONE) {
+  if (canHaveMemtagGlobals()) {
     llvm::TimeTraceScope timeScope("Process memory tagged symbols");
     createTaggedSymbols(ctx.objectFiles);
+  } else if (config->emachine == EM_AARCH64) {
+    // For fully static executables, make sure we prune any potential
----------------
smithp35 wrote:

As has been mentioned previously these could be supported by static linking at some future point. Perhaps worth changing to something like: "Static linking of Memtag Globals not supported, remove all SHT_AARCH64_MEMTAG_GLOBALS_STATIC sections."

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


More information about the llvm-commits mailing list