1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test/DebugInfo/Symbolize/ELF/riscv-empty-name-symbol.s
Fangrui Song 73df85ab79 [RISCV] Make empty name symbols SF_FormatSpecific so that llvm-symbolizer ignores them for symbolization
On RISC-V, clang emits empty name symbols used for label differences. (In GCC the symbols are typically `.L0`)
After D95916, the empty name symbols can show up in llvm-symbolizer's symbolization output.
They have no names and thus not useful. Set `SF_FormatSpecific` so that llvm-symbolizer will ignore them.

`SF_FormatSpecific` is also used in LTO but that case should not matter.

Corresponding addr2line problem: https://sourceware.org/bugzilla/show_bug.cgi?id=27585

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D98669
2021-03-16 14:12:18 -07:00

27 lines
633 B
ArmAsm

# REQUIRES: riscv-registered-target
## Ignore empty name symbols.
# RUN: llvm-mc -filetype=obj -triple=riscv64 %s -o %t
# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYM
# SYM: 0000000000000004 0 NOTYPE LOCAL DEFAULT [[#]] {{$}}
# SYM: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [[#]] foo
## Make sure we test at an address larger than or equal to an empty name symbol.
# RUN: llvm-symbolizer --obj=%t 0 4 | FileCheck %s
# CHECK: foo
# CHECK-NEXT: ??:0:0
# CHECK-EMPTY:
# CHECK-NEXT: foo
# CHECK-NEXT: ??:0:0
.globl foo
foo:
nop
.file 1 "/tmp" "a.s"
.loc 1 1 0
nop
.section .debug_line,"",@progbits