diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2011-02-15 18:54:46 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-02-15 18:54:46 +0000 |
| commit | 09948f1af6304cfab8bfd6949236ca79d8d01a0a (patch) | |
| tree | df0147c86d19d89ec60f1d269742253945fdf765 /clang/lib/CodeGen | |
| parent | ffb3b51ba8604434f19832184e87727478cd36bd (diff) | |
| download | bcm5719-llvm-09948f1af6304cfab8bfd6949236ca79d8d01a0a.tar.gz bcm5719-llvm-09948f1af6304cfab8bfd6949236ca79d8d01a0a.zip | |
In -fapple-kext mode, global object construction code
ends up in the text segment. // rdar://8825235.
llvm-svn: 125585
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDeclCXX.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index db72080372a..8b37e9af3c6 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/lib/CodeGen/CGDeclCXX.cpp @@ -159,11 +159,12 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, llvm::Function *Fn = llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, Name, &CGM.getModule()); - - // Set the section if needed. - if (const char *Section = - CGM.getContext().Target.getStaticInitSectionSpecifier()) - Fn->setSection(Section); + if (!CGM.getContext().getLangOptions().AppleKext) { + // Set the section if needed. + if (const char *Section = + CGM.getContext().Target.getStaticInitSectionSpecifier()) + Fn->setSection(Section); + } if (!CGM.getLangOptions().Exceptions) Fn->setDoesNotThrow(); |

