This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][DWARF] Fix for .debug_line with DWARF5
ClosedPublic

Authored by ayermolo on Jul 5 2023, 2:05 PM.

Details

Summary

There was a bug in a code that pre-populated line string for a case where parts
of .debug_line are not processed by BOLT, but copied as raw data. We were not
switching sections. This resulted in parts of the binary being over-written with
debug data.

Diff Detail

Event Timeline

ayermolo created this revision.Jul 5 2023, 2:05 PM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo requested review of this revision.Jul 5 2023, 2:05 PM
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo updated this revision to Diff 537491.Jul 5 2023, 2:07 PM

removed unused argument

ayermolo updated this revision to Diff 537515.Jul 5 2023, 2:56 PM

removed include

ayermolo updated this revision to Diff 537520.Jul 5 2023, 3:01 PM

removed offsets from test

maksfb added inline comments.Jul 5 2023, 3:20 PM
bolt/lib/Core/DebugData.cpp
1676–1678

The returned offset has to match the input Offset, right? Add a check.

llvm/include/llvm/MC/MCDwarf.h
74

Add documentation for the return value.

ayermolo updated this revision to Diff 537537.Jul 5 2023, 4:06 PM

addressed comments

ayermolo marked 2 inline comments as done.Jul 5 2023, 4:07 PM
maksfb accepted this revision.Jul 5 2023, 6:11 PM

LGTM with a couple of nits addressed.

bolt/lib/Core/DebugData.cpp
1669

nit:

1676–1678

nit:

This revision is now accepted and ready to land.Jul 5 2023, 6:11 PM
ayermolo updated this revision to Diff 537563.Jul 5 2023, 7:20 PM

addressed ntis

This revision was automatically updated to reflect the committed changes.