summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/Internalize.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-04-13 01:06:27 +0000
committerBill Wendling <isanbard@gmail.com>2012-04-13 01:06:27 +0000
commit585583c8dd13bebe6fe5851ba3b872cfea411cdf (patch)
treed0bd571d37ba8862a17423a8901b441d31b9f2ab /llvm/lib/Transforms/IPO/Internalize.cpp
parentd3b64878ff0d7d22f79db7a3701a9bdb5cfe479f (diff)
downloadbcm5719-llvm-585583c8dd13bebe6fe5851ba3b872cfea411cdf.tar.gz
bcm5719-llvm-585583c8dd13bebe6fe5851ba3b872cfea411cdf.zip
Code-gen may inject code into the IR before it emits the ASM. The linker
obviously cannot know that this code is present, let alone used. So prevent the internalize pass from internalizing those global values which code-gen may insert. llvm-svn: 154645
Diffstat (limited to 'llvm/lib/Transforms/IPO/Internalize.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/Internalize.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp
index af5b9bd99e4..cd29e7a7a7d 100644
--- a/llvm/lib/Transforms/IPO/Internalize.cpp
+++ b/llvm/lib/Transforms/IPO/Internalize.cpp
@@ -122,6 +122,9 @@ bool InternalizePass::runOnModule(Module &M) {
bool Changed = false;
+ // Never internalize functions which code-gen might insert.
+ ExternalNames.insert("__stack_chk_fail");
+
// Mark all functions not in the api as internal.
// FIXME: maybe use private linkage?
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
@@ -150,6 +153,9 @@ bool InternalizePass::runOnModule(Module &M) {
ExternalNames.insert("llvm.global_dtors");
ExternalNames.insert("llvm.global.annotations");
+ // Never internalize symbols code-gen inserts.
+ ExternalNames.insert("__stack_chk_guard");
+
// Mark all global variables with initializers that are not in the api as
// internal as well.
// FIXME: maybe use private linkage?
OpenPOWER on IntegriCloud