[PATCH] D73174: [llvm-readobj] - Refine --needed-libs implementation and add a test.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 00:47:56 PST 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:2474
 
-  llvm::stable_sort(Libs);
+  llvm::sort(Libs);
 
----------------
jhenderson wrote:
> What's the reasoning for this change? Won't this potentially change the behaviour where two DT_NEEDED entries have the same string?
We have a `std::vector<std::string>` here and sorting it to print below.
What is the point to use `stable_sort`?
If we have "aaa", "bbb", "aaa" then we might end up with one of the following:

1) "aaa" (1), "aaa" (2), "bbb"
2) "aaa" (2), "aaa" (1), "bbb"

May be I am missing something, but what is the difference? :)


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

https://reviews.llvm.org/D73174





More information about the llvm-commits mailing list