[PATCH] D96613: [lld] Add options to trace all symbols and to trace all symbols originated from a file

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 11:43:40 PST 2021


MaskRay added a comment.

https://sourceware.org/bugzilla/show_bug.cgi?id=27407
I think the functionality can be straightforwardly emulated. For example, `llvm-nm -Du` dumps undefined symbols in `.dynsym`.

`% ld.lld @response.txt $(llvm-nm -Du usr/lib64/libc.so.6 | awk '{print "-y"substr($0,20)}')`

This even works with versioned symbols while the patch doesn't. You can tweak `-u`: e.g. `-U` dumps defined symbols (`-U` is not in `nm`).
This is the flexibility provided by composing tools, which will be a bit inconvenient to implement in code.

The patch uses `this->file`, however, the value may change the if the symbol gets resolved to other files. In the cases I can conceive we want the trace of the full lifetime of a symbol, not only when it is bound to a specific file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96613/new/

https://reviews.llvm.org/D96613



More information about the llvm-commits mailing list