This is an archive of the discontinued LLVM Phabricator instance.

[PPC64LE] write plt stubs for V2 abi.
ClosedPublic

Authored by sfertile on Mar 23 2018, 3:36 PM.

Details

Summary

Adds the 'default' version of the plt stub for the V2 abi.

While all the instructions for this are correct, we are getting the wrong offset due to differences between power and the other architectures. lld puts the relocation for the function address into the .got.plt section, and the writePlt function gets passed the Offset within this section rather then the offset from the got which is what we would expect. The fix for this will be delivered in a subsequent patch.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sfertile created this revision.Mar 23 2018, 3:36 PM
sfertile updated this revision to Diff 139796.Mar 26 2018, 8:37 AM

Updated path to remove the comment about why the offsets were different then I expected. It turns out that the weird offset is due to a few separate issues (ppc uses the sections differently, the sections are laid out in a different order, and that PPC64 target doesn't properly set the PltGot header size). The offsets will change as we fix those issues separately.

ruiu accepted this revision.Mar 27 2018, 10:26 AM

LGTM

ELF/Arch/PPC64.cpp
177

Don't you think it's time to remove code for v1 API? It looks like we are doubling the size of the code unless we remove code for v1.

This revision is now accepted and ready to land.Mar 27 2018, 10:26 AM
sfertile added inline comments.Mar 27 2018, 11:53 AM
ELF/Arch/PPC64.cpp
177

Yes, I have a couple patches waiting to upload, and I think we are probably ready to switch over (almost) all of the remaining tests to work with the V2 abi.

ruiu added a comment.Mar 27 2018, 1:58 PM

That's good to know. Feel free to submit.

This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.