[PATCH] D96617: DebugInfo/Symbolize: Exclude ARM mapping symbols for .symtab symbolization after D95916
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 11:04:42 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa7ceef9254ad: DebugInfo/Symbolize: Exclude ARM mapping symbols for .symtab symbolization… (authored by MaskRay).
Changed prior to commit:
https://reviews.llvm.org/D96617?vs=323394&id=323405#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96617/new/
https://reviews.llvm.org/D96617
Files:
llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
llvm/test/DebugInfo/Symbolize/ELF/arm-mapping-symbol.s
Index: llvm/test/DebugInfo/Symbolize/ELF/arm-mapping-symbol.s
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/Symbolize/ELF/arm-mapping-symbol.s
@@ -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
Index: llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
===================================================================
--- llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
+++ llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
@@ -174,6 +174,11 @@
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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96617.323405.patch
Type: text/x-patch
Size: 1521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210212/edcc977f/attachment.bin>
More information about the llvm-commits
mailing list