Page MenuHomePhabricator

[LLD][ELF][ARM] Add test case that will fail if toPlt() is removed [NFC]
ClosedPublic

Authored by peter.smith on Feb 5 2019, 3:35 AM.

Details

Summary

When a thunk is created to a PLT entry, the call to the thunk is converted to a non-plt expression with fromPlt(). If the thunk becomes unusable we retarget the relocation back to its original target and try again. When we do this we need to make sure that we restore the PLT form of the expression with toPlt().

This change adds a test case that will fail if toPlt() is removed. We need to have a call to a preemptible symbol defined within the link unit. If toPlt() is removed then the relocation to the thunk to the PLT entry for the preemptible symbol will be retargeted to the preemptible symbol itself instead of its PLT entry.

This test was suggested in D57371, as without this test toPlt() can be removed and no test will fail.

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Feb 5 2019, 3:35 AM
ruiu accepted this revision.Feb 5 2019, 5:47 PM

LGTM

This revision is now accepted and ready to land.Feb 5 2019, 5:47 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2019, 2:03 AM