MaskRay added a comment. I am unsure about the `llvm/lib/LTO/LTOCodeGenerator.cpp` logic. Can't your downstream project set `Config.Options.DataSections = true;` instead?
================ Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:572 CmdArgs.push_back("-plugin-opt=-function-sections"); } ---------------- Shouldn't function-sections be updated as well? ================ Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:352 + if (!codegen::getExplicitDataSections() && + (ObjectFormat == llvm::Triple::ObjectFormatType::ELF || + ObjectFormat == llvm::Triple::ObjectFormatType::XCOFF)) ---------------- No need to check ObjectFormat. All (except Mach-O) lld ports default to function-sections/data-sections. function-sections/data-sections is a no-op in Mach-O and setting the options don't hurt. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129401/new/ https://reviews.llvm.org/D129401 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits