Skip to content

Static trampolines should be embedded in libffi.so itself, not in temporary file #633

@dcolascione

Description

@dcolascione

In current master, the static trampoline code tries to create a temporary file, fill it with trampoline instructions, then map it into the caller's address space. This approach isn't ideal: it mutates external state (in creating the temporary file) and it requires that a file descriptor be free.

Why not instead just generate the trampoline code in the text section of libffi itself, then remap that text section of libffi itself in multiple places? On Linux, you can even perform this remapping without making a file descriptor by using mremap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions