diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index d110b9293ba..fa6aa4ced39 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -186,10 +186,10 @@ SymbolRef::Type COFFObjectFile::getSymbolType(DataRefImpl Ref) const { COFFSymbolRef Symb = getCOFFSymbol(Ref); int32_t SectionNumber = Symb.getSectionNumber(); + if (Symb.getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) + return SymbolRef::ST_Function; if (Symb.isAnyUndefined()) return SymbolRef::ST_Unknown; - if (Symb.isFunctionDefinition()) - return SymbolRef::ST_Function; if (Symb.isCommon()) return SymbolRef::ST_Data; if (Symb.isFileRecord()) diff --git a/test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64 b/test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64 new file mode 100755 index 00000000000..0c38deb7cf0 Binary files /dev/null and b/test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64 differ diff --git a/test/tools/llvm-objdump/X86/coff-dis-internal.test b/test/tools/llvm-objdump/X86/coff-dis-internal.test new file mode 100644 index 00000000000..530dadc8142 --- /dev/null +++ b/test/tools/llvm-objdump/X86/coff-dis-internal.test @@ -0,0 +1,3 @@ +RUN: llvm-objdump -d %p/Inputs/internal.exe.coff-x86_64 | FileCheck %s + +CHECK: callq {{.*}}