1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

COFF: Assign the correct symbol type to internal functions.

The COFFSymbolRef::isFunctionDefinition() function tests for several conditions
that are not related to whether a symbol is a function, but rather whether
the symbol meets the requirements for a function definition auxiliary record,
which excludes certain symbols such as internal functions and undefined
references. The test we need to determine the symbol type is much simpler:
we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION.

llvm-svn: 244195
This commit is contained in:
Peter Collingbourne 2015-08-06 05:26:35 +00:00
parent 595690977b
commit 523abeacd5
3 changed files with 5 additions and 2 deletions

View File

@ -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())

Binary file not shown.

View File

@ -0,0 +1,3 @@
RUN: llvm-objdump -d %p/Inputs/internal.exe.coff-x86_64 | FileCheck %s
CHECK: callq {{.*}} <foo>