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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 20:26:25 PST 2017


pcc added a comment.

The `InstrumentGlobals` function is now basically four functions in one at this point. I'm wondering whether this code could be made more readable if we split each target object format into its own function.



================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1602
+  // comdats keyed off similarly named internal symbols, one of them will be
+  // discarded. To avoid this, we append a module-unique string to such comdat
+  // names; and when this is not possible, we fall back to the old metadata
----------------
@rnk Can you remind me why this is not an issue for COFF?


================
Comment at: test/Instrumentation/AddressSanitizer/global_metadata.ll:25
 ; CHECK: [[LOCDESCR:@__asan_gen_.[0-9]+]] = private unnamed_addr constant { [22 x i8]*, i32, i32 } { [22 x i8]* [[FILENAME]], i32 5, i32 5 }
+; CHECK: @__asan_global_global = {{.*}}, section "asan_globals"
 
----------------
Don't you want to check the content of this global? And what about the global metadata for `@.str`?


Repository:
  rL LLVM

https://reviews.llvm.org/D28498





More information about the llvm-commits mailing list