This is an archive of the discontinued LLVM Phabricator instance.

[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