mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-24 15:12:36 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
da5300489f
commit
f4fa49e750
@ -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())
|
||||
|
BIN
test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64
Executable file
BIN
test/tools/llvm-objdump/X86/Inputs/internal.exe.coff-x86_64
Executable file
Binary file not shown.
3
test/tools/llvm-objdump/X86/coff-dis-internal.test
Normal file
3
test/tools/llvm-objdump/X86/coff-dis-internal.test
Normal file
@ -0,0 +1,3 @@
|
||||
RUN: llvm-objdump -d %p/Inputs/internal.exe.coff-x86_64 | FileCheck %s
|
||||
|
||||
CHECK: callq {{.*}} <foo>
|
Loading…
x
Reference in New Issue
Block a user