Index: ELF/Config.h =================================================================== --- ELF/Config.h +++ ELF/Config.h @@ -105,7 +105,6 @@ bool VersionScriptGlobalByDefault = true; bool WarnCommon; bool ZCombreloc; - bool ZDefs; bool ZExecStack; bool ZNodelete; bool ZNow; Index: ELF/Driver.cpp =================================================================== --- ELF/Driver.cpp +++ ELF/Driver.cpp @@ -364,7 +364,7 @@ error("number of threads must be > 0"); Config->ZCombreloc = !hasZOption(Args, "nocombreloc"); - Config->ZDefs = hasZOption(Args, "defs"); + Config->NoUndefined |= hasZOption(Args, "defs"); Config->ZExecStack = hasZOption(Args, "execstack"); Config->ZNodelete = hasZOption(Args, "nodelete"); Config->ZNow = hasZOption(Args, "now"); Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -277,9 +277,8 @@ if (!Config->NoUndefined) { if (Config->Relocatable) return; - if (Config->Shared && !Config->ZDefs) - if (Sym->symbol()->Visibility == STV_DEFAULT) - return; + if (Config->Shared && Sym->symbol()->Visibility == STV_DEFAULT) + return; } std::string Msg = "undefined symbol: " + Sym->getName().str();