[PATCH] D44336: Implement --cref.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 02:12:53 PDT 2018


grimar added a comment.

GNU spec says "If a linker map file is being generated, the cross reference table is printed to the map file.", I checked that bfd do that. 
Should we do that too?



================
Comment at: lld/ELF/MapFile.cpp:174
+      if (auto *Sym = dyn_cast<Defined>(B))
+        if (!Sym->isLocal() || (!Sym->Section || Sym->Section->Live))
+          Map[Sym].insert(File);
----------------
Your test pass with this line removed.


================
Comment at: lld/ELF/MapFile.cpp:190
+    Symbol *Sym = KV.first;
+    SetVector<InputFile *> &Files = KV.second;
+    Print(toString(*Sym), toString(Sym->File));
----------------
I would move `Files` below `Print`.


================
Comment at: lld/ELF/MapFile.cpp:193
+
+    for (InputFile *File : Files)
+      if (File != Sym->File)
----------------
Does it make sense to sort `Files` by name? Can be convenient probably. (BFD does **not ** do that FWIW).


https://reviews.llvm.org/D44336





More information about the llvm-commits mailing list