summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2011-12-14 00:01:51 +0000
committerKostya Serebryany <kcc@google.com>2011-12-14 00:01:51 +0000
commitac6ae7302de21fb82fa2b14a71402f22afbf3ed4 (patch)
treeeba836a064b1e454867f6b7f3bb391e62cd68ac9 /llvm/lib/Transforms
parent1d337a5e06621d824d3697649f1388aca4f72616 (diff)
downloadbcm5719-llvm-ac6ae7302de21fb82fa2b14a71402f22afbf3ed4.tar.gz
bcm5719-llvm-ac6ae7302de21fb82fa2b14a71402f22afbf3ed4.zip
[asan] remove .preinit_array from the compiler module (it breaks .so builds). This should be done in the run-time.
llvm-svn: 146527
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index f170cf150ab..4d6e74b8334 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -163,8 +163,6 @@ struct AddressSanitizer : public ModulePass {
private:
- void appendToPreinitArray(Module &M, Function *F);
-
uint64_t getAllocaSizeInBytes(AllocaInst *AI) {
Type *Ty = AI->getAllocatedType();
uint64_t SizeInBytes = TD->getTypeStoreSizeInBits(Ty) / 8;
@@ -565,17 +563,6 @@ bool AddressSanitizer::insertGlobalRedzones(Module &M) {
return true;
}
-// .preinit_array is something that hapens before all other inits.
-// On systems where .preinit_array is honored, we will call __asan_init early.
-void AddressSanitizer::appendToPreinitArray(Module &M, Function *F) {
- IRBuilder<> IRB(M.getContext());
- GlobalVariable *Var =
- new GlobalVariable(M, PointerType::getUnqual(F->getFunctionType()),
- false, GlobalValue::PrivateLinkage,
- F, "__asan_preinit_private");
- Var->setSection(".preinit_array");
-}
-
// virtual
bool AddressSanitizer::runOnModule(Module &M) {
// Initialize the private fields. No one has accessed them before.
@@ -647,9 +634,6 @@ bool AddressSanitizer::runOnModule(Module &M) {
appendToGlobalCtors(M, AsanCtorFunction, 1 /*high priority*/);
- if (M.getTargetTriple().find("linux") != std::string::npos)
- appendToPreinitArray(M, AsanInitFunction);
-
return Res;
}
OpenPOWER on IntegriCloud