aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp b/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp
index d7f85f793c55..b7890e7f0937 100644
--- a/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -299,6 +299,18 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
RemarksSection = Ctx->getMachOSection(
"__LLVM", "__remarks", MachO::S_ATTR_DEBUG, SectionKind::getMetadata());
+ // The architecture of dsymutil makes it very difficult to copy the Swift
+ // reflection metadata sections into the __TEXT segment, so dsymutil creates
+ // these sections in the __DWARF segment instead.
+ if (!Ctx->getSwift5ReflectionSegmentName().empty()) {
+#define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \
+ Swift5ReflectionSections \
+ [llvm::binaryformat::Swift5ReflectionSectionKind::KIND] = \
+ Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \
+ MACHO, 0, SectionKind::getMetadata());
+#include "llvm/BinaryFormat/Swift.def"
+ }
+
TLSExtraDataSection = TLSTLVSection;
}