This is an archive of the discontinued LLVM Phabricator instance.

[JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend
ClosedPublic

Authored by jain98 on Jan 29 2023, 9:30 AM.

Details

Summary

This commit adds support for PLT based relocations. Specifically -

  1. It adds logic to create a PLTTableManager in the buildTables_ELF_i386

function, which is called as part of the post-prune JITLink passes. The PLTTableManager
handles creating pointer jump stubs and related GOT entries for position independent
code.

  1. It also adds a pre-fixup pass to optimize away PLT based calls in position independent

code, when possible.

Diff Detail

Event Timeline

jain98 created this revision.Jan 29 2023, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2023, 9:30 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
jain98 requested review of this revision.Jan 29 2023, 9:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2023, 9:30 AM
lhames accepted this revision.Jan 29 2023, 2:44 PM

Looks great! Thanks very much @jain98!

This revision is now accepted and ready to land.Jan 29 2023, 2:44 PM
This revision was landed with ongoing or failed builds.Jan 29 2023, 5:16 PM
This revision was automatically updated to reflect the committed changes.