This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Add compatibility check for PPC PLT stubs
ClosedPublic

Authored by NeHuang on Aug 6 2020, 11:39 AM.

Details

Summary

Compatibility checking for PPC64PltCallStub and PPC64PCRelPLTStub are needed to avoid incompatible thunk/stub re-using.

Diff Detail

Event Timeline

NeHuang created this revision.Aug 6 2020, 11:39 AM
NeHuang requested review of this revision.Aug 6 2020, 11:39 AM
NeHuang added a reviewer: hfinkel.
NeHuang updated this revision to Diff 283713.Aug 6 2020, 1:14 PM

Fixed nits in the test case to

  • Add start address.
  • Fix indentations.
stefanp accepted this revision.Aug 6 2020, 5:01 PM

I think this looks good! Thank you for fixing this issue.

This revision is now accepted and ready to land.Aug 6 2020, 5:01 PM
sfertile accepted this revision.Aug 6 2020, 6:31 PM

LGTM.

lld/ELF/Thunks.cpp
872

Would it be better to explicitly check for R_PPC64_REL24 and R_PPC64_REL14?

NeHuang updated this revision to Diff 283885.Aug 7 2020, 5:57 AM

Addressed the comment to check R_PPC64_REL24 and R_PPC64_REL14 for PPC64PltCallStub compatibility check.

NeHuang marked an inline comment as done.Aug 7 2020, 5:58 AM
NeHuang added inline comments.
lld/ELF/Thunks.cpp
872

Good catch! Updated.

This revision was automatically updated to reflect the committed changes.
NeHuang marked an inline comment as done.