BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/2] libbpf: Extend linker API to support in-memory ELF files
@ 2024-12-04 16:10 Alastair Robertson
  2024-12-04 16:11 ` [PATCH bpf-next v2 1/2] libbpf: Pull file-opening logic up to top-level functions Alastair Robertson
  2024-12-04 16:11 ` [PATCH bpf-next v2 2/2] libbpf: Extend linker API to support in-memory ELF files Alastair Robertson
  0 siblings, 2 replies; 6+ messages in thread
From: Alastair Robertson @ 2024-12-04 16:10 UTC (permalink / raw)
  To: bpf, andrii; +Cc: Alastair Robertson

This gives API consumers the option of using anonymous files/memfds to
avoid writing temporary ELFs to disk, which will be useful for performing
linking as part of bpftrace's JIT compilation.

v2:
- Split into two commits
- Replace non-required "name" parameters with new optional opt->filename
  field
- Implement bpf_linker__add_file/bpf_linker__add_buf on top of
  bpf_linker__add_fd
- Remove bpf_linker__finalize_fd and instead have libbpf keep track of
  whether the linker's fd is owned by the linker

Alastair Robertson (2):
  libbpf: Pull file-opening logic up to top-level functions
  libbpf: Extend linker API to support in-memory ELF files

 tools/lib/bpf/libbpf.h   |  12 ++-
 tools/lib/bpf/libbpf.map |   3 +
 tools/lib/bpf/linker.c   | 207 ++++++++++++++++++++++++++++++---------
 3 files changed, 176 insertions(+), 46 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-05 18:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 16:10 [PATCH bpf-next v2 0/2] libbpf: Extend linker API to support in-memory ELF files Alastair Robertson
2024-12-04 16:11 ` [PATCH bpf-next v2 1/2] libbpf: Pull file-opening logic up to top-level functions Alastair Robertson
2024-12-04 16:11 ` [PATCH bpf-next v2 2/2] libbpf: Extend linker API to support in-memory ELF files Alastair Robertson
2024-12-04 18:35   ` Andrii Nakryiko
2024-12-05 17:23     ` Alastair Robertson
2024-12-05 18:24       ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox