summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-05-06 22:52:54 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-05-06 22:52:54 +0000
commit09cfb1cf2d951f3dd860545c1d97c08630e80372 (patch)
treefe5a6e12652b6aef1232bb5557b9dff18167c91b /llvm/lib/Linker/LinkModules.cpp
parent82c02b28f3a1a3adef1638e801999952a2e47f1b (diff)
downloadbcm5719-llvm-09cfb1cf2d951f3dd860545c1d97c08630e80372.tar.gz
bcm5719-llvm-09cfb1cf2d951f3dd860545c1d97c08630e80372.zip
If weak GlobalVariable was bitcast'ed to different type during linking
we will need to strip all casts for intializer lookup. llvm-svn: 50776
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index a82b266bbdb..ddc9081d654 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -758,7 +758,7 @@ static bool LinkGlobalInits(Module *Dest, const Module *Src,
Constant *SInit =
cast<Constant>(RemapOperand(SGV->getInitializer(), ValueMap));
- GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[SGV]);
+ GlobalVariable *DGV = cast<GlobalVariable>(StripPointerCasts(ValueMap[SGV]));
if (DGV->hasInitializer()) {
if (SGV->hasExternalLinkage()) {
if (DGV->getInitializer() != SInit)
OpenPOWER on IntegriCloud