Bug 27585 - addr2line riscv: Skip empty name symbols?
Summary: addr2line riscv: Skip empty name symbols?
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-16 06:10 UTC by Fangrui Song
Modified: 2021-04-15 02:45 UTC (History)
1 user (show)

See Also:
Host:
Target: riscv*-*-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2021-03-16 06:10:20 UTC
Extracted from https://reviews.llvm.org/D95916#2627640 This may be related to PR27584.

echo 'void _start() {}' > a.c
# Make sure riscv64-linux-gnu-bfd is in PATH.
clang --target=riscv64-linux-gnu -fuse-ld=bfd -nostdlib -fasynchronous-unwind-tables a.c
~/Dev/binutils-gdb/out/riscv64/binutils/addr2line -fe a.out $(nm a.out | awk '/ _start/{printf "%#x",strtonum("0x"$1)+4}')

??
a.c:?

'??' is less useful. addr2line probably should return '_start' instead.
arm addr2line has logic ignoring $a/$d/$t.

In the absence of DWARF line number information, addr2line uses .symtab to do symbolization. clang -fasynchronous-unwind-tables causes empty name symbols for label differences. This should be reproduceable with GCC .L0 symbols as well.
Comment 1 Nelson Chu 2021-04-15 02:45:52 UTC
The fixed in PR27584 doesn't affect the PR27585.  The addr2line may be another problem and need to find another way to fix.