[lld] r310998 - [ELF/LTO] -function-sections/-data-sections are exact options.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 16 01:21:04 PDT 2017
Author: davide
Date: Wed Aug 16 01:21:04 2017
New Revision: 310998
URL: http://llvm.org/viewvc/llvm-project?rev=310998&view=rev
Log:
[ELF/LTO] -function-sections/-data-sections are exact options.
Also add a test. This fixes r310995 and PR34200.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/lto-plugin-ignore.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=310998&r1=310997&r2=310998&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Aug 16 01:21:04 2017
@@ -716,8 +716,8 @@ void LinkerDriver::readConfigs(opt::Inpu
Config->ThinLTOJobs = parseInt(S.substr(5), Arg);
else if (!S.startswith("/") && !S.startswith("-fresolution=") &&
!S.startswith("-pass-through=") && !S.startswith("mcpu=") &&
- !S.startswith("thinlto") && !S.startswith("-function-sections") &&
- !S.startswith("-data-sections"))
+ !S.startswith("thinlto") && S != "-function-sections" &&
+ S != "-data-sections")
error(Arg->getSpelling() + ": unknown option: " + S);
}
Modified: lld/trunk/test/ELF/lto-plugin-ignore.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto-plugin-ignore.s?rev=310998&r1=310997&r2=310998&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto-plugin-ignore.s (original)
+++ lld/trunk/test/ELF/lto-plugin-ignore.s Wed Aug 16 01:21:04 2017
@@ -2,4 +2,10 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: ld.lld %t -plugin-opt=/foo/bar -plugin-opt=-fresolution=zed \
-# RUN: -plugin-opt=-pass-through=-lgcc -o /dev/null
+# RUN: -plugin-opt=-pass-through=-lgcc -plugin-opt=-function-sections \
+# RUN: -plugin-opt=-data-sections -o /dev/null
+
+# RUN: not ld.lld %t -plugin-opt=-data-sectionssss \
+# RUN: -plugin-opt=-function-sectionsss 2>&1 | FileCheck %s
+# CHECK: unknown option: -data-sectionsss
+# CHECK: unknown option: -function-sectionsss
More information about the llvm-commits
mailing list