8 Commits

Author SHA1 Message Date
Lang Hames
026fb04875 [JITLink] Replace isInRangeForImm* functions with isInt / isUInt equivalents.
Avoids some code duplication.
2023-07-16 10:07:48 -07:00
Kshitij Jain
cd9fd4255b [JITLink] Adds support for PLT based relocations to the ELF/i386 JITLink backend
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.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D142846
2023-01-30 01:15:34 +00:00
Kshitij Jain
1b123d9fb5 Adds support for GOT relocations to i386/ELF backend
This CR adds support for GOT relocations to the JITLink i386/ELF backend.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D140279
2022-12-25 02:06:24 +00:00
Kshitij Jain
2a3b257a93 [JITLink][i386] Adds absolute and pc relative relocation support for ELF/i386.
This commit adds support for 32 bit absolute and pc relative relocations in
ELF/i386 objects, along with simple regression tests.

Reviewed By: sgraenitz, lhames

Differential Revision: https://reviews.llvm.org/D135523
2022-10-30 17:35:41 -07:00
Kazu Hirata
ce377df57e Ensure newlines at the end of files (NFC) 2022-08-20 21:18:23 -07:00
Kshitij Jain
29fe204b4e Re-apply "[JITLink] Introduce ELF/i386 backend " with correct authorship.
I (lhames) accidentally pushed 5f300397c6ae8fa7ca3547ec2b7a3cd844f3ed59 on
Kshitij Jain's behalf without updating the patch author first (my apologies
Kshitij!).

Re-applying with correct authorship.

https://reviews.llvm.org/D131347
2022-08-15 18:44:43 -07:00
Lang Hames
73600b7c8a Revert "[JITLink] Introduce ELF/i386 backend support for JITLink."
This reverts commit 5f300397c6ae8fa7ca3547ec2b7a3cd844f3ed59.

No functional issues, I just failed to correctly set authorship on the patch.
2022-08-15 18:44:43 -07:00
Lang Hames
5f300397c6 [JITLink] Introduce ELF/i386 backend support for JITLink.
This initial ELF/i386 JITLink backend enables JIT-linking of minimal ELF i386
object files. No relocations are supported yet.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D131347
2022-08-15 18:35:51 -07:00