This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Make empty name symbols SF_FormatSpecific so that llvm-symbolizer ignores them for symbolization
ClosedPublic

Authored by MaskRay on Mar 15 2021, 4:35 PM.

Details

Summary

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

Diff Detail

Event Timeline

MaskRay created this revision.Mar 15 2021, 4:35 PM
MaskRay requested review of this revision.Mar 15 2021, 4:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 4:35 PM
jrtc27 added inline comments.Mar 15 2021, 4:39 PM
llvm/test/DebugInfo/Symbolize/ELF/riscv-empty-name-symbol.s
2

I think not :)

MaskRay updated this revision to Diff 330848.Mar 15 2021, 5:02 PM

Fix REQUIRES:

MaskRay marked an inline comment as done.Mar 15 2021, 5:02 PM

llvm-symbolizer test aspect of this looks good to me. Someone with RISCV experience should give the final thumbs up to the change though.

luismarques accepted this revision.Mar 16 2021, 1:37 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Mar 16 2021, 1:37 PM
MaskRay edited the summary of this revision. (Show Details)Mar 16 2021, 2:08 PM
MaskRay edited the summary of this revision. (Show Details)

In a related nm discussion, https://sourceware.org/bugzilla/show_bug.cgi?id=27584#c4 said whether .L should be suppressed from nm output.
Doing that may be useful for GCC riscv but we can do that as a follow-up.

This revision was landed with ongoing or failed builds.Mar 16 2021, 2:12 PM
This revision was automatically updated to reflect the committed changes.