This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Fix writing out unmarked .eh_frame section
ClosedPublic

Authored by maksfb on Oct 4 2022, 4:04 PM.

Details

Summary

When BOLT updates .eh_frame section, it concatenates newly-generated
contents (from CFI directives) with the original .eh_frame that has
relocations applied to it. However, if no new content is generated,
the original .eh_frame has to be left intact. In that case, BOLT was
still writing out the relocatable copy of the original .eh_frame section
to the new segment, even though this copy was never used and was not
even marked in the section header table.

Detect the scenario above and skip allocating extra space for .eh_frame.

Diff Detail

Event Timeline

maksfb created this revision.Oct 4 2022, 4:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 4:04 PM
Herald added a subscriber: treapster. · View Herald Transcript
maksfb requested review of this revision.Oct 4 2022, 4:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 4:04 PM
rafauler accepted this revision.Oct 5 2022, 4:14 PM

LGTM

This revision is now accepted and ready to land.Oct 5 2022, 4:14 PM
This revision was automatically updated to reflect the committed changes.