summaryrefslogtreecommitdiff
path: root/tools/llvm-nm
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-03-15 00:04:08 +0000
committerRui Ueyama <ruiu@google.com>2014-03-15 00:04:08 +0000
commit7aa478d944709293c96d33020891e9b725d03f73 (patch)
treeecd55dfc606e62f119e7b26228ccfc782096dd84 /tools/llvm-nm
parent1d8c02bef375fa43a4f51ee8e4c086c40d4ea072 (diff)
downloadllvm-7aa478d944709293c96d33020891e9b725d03f73.tar.gz
llvm-7aa478d944709293c96d33020891e9b725d03f73.tar.bz2
llvm-7aa478d944709293c96d33020891e9b725d03f73.tar.xz
Object/COFF: change data type of SymbolNumber from int16 to uint16.
Microsoft PE/COFF Spec clearly states that the field is of signed interger type. However, in reality, it's unsigned. If cl.exe needs to create a large number of sections for COMDAT sections, it will just create more than 32768 sections. Handling large section number as negative number is not correct. I think this is a spec bug. Differential Revision: http://llvm-reviews.chandlerc.com/D3088 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r--tools/llvm-nm/llvm-nm.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index 70c789f328..88603d4575 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -317,7 +317,9 @@ static char getSymbolNMTypeChar(COFFObjectFile &Obj, symbol_iterator I) {
return Ret;
uint32_t Characteristics = 0;
- if (Symb->SectionNumber > 0) {
+ if (Symb->SectionNumber > 0 &&
+ Symb->SectionNumber != llvm::COFF::IMAGE_SYM_DEBUG &&
+ Symb->SectionNumber != llvm::COFF::IMAGE_SYM_ABSOLUTE) {
section_iterator SecI = Obj.section_end();
if (error(SymI->getSection(SecI)))
return '?';