diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index 41f0e9a266591..1f78501ed46c3 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -6026,7 +6026,8 @@ Address IRGenFunction::createAlloca(llvm::Type *type, llvm::Constant * IRGenModule::getAddrOfGlobalString(StringRef data, CStringSectionType type, bool willBeRelativelyAddressed) { - if (TargetInfo.OutputObjectFormat != llvm::Triple::MachO) + if (TargetInfo.OutputObjectFormat != llvm::Triple::MachO || + willBeRelativelyAddressed) type = CStringSectionType::Default; StringRef sectionName; switch (type) {