[PATCH] D114737: [lld][Macho] Include dead-stripped symbols in mapfile

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 2 20:39:26 PST 2022


thevinster added a comment.

The output from ld64 doesn't look like what lld produces. Also the command you linked above doesn't pass in `dead_strip`. Is ld64 always outputting dead stripped symbols regardless of the flag or is the summary a typo?



================
Comment at: lld/MachO/MapFile.cpp:45
+// symbols.
+static std::vector<Defined *> getSymbols(bool Live) {
   std::vector<Defined *> v;
----------------
nit: Variable name should be camel case. Also, I think `dumpLive` or something around that seems to be better fit than just `Live`. 


================
Comment at: lld/MachO/MapFile.cpp:57
+  parallelSort(v.begin(), v.end(), [Live](Defined *a, Defined *b) {
+    return Live && a->getVA() != b->getVA() ? a->getVA() < b->getVA()
+                                            : a->getName() < b->getName();
----------------
Why do we need to propagate `Live` to the lambda? Does ld64 order dead stripped symbols by the name only?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114737



More information about the llvm-commits mailing list