From 0a95e71e9d1aeb145fc0bebbc7eb55ae8a33d1b5 Mon Sep 17 00:00:00 2001 From: Ellis Hoag Date: Thu, 2 Oct 2025 18:13:18 -0700 Subject: [PATCH] [ObjC][Gen] Emit strs into cstrings if willBeRelativelyAddressed --- lib/IRGen/GenDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {