Use the information provided by getFlags to unify some code in llvm-nm.
It is not clear how much we should try to expose in getFlags. For example, should there be a SF_Object and a SF_Text? But for information that is already being exposed, we may as well use it in llvm-nm. llvm-svn: 200820
This commit is contained in:
@@ -161,9 +161,13 @@ uint32_t COFFObjectFile::getSymbolFlags(DataRefImpl Ref) const {
|
||||
|
||||
// TODO: Correctly set SF_FormatSpecific, SF_Common
|
||||
|
||||
if (Symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL &&
|
||||
Symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED)
|
||||
Result |= SymbolRef::SF_Undefined;
|
||||
if (Symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED) {
|
||||
if (Symb->Value == 0)
|
||||
Result |= SymbolRef::SF_Undefined;
|
||||
else
|
||||
Result |= SymbolRef::SF_Common;
|
||||
}
|
||||
|
||||
|
||||
// TODO: This are certainly too restrictive.
|
||||
if (Symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL)
|
||||
|
||||
Reference in New Issue
Block a user