[PATCH] D51902: [SanitizerCoverage] Create comdat for global arrays.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 11 13:53:43 PDT 2018


eugenis added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:582
+      std::string ModuleId = getUniqueModuleId(CurModule);
+      Name += ModuleId.empty() ? CurModule->getModuleIdentifier() : ModuleId;
+    }
----------------
I don't think this is correct - getModuleIdentifier() is even less unique then getUniqueModuleId, and comdat names for local linkage functions really have to be unique.

Imagine two files with the same relative path, no exported symbols, defining local functions with the same name. We don't want them to share a comdat.

I think this case needs to fallback to non-comdat non-associated instrumentation (the one that suppressed linker GC).



Repository:
  rL LLVM

https://reviews.llvm.org/D51902





More information about the llvm-commits mailing list