[lld] r215389 - [PECOFF] Fix /profile option.

Rui Ueyama ruiu at google.com
Mon Aug 11 14:31:07 PDT 2014


Author: ruiu
Date: Mon Aug 11 16:31:07 2014
New Revision: 215389

URL: http://llvm.org/viewvc/llvm-project?rev=215389&view=rev
Log:
[PECOFF] Fix /profile option.

/profile implies /fixed:no -- so we had to *enable* base
relocations rather than disabling it.

Modified:
    lld/trunk/lib/Driver/WinLinkDriver.cpp
    lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=215389&r1=215388&r2=215389&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Mon Aug 11 16:31:07 2014
@@ -1166,8 +1166,8 @@ bool WinLinkDriver::parse(int argc, cons
     case OPT_profile:
       // /profile implies /opt:ref, /opt:noicf, /incremental:no and /fixed:no.
       ctx.setDeadStripping(true);
-      ctx.setBaseRelocationEnabled(false);
-      ctx.setDynamicBaseEnabled(false);
+      ctx.setBaseRelocationEnabled(true);
+      ctx.setDynamicBaseEnabled(true);
       break;
 
     case OPT_implib:

Modified: lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp?rev=215389&r1=215388&r2=215389&view=diff
==============================================================================
--- lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp (original)
+++ lld/trunk/unittests/DriverTests/WinLinkDriverTest.cpp Mon Aug 11 16:31:07 2014
@@ -658,8 +658,8 @@ TEST_F(WinLinkParserTest, OptUnknown) {
 TEST_F(WinLinkParserTest, Profile) {
   EXPECT_TRUE(parse("link.exe", "/profile", "a.obj", nullptr));
   EXPECT_TRUE(_context.deadStrip());
-  EXPECT_FALSE(_context.getBaseRelocationEnabled());
-  EXPECT_FALSE(_context.getDynamicBaseEnabled());
+  EXPECT_TRUE(_context.getBaseRelocationEnabled());
+  EXPECT_TRUE(_context.getDynamicBaseEnabled());
 }
 
 //





More information about the llvm-commits mailing list