mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-26 20:57:15 +00:00
Convert another use of getSymbolNMTypeChar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1b6c8d1f6c
commit
66b8ec520f
@ -149,12 +149,16 @@ error_code COFFObjectFile::getSymbolType(DataRefImpl Symb,
|
||||
if (symb->getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
|
||||
Result = SymbolRef::ST_Function;
|
||||
} else {
|
||||
char Type;
|
||||
if (error_code ec = getSymbolNMTypeChar(Symb, Type))
|
||||
return ec;
|
||||
if (Type == 'r' || Type == 'R') {
|
||||
Result = SymbolRef::ST_Data;
|
||||
uint32_t Characteristics = 0;
|
||||
if (symb->SectionNumber > 0) {
|
||||
const coff_section *Section = NULL;
|
||||
if (error_code ec = getSection(symb->SectionNumber, Section))
|
||||
return ec;
|
||||
Characteristics = Section->Characteristics;
|
||||
}
|
||||
if (Characteristics & COFF::IMAGE_SCN_MEM_READ &&
|
||||
~Characteristics & COFF::IMAGE_SCN_MEM_WRITE) // Read only.
|
||||
Result = SymbolRef::ST_Data;
|
||||
}
|
||||
}
|
||||
return object_error::success;
|
||||
|
Loading…
x
Reference in New Issue
Block a user