[llvm] r359312 - [llvm-nm] Generalize symbol types 'N', 'n' and '?'
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 26 09:03:32 PDT 2019
Author: maskray
Date: Fri Apr 26 09:03:31 2019
New Revision: 359312
URL: http://llvm.org/viewvc/llvm-project?rev=359312&view=rev
Log:
[llvm-nm] Generalize symbol types 'N', 'n' and '?'
Modified:
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=359312&r1=359311&r2=359312&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Fri Apr 26 09:03:31 2019
@@ -944,22 +944,18 @@ static char getSymbolNMTypeChar(ELFObjec
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) {
More information about the llvm-commits
mailing list