llvm.org GIT mirror llvm / 35e8f7f
gold: Add ability to toggle function/data sections 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336838 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 2 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
833833 // FIXME: Check the gold version or add a new option to enable them.
834834 Conf.Options.RelaxELFRelocations = false;
835835
836 // Enable function/data sections by default.
837 Conf.Options.FunctionSections = true;
838 Conf.Options.DataSections = true;
836 // Toggle function/data sections.
837 if (FunctionSections.getNumOccurrences() == 0)
838 Conf.Options.FunctionSections = true;
839 if (DataSections.getNumOccurrences() == 0)
840 Conf.Options.DataSections = true;
839841
840842 Conf.MAttrs = MAttrs;
841843 Conf.RelocModel = RelocationModel;