[PATCH] D28498: [asan] Make ASan compatible with linker dead stripping on Linux.

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 16:25:22 PST 2017


eugenis marked an inline comment as done.
eugenis added inline comments.


================
Comment at: lib/CodeGen/TargetLoweringObjectFileImpl.cpp:228
+
+  if (SectionName == "asan_globals") {
+    Flags |= ELF::SHF_ASSOCIATED;
----------------
eugenis wrote:
> mehdi_amini wrote:
> > pcc wrote:
> > > Should this be testing a new flag on GlobalObject, rather than the section name?
> > > 
> > > Also, do we need to teach globaldce about this?
> > MachO version is using `llvm.compiler.used` to avoid having to teach GlobalDCE and other part of LLVM about a special section semantics.
> Yeah, we could that, at a minimum.
> 
> But this code is definitely wrong: we don't want the new flag to be added on  .S -> .o transform, unless explicitly given in the assembly.
> 
I'm not sure why I said that. This code has nothing to do with .S -> .o path.

llvm.compiler.used added.

I'm not convinced we need a whole IR thing (the global flag) for this tiny feature. Maybe e wait until there is more than one user?


Repository:
  rL LLVM

https://reviews.llvm.org/D28498





More information about the llvm-commits mailing list