[PATCH] D15642: [asan] Use private aliases for global variables (LLVM part).
Yury Gribov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 20 12:49:38 PST 2016
ygribov added inline comments.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1399
@@ +1398,3 @@
+
+ bool CanUsePrivateAliases = TargetTriple.isOSBinFormatELF();
+ if (CanUsePrivateAliases && ClUsePrivateAliasForGlobals) {
----------------
Yeah.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1402
@@ +1401,3 @@
+ // Create local alias for NewGlobal to avoid crash on ODR between
+ // instrumented and non-instrumented libraries.
+ auto *GA = GlobalAlias::create(GlobalValue::InternalLinkage,
----------------
May also mention support for RTLD_DEEPBIND.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1408
@@ +1407,3 @@
+ // symbol _odr_genXXX to detect ODR violation.
+ auto *ODRIndicatorSym =
+ new GlobalVariable(M, IRB.getInt8Ty(), false, Linkage,
----------------
Got it.
Repository:
rL LLVM
http://reviews.llvm.org/D15642
More information about the llvm-commits
mailing list