forked from OSchip/llvm-project
[llvm-nm] Generalize symbol types 'N', 'n' and '?'
llvm-svn: 359312
This commit is contained in:
parent
0bf06a8f59
commit
5f184f1780
|
@ -944,22 +944,18 @@ static char getSymbolNMTypeChar(ELFObjectFileBase &Obj,
|
|||
return 't';
|
||||
if (Flags & ELF::SHF_ALLOC)
|
||||
return Flags & ELF::SHF_WRITE ? 'd' : 'r';
|
||||
}
|
||||
|
||||
if (SymI->getELFType() == ELF::STT_SECTION) {
|
||||
Expected<StringRef> Name = SymI->getName();
|
||||
if (!Name) {
|
||||
consumeError(Name.takeError());
|
||||
return '?';
|
||||
}
|
||||
return StringSwitch<char>(*Name)
|
||||
.StartsWith(".debug", 'N')
|
||||
.StartsWith(".note", 'n')
|
||||
.StartsWith(".comment", 'n')
|
||||
.Default('?');
|
||||
if (Name->startswith(".debug"))
|
||||
return 'N';
|
||||
if (!(Flags & ELF::SHF_WRITE))
|
||||
return 'n';
|
||||
}
|
||||
|
||||
return 'n';
|
||||
return '?';
|
||||
}
|
||||
|
||||
static char getSymbolNMTypeChar(COFFObjectFile &Obj, symbol_iterator I) {
|
||||
|
|
Loading…
Reference in New Issue