[lld] r301476 - Do flag compatibility check in checkOptions. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 14:27:33 PDT 2017


Author: ruiu
Date: Wed Apr 26 16:27:33 2017
New Revision: 301476

URL: http://llvm.org/viewvc/llvm-project?rev=301476&view=rev
Log:
Do flag compatibility check in checkOptions. NFC.

Modified:
    lld/trunk/ELF/Driver.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=301476&r1=301475&r2=301476&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Apr 26 16:27:33 2017
@@ -242,6 +242,9 @@ static void checkOptions(opt::InputArgLi
   if (Config->Pie && Config->Shared)
     error("-shared and -pie may not be used together");
 
+  if (!Config->Shared && !Config->AuxiliaryList.empty())
+    error("-f may not be used without -shared");
+
   if (Config->Relocatable) {
     if (Config->Shared)
       error("-r and -shared may not be used together");
@@ -708,9 +711,6 @@ void LinkerDriver::readConfigs(opt::Inpu
   std::tie(Config->SysvHash, Config->GnuHash) = getHashStyle(Args);
   std::tie(Config->BuildId, Config->BuildIdVector) = getBuildId(Args);
 
-  if (!Config->Shared && !Config->AuxiliaryList.empty())
-    error("-f may not be used without -shared");
-
   if (auto *Arg = Args.getLastArg(OPT_symbol_ordering_file))
     if (Optional<MemoryBufferRef> Buffer = readFile(Arg->getValue()))
       Config->SymbolOrderingFile = getLines(*Buffer);




More information about the llvm-commits mailing list