diff options
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 71e5b72a40c..8ffa5877ba6 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -833,8 +833,10 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite, Conf.Options.RelaxELFRelocations = false; // Toggle function/data sections. - Conf.Options.FunctionSections = SplitSections; - Conf.Options.DataSections = SplitSections; + if (FunctionSections.getNumOccurrences() == 0) + Conf.Options.FunctionSections = SplitSections; + if (DataSections.getNumOccurrences() == 0) + Conf.Options.DataSections = SplitSections; Conf.MAttrs = MAttrs; Conf.RelocModel = RelocationModel; |

