This is an archive of the discontinued LLVM Phabricator instance.

Do not emit a named symbol to denote the start of the __debug_frame section
ClosedPublic

Authored by rastogishubham on Jun 21 2023, 4:53 PM.

Details

Summary

When emitting a debug_frame section, we can see that it contains a named symbol.

echo "void foo(void) {}" | clang -arch arm64  -ffreestanding -g -c -o /tmp/test.o -x c - 
nm /tmp/test.o -s __DWARF __debug_frame
0000000000000200 s ltmp1

There are no such symbols emitted in any of the other DWARF sections, this is because when the __debug_frame section is created, it doesn't get a BeginSymName and so it creates a named symbol, such as ltmp1 and emits it when we switch to the section in MCDwarf.cpp

This patch fixes the above issue

Diff Detail

Event Timeline

rastogishubham created this revision.Jun 21 2023, 4:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 4:53 PM
rastogishubham requested review of this revision.Jun 21 2023, 4:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 4:53 PM
JDevlieghere accepted this revision.Jun 23 2023, 2:32 PM
JDevlieghere added a subscriber: JDevlieghere.

LGTM

llvm/test/DebugInfo/debug_frame_symbol.ll
32

Nit: you could trim this path a little.

This revision is now accepted and ready to land.Jun 23 2023, 2:32 PM
rastogishubham marked an inline comment as done.

Trimmed down directory path

This revision was landed with ongoing or failed builds.Jun 26 2023, 11:43 AM
This revision was automatically updated to reflect the committed changes.

Added REQUIRES line to make test pass on bots that do not have the arm backend enabled