[PATCH] D19011: [ELF] - Change -t implementation to print which archive members are used.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 13 09:14:38 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/Driver.cpp:101-102
@@ -100,4 +100,4 @@
using namespace llvm::sys::fs;
- if (Config->Verbose || Config->Trace)
+ if (Config->Verbose)
llvm::outs() << Path << "\n";
auto MBOrErr = MemoryBuffer::getFile(Path);
----------------
grimar wrote:
> ruiu wrote:
> > Is there any reason to keep this code here?
> I leaved it intentionally, but the answer on your question should be based on what Verbose should do.
> I assumed that it should not behave as -t. For example when we using archives, -t will output only
> those members that are used during link. If members are not used - you`ll never see archive name using -t.
> Verbose in opposite - always prints any file processed. Including script files by the way, which are not
> handled by -t (and that is equal to gold behavior, it does not print script files names).
>
> So my opinion - Verbose is separate option and usefull itself, I would not combine it with -t.
Makes sense.
================
Comment at: ELF/SymbolTable.cpp:100-107
@@ -87,10 +99,10 @@
// Lazy object file
if (auto *F = dyn_cast<LazyObjectFile>(FileP)) {
LazyObjectFiles.emplace_back(cast<LazyObjectFile>(File.release()));
F->parse();
for (Lazy &Sym : F->getLazySymbols())
addLazy(&Sym);
return;
}
----------------
You want to move this code before `if (Config->Trace)`.
================
Comment at: test/ELF/Inputs/trace-ar1.s:1
@@ +1,2 @@
+.globl _used;
+_used:
----------------
Remove ;
================
Comment at: test/ELF/Inputs/trace-ar2.s:1
@@ +1,2 @@
+.globl _notused;
+_notused:
----------------
Remove ;
http://reviews.llvm.org/D19011
More information about the llvm-commits
mailing list