This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Reintroduce allow-stripped
ClosedPublic

Authored by Amir on Jan 26 2023, 9:17 PM.

Details

Summary

Reject stripped binaries as a policy.

The core issue with stripped binaries is that we can't detect the presence
of split functions which require extra handling. Therefore BOLT can't ensure
functional correctness of produced binary if the input stripped binary contains
split functions. Supporting such cases is an interesting problem but it goes
against BOLT's intended goal of achieving peak program performance.

Diff Detail

Event Timeline

Amir created this revision.Jan 26 2023, 9:17 PM
Herald added a project: Restricted Project. · View Herald Transcript
Amir requested review of this revision.Jan 26 2023, 9:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 9:17 PM
maksfb added inline comments.Jan 30 2023, 5:13 PM
bolt/lib/Rewrite/RewriteInstance.cpp
1670–1671

Since we are existing without generating the output, this should be an abnormal behavior and hence we should issue an error.

Amir updated this revision to Diff 494093.Feb 1 2023, 3:45 PM

Report error

Amir marked an inline comment as done.Feb 1 2023, 3:46 PM
maksfb added a comment.Feb 1 2023, 3:48 PM

Test case has to be updated as well.

bolt/lib/Rewrite/RewriteInstance.cpp
1671
bolt/test/X86/broken_dynsym.test
6
Amir updated this revision to Diff 494106.Feb 1 2023, 4:26 PM

Update tests

maksfb added inline comments.Feb 1 2023, 4:36 PM
bolt/lib/Rewrite/RewriteInstance.cpp
1671

nit: drop the trailing period in the message.

maksfb accepted this revision.Feb 3 2023, 5:09 PM
This revision is now accepted and ready to land.Feb 3 2023, 5:09 PM
This revision was automatically updated to reflect the committed changes.