This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Always move JTs in jump-table=move
ClosedPublic

Authored by rafauler on Nov 3 2022, 1:54 PM.

Details

Reviewers
Amir
maksfb
Group Reviewers
Restricted Project
Commits
rG369899449226: [BOLT] Always move JTs in jump-table=move
Summary

We should always move jump tables when requested. Previously,
we were not moving jump tables of non-simple functions in relocation
mode. That caused a bug detailed in the attached test case: in PIC
jump tables, we force jump tables to be moved, but if they are not
moved because the function is not simple, we could incorrectly update
original entries in .rodata, corrupting it under special circumstances
(see testcase).

Diff Detail

Event Timeline

rafauler created this revision.Nov 3 2022, 1:54 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rafauler requested review of this revision.Nov 3 2022, 1:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 1:54 PM
rafauler edited the summary of this revision. (Show Details)Nov 3 2022, 1:57 PM
rafauler updated this revision to Diff 473047.Nov 3 2022, 3:00 PM

Move the test outside of runtime folder, make it do not depends on running a binary to check correctness. Add linkerscript to enforce binary layout.

maksfb accepted this revision.Nov 3 2022, 4:48 PM

LGTM

This revision is now accepted and ready to land.Nov 3 2022, 4:48 PM
This revision was automatically updated to reflect the committed changes.