OSDN Git Service

Fix llvm-symbolizer to correctly sort a symbol array and calculate symbol sizes
authorKuba Brecka <kuba.brecka@gmail.com>
Tue, 15 Nov 2016 21:07:03 +0000 (21:07 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Tue, 15 Nov 2016 21:07:03 +0000 (21:07 +0000)
commit4a7eeb405242daee16f0d71c2fc56ba344d13a3c
tree8f640ddc86685c180e0eab070d6798c3b05eae59
parent7e53cdde40939c2f6669a3215e1574455b978f42
Fix llvm-symbolizer to correctly sort a symbol array and calculate symbol sizes

Sometimes, llvm-symbolizer gives wrong results due to incorrect sizes of some symbols. The reason for that was an incorrectly sorted array in computeSymbolSizes. The comparison function used subtraction of unsigned types, which is incorrect. Let's change this to return explicit -1 or 1.

Differential Revision: https://reviews.llvm.org/D26537

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287028 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/SymbolSize.h
lib/Object/SymbolSize.cpp
unittests/CMakeLists.txt
unittests/Object/CMakeLists.txt [new file with mode: 0644]
unittests/Object/SymbolSizeTest.cpp [new file with mode: 0644]