summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/llvm/Object/COFF.h2
-rw-r--r--include/llvm/Support/COFF.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h
index 6bf059b9ea..8c292164e9 100644
--- a/include/llvm/Object/COFF.h
+++ b/include/llvm/Object/COFF.h
@@ -193,7 +193,7 @@ struct coff_symbol {
} Name;
support::ulittle32_t Value;
- support::little16_t SectionNumber;
+ support::ulittle16_t SectionNumber;
support::ulittle16_t Type;
diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h
index 7e796ed092..c408e82810 100644
--- a/include/llvm/Support/COFF.h
+++ b/include/llvm/Support/COFF.h
@@ -138,8 +138,8 @@ namespace COFF {
};
enum SymbolSectionNumber {
- IMAGE_SYM_DEBUG = -2,
- IMAGE_SYM_ABSOLUTE = -1,
+ IMAGE_SYM_DEBUG = 0xFFFE,
+ IMAGE_SYM_ABSOLUTE = 0xFFFF,
IMAGE_SYM_UNDEFINED = 0
};