[PATCH] D142846: [JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend

Kshitij Jain via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 09:30:25 PST 2023


jain98 created this revision.
jain98 added a reviewer: lhames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
jain98 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.

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

code, when possible.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142846

Files:
  llvm/include/llvm/ExecutionEngine/JITLink/i386.h
  llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp
  llvm/lib/ExecutionEngine/JITLink/i386.cpp
  llvm/test/ExecutionEngine/JITLink/i386/ELF_i386_small_pic_relocations.s
  llvm/test/ExecutionEngine/JITLink/i386/ELF_i386_small_pic_relocations_got.s
  llvm/test/ExecutionEngine/JITLink/i386/ELF_i386_small_pic_relocations_plt.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142846.493106.patch
Type: text/x-patch
Size: 15012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230129/abd264cd/attachment.bin>


More information about the llvm-commits mailing list