aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-02 18:07:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-02 18:07:48 +0000
commit1b6c8d1f6c834d8c3de4f78a4c99f8800f581b73 (patch)
tree4fbb135b89d3bbd5a328974d46ebfdf5a7c42a54
parent7e56fc6ae19e353ebdfaf327b46121b519a0c264 (diff)
downloadexternal_llvm-1b6c8d1f6c834d8c3de4f78a4c99f8800f581b73.zip
external_llvm-1b6c8d1f6c834d8c3de4f78a4c99f8800f581b73.tar.gz
external_llvm-1b6c8d1f6c834d8c3de4f78a4c99f8800f581b73.tar.bz2
Avoid some getSymbolNMTypeChar uses in COFFObjectFile.cpp itself.
This is a fixed version of 193928 which keeps these uses in sync. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193931 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Object/COFFObjectFile.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index 3d1e62e..860d812 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/lib/Object/COFFObjectFile.cpp
@@ -112,10 +112,8 @@ error_code COFFObjectFile::getSymbolFileOffset(DataRefImpl Symb,
const coff_section *Section = NULL;
if (error_code ec = getSection(symb->SectionNumber, Section))
return ec;
- char Type;
- if (error_code ec = getSymbolNMTypeChar(Symb, Type))
- return ec;
- if (Type == 'U' || Type == 'w')
+
+ if (symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED)
Result = UnknownAddressOrSize;
else if (Section)
Result = Section->PointerToRawData + symb->Value;
@@ -130,10 +128,8 @@ error_code COFFObjectFile::getSymbolAddress(DataRefImpl Symb,
const coff_section *Section = NULL;
if (error_code ec = getSection(symb->SectionNumber, Section))
return ec;
- char Type;
- if (error_code ec = getSymbolNMTypeChar(Symb, Type))
- return ec;
- if (Type == 'U' || Type == 'w')
+
+ if (symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED)
Result = UnknownAddressOrSize;
else if (Section)
Result = Section->VirtualAddress + symb->Value;
@@ -197,10 +193,8 @@ error_code COFFObjectFile::getSymbolSize(DataRefImpl Symb,
const coff_section *Section = NULL;
if (error_code ec = getSection(symb->SectionNumber, Section))
return ec;
- char Type;
- if (error_code ec = getSymbolNMTypeChar(Symb, Type))
- return ec;
- if (Type == 'U' || Type == 'w')
+
+ if (symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED)
Result = UnknownAddressOrSize;
else if (Section)
Result = Section->SizeOfRawData - symb->Value;