diff options
Diffstat (limited to 'lld/lib/Driver/WinLinkDriver.cpp')
| -rw-r--r-- | lld/lib/Driver/WinLinkDriver.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index a312eb2a126..64ad9cba853 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -363,6 +363,11 @@ bool WinLinkDriver::parse(int argc, const char *argv[], ctx.setAllowRemainingUndefines(true); break; + case OPT_no_ref: + // Handle /opt:noref + ctx.setDeadStripping(false); + break; + case OPT_no_nxcompat: // handle /nxcompat:no ctx.setNxCompat(false); @@ -425,6 +430,12 @@ bool WinLinkDriver::parse(int argc, const char *argv[], if (ctx.entrySymbolName().empty()) setDefaultEntrySymbolName(ctx); + // Specifying both /opt:ref and /opt:noref is an error. + if (parsedArgs->getLastArg(OPT_ref) && parsedArgs->getLastArg(OPT_no_ref)) { + diagnostics << "/opt:ref must not be specified with /opt:noref\n"; + return true; + } + // Arguments after "--" are interpreted as filenames even if they // start with a hypen or a slash. This is not compatible with link.exe // but useful for us to test lld on Unix. |

