diff options
| author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-19 00:04:15 +0000 |
|---|---|---|
| committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2008-02-19 00:04:15 +0000 |
| commit | c58fc4052e16b056ff776444f2eb03f7176cbf27 (patch) | |
| tree | 69e834bdfdad8b85ce1d19f24e542962756d4f75 /clang/CodeGen/CodeGenModule.cpp | |
| parent | 6200c225e0ab09dfa66154c39dacfbefb0f9a99e (diff) | |
| download | bcm5719-llvm-c58fc4052e16b056ff776444f2eb03f7176cbf27.tar.gz bcm5719-llvm-c58fc4052e16b056ff776444f2eb03f7176cbf27.zip | |
A global without initializer must be emitted as weak.
Fix Olden/bh test.
llvm-svn: 47292
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp index ef05586fcc6..d68fbe616dc 100644 --- a/clang/CodeGen/CodeGenModule.cpp +++ b/clang/CodeGen/CodeGenModule.cpp @@ -244,6 +244,9 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { case VarDecl::Register: assert(0 && "Can't have auto or register globals"); case VarDecl::None: + if (!D->getInit()) + GV->setLinkage(llvm::GlobalVariable::WeakLinkage); + break; case VarDecl::Extern: case VarDecl::PrivateExtern: // todo: common |

