From: Shankar Easwaran Date: Sat, 18 Oct 2014 20:36:35 +0000 (+0000) Subject: Fix display of files processed by the linker. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=69df16f619f8e9d350e7f941611825e208cc6fe3;p=platform%2Fupstream%2Fllvm.git Fix display of files processed by the linker. This fixes the way archive members are displayed when the linker is used with a flag to show all the files that it processes. When an archive file member is read, we need to show the archive filename and the member. llvm-svn: 220144 --- diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp index 2e34b1b..15c4cc6 100644 --- a/lld/lib/ReaderWriter/FileArchive.cpp +++ b/lld/lib/ReaderWriter/FileArchive.cpp @@ -134,7 +134,9 @@ private: return ec; llvm::MemoryBufferRef mb = mbOrErr.get(); if (_logLoading) - llvm::outs() << mb.getBufferIdentifier() << "\n"; + llvm::outs() << _archive->getFileName() << "(" << mb.getBufferIdentifier() + << ")" + << "\n"; std::unique_ptr buf(MemoryBuffer::getMemBuffer( mb.getBuffer(), mb.getBufferIdentifier(), false)); diff --git a/lld/test/elf/loginputfiles.test b/lld/test/elf/loginputfiles.test new file mode 100644 index 0000000..850570d --- /dev/null +++ b/lld/test/elf/loginputfiles.test @@ -0,0 +1,28 @@ +# Tests functionality of -t +# +# Tests generated using the source files below +# main file +# int main() +# { +# fn(); +# return 0; +# } +# +# archive file +# int fn() +# { +# return 0; +# } +# +# int fn1() +# { +# return 0; +# } +# gcc -c main.c fn.c fn1.c + +RUN: lld -flavor gnu -target x86_64-linux \ +RUN: %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a -t --noinhibit-exec 2>&1 | \ +RUN: FileCheck -check-prefix INPUTFILES %s + +#INPUTFILES: mainobj.x86_64 +#INPUTFILES: libfnarchive.a(fn.o)