Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-58575] SubstrateVM PLT/GOT Feature #9883

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

graalvmbot
Copy link
Collaborator

Introduces an additional level of indirection for calls where a GOT (Global Offset Table) is an array of method pointers and PLT (Procedure Linkage Table) is a collection of small stubs. With this feature enabled, direct calls are emitted as indirect calls through the GOT. The virtual table is filled with PLT stubs instead.

While inspired by ELF, no ELF mechanisms are used in the implementation.

Example usecase: Hijack code execution on call boundaries to diverge execution from AOT code to an interpreter.

Contributors:

  • Aleksandar Gradinac: Initial implementation on linux-amd64.
  • Marko Spasic: Miscellaneous improvements.
  • Bernhard Urban-Forster: Support for linux-aarch64, darwin-aarch64 and darwin-amd64.
  • Alfonso² Peterssen: Support for windows-amd64.

Co-authored-by: Aleksandar Gradinac [email protected]
Co-authored-by: Marko Spasic [email protected]
Co-authored-by: Alfonso² Peterssen [email protected]

Introduces an additional level of indirection for calls where a GOT (Global Offset Table) is an array of method pointers and PLT (Procedure Linkage Table) is a collection of small stubs.  With this feature enabled, direct calls are emitted as indirect calls through the GOT. The virtual table is filled with PLT stubs instead.

While inspired by ELF, no ELF mechanisms are used in the implementation.

Example usecase: Hijack code execution on call boundaries to diverge execution from AOT code to an interpreter.

Contributors:
- Aleksandar Gradinac: Initial implementation on linux-amd64.
- Marko Spasic: Miscellaneous improvements.
- Bernhard Urban-Forster: Support for linux-aarch64, darwin-aarch64 and darwin-amd64.
- Alfonso² Peterssen: Support for windows-amd64.

Co-authored-by: Aleksandar Gradinac <[email protected]>
Co-authored-by: Marko Spasic <[email protected]>
Co-authored-by: Alfonso² Peterssen <[email protected]>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 15, 2024
@zakkak
Copy link
Collaborator

zakkak commented Oct 18, 2024

Hello, I have some questions regarding this feature.

  1. How does this added indirection impact the performance of direct calls? Do you have any evaluation results you could share?
  2. Does it apply unconditionally to all calls?

FYI @galderz @franz1981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants