[PATCH] D143530: [SanitizerBinaryMetadata] Make module_[cd]tor external

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 02:24:30 PST 2023


melver added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp:227
     }
     appendToGlobalCtors(Mod, Ctor, kCtorDtorPriority, CtorData);
     appendToGlobalDtors(Mod, Dtor, kCtorDtorPriority, DtorData);
----------------
Is there any usecase where having the COMDAT key internal linkage is valid? Should we add an assert() to appendToGlobalCtors()?

I'm guessing that will uncover a whole bunch of latent issues in other sanitizers as well.

(Unfortunately we can't make the ctor/dtor created in createSanitizerCtor always ExternalLinkage because e.g. ASan does actually need per-TU ctor/dtor for globals in some cases.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143530/new/

https://reviews.llvm.org/D143530



More information about the llvm-commits mailing list