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

libbpf: Extend linker API to support in-memory ELF files #4779

Closed

Conversation

kernel-patches-daemon-bpf-rc[bot]
Copy link

Pull request for series with
subject: libbpf: Extend linker API to support in-memory ELF files
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=916884

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 6e8ba49
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916884
version: 3

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: b9fee10
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=916884
version: 3

ajor added 2 commits December 12, 2024 08:38
Move the filename arguments and file-descriptor handling from
init_output_elf() and linker_load_obj_file() and instead handle them
at the top-level in bpf_linker__new() and bpf_linker__add_file().

This will allow the inner functions to be shared with a new,
non-filename-based, API in the next commit.

Signed-off-by: Alastair Robertson <[email protected]>
The new_fd and add_fd functions correspond to the original new and
add_file functions, but accept an FD instead of a file name. This
gives API consumers the option of using anonymous files/memfds to
avoid writing ELFs to disk.

This new API will be useful for performing linking as part of
bpftrace's JIT compilation.

The add_buf function is a convenience wrapper that does the work of
creating a memfd for the caller.

Signed-off-by: Alastair Robertson <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=916884 irrelevant now. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant