[lld] r228749 - GNU: Add --no-export-dynamic command line option.
Rui Ueyama
ruiu at google.com
Tue Feb 10 13:27:31 PST 2015
Author: ruiu
Date: Tue Feb 10 15:27:31 2015
New Revision: 228749
URL: http://llvm.org/viewvc/llvm-project?rev=228749&view=rev
Log:
GNU: Add --no-export-dynamic command line option.
Modified:
lld/trunk/lib/Driver/GnuLdDriver.cpp
lld/trunk/lib/Driver/GnuLdOptions.td
lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=228749&r1=228748&r2=228749&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Tue Feb 10 15:27:31 2015
@@ -508,8 +508,9 @@ bool GnuLdDriver::parse(int argc, const
if (parsedArgs->hasArg(OPT_noinhibit_exec))
ctx->setAllowRemainingUndefines(true);
- if (parsedArgs->hasArg(OPT_export_dynamic))
- ctx->setExportDynamic(true);
+ if (auto val = getBool(*parsedArgs, OPT_export_dynamic,
+ OPT_no_export_dynamic))
+ ctx->setExportDynamic(*val);
if (parsedArgs->hasArg(OPT_allow_multiple_definition))
ctx->setAllowDuplicates(true);
Modified: lld/trunk/lib/Driver/GnuLdOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdOptions.td?rev=228749&r1=228748&r2=228749&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdOptions.td (original)
+++ lld/trunk/lib/Driver/GnuLdOptions.td Tue Feb 10 15:27:31 2015
@@ -156,6 +156,8 @@ def export_dynamic : Flag<["-", "--"], "
Group<grp_main>;
def alias_export_dynamic: Flag<["-"], "E">,
Alias<export_dynamic>;
+def no_export_dynamic : Flag<["--"], "no-export-dynamic">,
+ Group<grp_main>;
//===----------------------------------------------------------------------===//
/// Dynamic Library Options
Modified: lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp?rev=228749&r1=228748&r2=228749&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/GnuLdDriverTest.cpp Tue Feb 10 15:27:31 2015
@@ -91,6 +91,18 @@ TEST_F(GnuLdParserTest, EntryJoined) {
EXPECT_EQ("foo", _context->entrySymbolName());
}
+// --export-dynamic
+
+TEST_F(GnuLdParserTest, ExportDynamic) {
+ EXPECT_TRUE(parse("ld", "a.o", "--export-dynamic", nullptr));
+ EXPECT_TRUE(_context->shouldExportDynamic());
+}
+
+TEST_F(GnuLdParserTest, NoExportDynamic) {
+ EXPECT_TRUE(parse("ld", "a.o", "--no-export-dynamic", nullptr));
+ EXPECT_FALSE(_context->shouldExportDynamic());
+}
+
// --init
TEST_F(GnuLdParserTest, Init) {
More information about the llvm-commits
mailing list