[llvm] r193932 - Convert another use of getSymbolNMTypeChar.
Rafael Espindola
rafael.espindola at gmail.com
Sat Nov 2 13:10:08 PDT 2013
Author: rafael
Date: Sat Nov 2 15:10:07 2013
New Revision: 193932
URL: http://llvm.org/viewvc/llvm-project?rev=193932&view=rev
Log:
Convert another use of getSymbolNMTypeChar.
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=193932&r1=193931&r2=193932&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Sat Nov 2 15:10:07 2013
@@ -149,12 +149,16 @@ error_code COFFObjectFile::getSymbolType
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;
More information about the llvm-commits
mailing list