[lld] r220144 - Fix display of files processed by the linker.
Shankar Easwaran
shankarke at gmail.com
Sat Oct 18 13:36:35 PDT 2014
Author: shankare
Date: Sat Oct 18 15:36:35 2014
New Revision: 220144
URL: http://llvm.org/viewvc/llvm-project?rev=220144&view=rev
Log:
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.
Added:
lld/trunk/test/elf/loginputfiles.test
Modified:
lld/trunk/lib/ReaderWriter/FileArchive.cpp
Modified: lld/trunk/lib/ReaderWriter/FileArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/FileArchive.cpp?rev=220144&r1=220143&r2=220144&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/FileArchive.cpp (original)
+++ lld/trunk/lib/ReaderWriter/FileArchive.cpp Sat Oct 18 15:36:35 2014
@@ -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<MemoryBuffer> buf(MemoryBuffer::getMemBuffer(
mb.getBuffer(), mb.getBufferIdentifier(), false));
Added: lld/trunk/test/elf/loginputfiles.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/loginputfiles.test?rev=220144&view=auto
==============================================================================
--- lld/trunk/test/elf/loginputfiles.test (added)
+++ lld/trunk/test/elf/loginputfiles.test Sat Oct 18 15:36:35 2014
@@ -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)
More information about the llvm-commits
mailing list