[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
       
    Tue Jan 17 15:24:35 PST 2017
    
    
  
eugenis added inline comments.
================
Comment at: lib/CodeGen/TargetLoweringObjectFileImpl.cpp:228
+
+  if (SectionName == "asan_globals") {
+    Flags |= ELF::SHF_ASSOCIATED;
----------------
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.
Repository:
  rL LLVM
https://reviews.llvm.org/D28498
    
    
More information about the llvm-commits
mailing list