diff --git a/llvm/tools/objwriter/objwriter.cpp b/llvm/tools/objwriter/objwriter.cpp index cde58f14aa90b..903d4ee813bb0 100644 --- a/llvm/tools/objwriter/objwriter.cpp +++ b/llvm/tools/objwriter/objwriter.cpp @@ -155,6 +155,10 @@ bool ObjectWriter::Init(llvm::StringRef ObjectFilePath, const char* tripleName) CFIsPerOffset.truncate(0); + if (OutContext->getObjectFileType() == MCContext::IsMachO) { + Streamer->emitAssemblerFlag(MCAF_SubsectionsViaSymbols); + } + return true; }