Index: lld/trunk/ELF/Config.h =================================================================== --- lld/trunk/ELF/Config.h +++ lld/trunk/ELF/Config.h @@ -79,6 +79,7 @@ bool StripAll; bool SysvHash = true; bool Threads; + bool Trace; bool Verbose; bool WarnCommon; bool ZExecStack; Index: lld/trunk/ELF/Driver.cpp =================================================================== --- lld/trunk/ELF/Driver.cpp +++ lld/trunk/ELF/Driver.cpp @@ -90,7 +90,8 @@ // Newly created memory buffers are owned by this driver. void LinkerDriver::addFile(StringRef Path) { using namespace llvm::sys::fs; - log(Path); + if (Config->Verbose || Config->Trace) + llvm::outs() << Path << "\n"; auto MBOrErr = MemoryBuffer::getFile(Path); if (!MBOrErr) { error(MBOrErr, "cannot open " + Path); @@ -250,6 +251,7 @@ Config->Shared = Args.hasArg(OPT_shared); Config->StripAll = Args.hasArg(OPT_strip_all); Config->Threads = Args.hasArg(OPT_threads); + Config->Trace = Args.hasArg(OPT_trace); Config->Verbose = Args.hasArg(OPT_verbose); Config->WarnCommon = Args.hasArg(OPT_warn_common); Index: lld/trunk/ELF/Options.td =================================================================== --- lld/trunk/ELF/Options.td +++ lld/trunk/ELF/Options.td @@ -126,6 +126,9 @@ def threads : Joined<["--"], "threads">; +def trace: Flag<["--"], "trace">, + HelpText<"Print the names of the input files">; + def undefined : Joined<["--"], "undefined=">, HelpText<"Force undefined symbol during linking">; @@ -169,6 +172,7 @@ def alias_soname_h : JoinedOrSeparate<["-"], "h">, Alias; def alias_soname_soname : Separate<["-"], "soname">, Alias; def alias_script_T : JoinedOrSeparate<["-"], "T">, Alias