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

Vincent Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 12:25:44 PST 2022


thevinster added a comment.

> Do you think this needs to be changed?

I don't think the core logic needs to be changed. It makes more sense to have LLD's output be a subset of ld64 (for now), which hints at the fact that our dead strip isn't on par with ld64 (or something else is going on).



================
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();
----------------
Roger wrote:
> thevinster wrote:
> > Why do we need to propagate `Live` to the lambda? Does ld64 order dead stripped symbols by the name only?
> The ordering for live symbols is first by virtual address and then by name. As I understand, dead-stripped symbols don't have virtual addresses so we can just order by name.
Do we need to have this ordered? I guess you're trying to not fork the code so passing it into the lambda makes sense, but in general, we could skip the sort for dead stripped symbols. 


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