[PATCH] D70557: [lld][COFF] Add support for /map

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 00:50:30 PDT 2020


ruiu added inline comments.


================
Comment at: lld/COFF/LLDMapFile.cpp:69
+      return a->getRVA() < b->getRVA();
+    });
+  }
----------------
amccarth wrote:
> saudi wrote:
> > amccarth wrote:
> > > Stupid question:  Is it possible for two symbols to share an address?  If so, should this be a `std::stable_sort` for deterministic build outputs?
> > There definitely are symbols that share an address.
> > Note that LLDMapFile.cpp was previously MapFile.cpp which was renamed and mostly unchanged (just adapted for the rename).
> > But I don't mind fixing it on top, should I do that in this commit?
> I think switching to stable_sort should probably be a separate commit. That way, if I'm wrong, it can be rolled back without affecting anything else.
Good point. You can do either in this patch or in a follow-up patch, but this should definitely be stable_sort for build reproducibility. Our promise to users is that as long as you are using the exact same version of lld and feeding the exact same set of files and command line options, lld's outputs will be the same no matter what the host system is. For that reason we generally avoid unstable sort.


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

https://reviews.llvm.org/D70557





More information about the llvm-commits mailing list