[PATCH] D75756: [llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 02:20:05 PDT 2020
grimar added a comment.
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1868
+ printCOFFSymbolTable(Coff);
+ return;
+ }
----------------
I wonder if we want to have it here or move it above, out of scope of this `if (!DumpDynamic)`.
Probably we do not want to change the behavior of COFF?
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1886
+ for (; I != E; ++I) {
const SymbolRef &Symbol = *I;
uint64_t Address = unwrapOrError(Symbol.getAddress(), FileName, ArchiveName,
----------------
>>! In D75756#1918796, @Higuoxing wrote:
> Addressed @grimar 's comments
> * I have to use this pattern, due to there doesn't exist a default constructor for `basic_symbol_iterator`
>
> ```
> auto I = O->symbol_begin();
> ...
> if (DumpDynamic) {
> I = ELF->dynamic_symbol_begin();
> ...
> }
> ```
I think lets create a `printSymbol(SymbolRef Sym, ...)` helper. It should help.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75756/new/
https://reviews.llvm.org/D75756
More information about the llvm-commits
mailing list