Do flag compatibility check in checkOptions. NFC.

llvm-svn: 301476
This commit is contained in:
Rui Ueyama 2017-04-26 21:27:33 +00:00
parent 08af54c304
commit cf8247ef48
1 changed files with 3 additions and 3 deletions

View File

@ -242,6 +242,9 @@ static void checkOptions(opt::InputArgList &Args) {
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::InputArgList &Args) {
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);