Some programs (e.g. Linux) aren't able to handle function/data sections when
LTO is used. Thus they need a way to disable it. That can be done with these
plugin options:
-plugin-opt=-function-sections=0
-plugin-opt=-data-sections=0
llvm-svn: 336838
// FIXME: Check the gold version or add a new option to enable them.
Conf.Options.RelaxELFRelocations = false;
- // Enable function/data sections by default.
- Conf.Options.FunctionSections = true;
- Conf.Options.DataSections = true;
+ // Toggle function/data sections.
+ if (FunctionSections.getNumOccurrences() == 0)
+ Conf.Options.FunctionSections = true;
+ if (DataSections.getNumOccurrences() == 0)
+ Conf.Options.DataSections = true;
Conf.MAttrs = MAttrs;
Conf.RelocModel = RelocationModel;