diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-06 19:21:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-07-06 19:21:04 +0000 |
commit | 40b3496f9ae621250f90b1a107f3ad54b4e8e137 (patch) | |
tree | b6dd01652104f172ef55b55ff427b83c9211fdc5 /tools/llvm-nm | |
parent | be2ff7bc98825658def8c190efeca49303334537 (diff) |
When sorting by address, undefined symbols go first.
This matches gnu nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r-- | tools/llvm-nm/llvm-nm.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index 961754ccefa..c30d628d9a5 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -185,6 +185,10 @@ struct NMSymbol { } static bool compareSymbolAddress(const NMSymbol &A, const NMSymbol &B) { + if (A.TypeChar == 'U' && B.TypeChar != 'U') + return true; + if (A.TypeChar != 'U' && B.TypeChar == 'U') + return false; if (A.Address < B.Address) return true; if (A.Address == B.Address && A.Name < B.Name) |