1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

DebugInfo/Symbolize: Exclude ARM mapping symbols for .symtab symbolization after D95916

Their names don't convey much information, so they should be excluded.
The behavior matches addr2line.

Differential Revision: https://reviews.llvm.org/D96617
This commit is contained in:
Fangrui Song 2021-02-12 11:04:20 -08:00
parent 2571f5980f
commit 1fad034c68
2 changed files with 24 additions and 0 deletions

View File

@ -174,6 +174,11 @@ Error SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol,
if (Type != ELF::STT_NOTYPE && Type != ELF::STT_FUNC &&
Type != ELF::STT_OBJECT && Type != ELF::STT_GNU_IFUNC)
return Error::success();
// Some STT_NOTYPE symbols are not desired. This excludes STT_SECTION and
// ARM mapping symbols.
uint32_t Flags = cantFail(Symbol.getFlags());
if (Flags & SymbolRef::SF_FormatSpecific)
return Error::success();
} else if (SymbolType != SymbolRef::ST_Function &&
SymbolType != SymbolRef::ST_Data) {
return Error::success();

View File

@ -0,0 +1,19 @@
# REQUIRES: arm-registered-target
## Ignore ARM mapping symbols (with a prefix of $a, $d or $t).
# RUN: llvm-mc -filetype=obj -triple=armv7-none-linux %s -o %t
# RUN: llvm-symbolizer --obj=%t 4 8 | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=thumbv7-none-linux %s -o %tthumb
# RUN: llvm-symbolizer --obj=%tthumb 4 8 | FileCheck %s
# CHECK: foo
# CHECK-NEXT: ??:0:0
# CHECK-EMPTY:
# CHECK-NEXT: foo
# CHECK-NEXT: ??:0:0
.globl foo
foo:
.word 32
nop
.word 32