mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:50:30 +00:00
llvm-nm: Don't print mapping symbols.
This matches the behavior of gnu nm. Fixes pr23930. llvm-svn: 240695
This commit is contained in:
parent
c2ffa0891f
commit
b298fbcfdd
@ -394,6 +394,15 @@ uint32_t ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Symb) const {
|
||||
EIter == EF.begin_symbols() || EIter == EF.begin_dynamic_symbols())
|
||||
Result |= SymbolRef::SF_FormatSpecific;
|
||||
|
||||
if (EF.getHeader()->e_machine == ELF::EM_ARM) {
|
||||
if (ErrorOr<StringRef> NameOrErr = EF.getSymbolName(EIter)) {
|
||||
StringRef Name = *NameOrErr;
|
||||
if (Name.startswith("$d") || Name.startswith("$t") ||
|
||||
Name.startswith("$a"))
|
||||
Result |= SymbolRef::SF_FormatSpecific;
|
||||
}
|
||||
}
|
||||
|
||||
if (ESym->st_shndx == ELF::SHN_UNDEF)
|
||||
Result |= SymbolRef::SF_Undefined;
|
||||
|
||||
|
11
test/Object/ARM/nm-mapping-symbol.s
Normal file
11
test/Object/ARM/nm-mapping-symbol.s
Normal file
@ -0,0 +1,11 @@
|
||||
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7-pc-linux
|
||||
// RUN: llvm-readobj -t %t.o | FileCheck %s
|
||||
// RUN: llvm-nm %t.o | FileCheck -allow-empty --check-prefix=NM %s
|
||||
|
||||
// Test that nm doesn't print the mapping symbols
|
||||
|
||||
// CHECK: Name: $d.0
|
||||
// NM-NOT: $d.0
|
||||
|
||||
.section .foobar,"",%progbits
|
||||
.asciz "foo"
|
Loading…
Reference in New Issue
Block a user