summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-18 19:31:59 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-18 19:31:59 +0000
commit5e3a082c797f0214d44858b05a13543872dfd413 (patch)
treebea812217c9676ce4a9201dd13d917e6ca443976
parent8c39c9647da4f375e4f89bd417d86f5c3ff6dfa5 (diff)
downloadllvm-5e3a082c797f0214d44858b05a13543872dfd413.tar.gz
llvm-5e3a082c797f0214d44858b05a13543872dfd413.tar.bz2
llvm-5e3a082c797f0214d44858b05a13543872dfd413.tar.xz
Object/COFF: Change type from a struct to a uint16_t. The struct would be
incorrect for bigendian systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142403 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Object/COFF.h13
-rw-r--r--lib/Object/COFFObjectFile.cpp2
2 files changed, 10 insertions, 5 deletions
diff --git a/include/llvm/Object/COFF.h b/include/llvm/Object/COFF.h
index db05c98aaf..1f577c7433 100644
--- a/include/llvm/Object/COFF.h
+++ b/include/llvm/Object/COFF.h
@@ -45,13 +45,18 @@ struct coff_symbol {
support::ulittle32_t Value;
support::little16_t SectionNumber;
- struct {
- support::ulittle8_t BaseType;
- support::ulittle8_t ComplexType;
- } Type;
+ support::ulittle16_t Type;
support::ulittle8_t StorageClass;
support::ulittle8_t NumberOfAuxSymbols;
+
+ uint8_t getBaseType() const {
+ return Type & 0x0F;
+ }
+
+ uint8_t getComplexType() const {
+ return (Type & 0xF0) >> 4;
+ }
};
struct coff_section {
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index 13356520d7..e52a31f67f 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/lib/Object/COFFObjectFile.cpp
@@ -147,7 +147,7 @@ error_code COFFObjectFile::getSymbolType(DataRefImpl Symb,
symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED) {
Result = SymbolRef::ST_External;
} else {
- if (symb->Type.ComplexType == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
+ if (symb->getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
Result = SymbolRef::ST_Function;
} else {
char Type;