[PATCH] D78387: [AIX][XCOFF] add symbol priority for the llvm-objdump -D -symbol-description

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 09:42:01 PDT 2020


DiggerLin marked 5 inline comments as done.
DiggerLin added inline comments.


================
Comment at: llvm/tools/llvm-objdump/XCOFFDump.cpp:82
+
+  // If symbol have not StorageMappingClass, it is in low proirity.
+  if (!SymInfo1.StorageMappingClass)
----------------
hubert.reinterpretcast wrote:
> There should be additional tiebreakers until the symbols are mostly indistinguishable. The symbol with the index is higher priority than the one without. Since we already prefer labels over csects, the symbol with the lower index is likely to be higher priority (at least if both have a storage mapping class; if not, then it's hard to tell). We can retain the old final tiebreaker on the name as well.
1. llvm-readobj sort the symbol on ascend order.
2. the symbol without index is always the first symbol of the symbols of each section.
3. if there are two symbols has the same address, llvm -D -symbol-description always use the symbol in the high ascend order.


================
Comment at: llvm/tools/llvm-objdump/XCOFFDump.cpp:96
+
+  return SymInfo1.StorageMappingClass.getValue() <=
+         SymInfo1.StorageMappingClass.getValue();
----------------
hubert.reinterpretcast wrote:
> We must never return `true` for comparing a symbol with itself. Also, we should prefer lower storage mapping class values: this conveniently means that the code interpretation is preferred over the data one (code being less likely to be of zero length).
thanks for point out comparing a symbol with itself


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78387





More information about the llvm-commits mailing list