From 30c8dc8c8210ac7b043f4f038858a2bfa1d0b151 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 2 Nov 2013 16:55:21 +0000 Subject: [PATCH] Don't use getSymbolNMTypeChar for implementing COFFObjectFile::getSymbolFileOffset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193928 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/COFFObjectFile.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 3d1e62e1e55..2952d44b21e 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 && symb->Value != 0) Result = UnknownAddressOrSize; else if (Section) Result = Section->PointerToRawData + symb->Value;