Skip to content

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

Alastair Robertson bpf 3 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesApplied 2/2
  2. v22 patches 3 repliesSuperseded
  3. v11 patch 1 replySuperseded

Changes in v3 from the cover letter

- Removed "filename" option. Now always generate our own filename for passed-in FDs and buffers.
- Use a common function (bpf_linker_add_file) for shared implementation of bpf_linker__add_file, bpf_linker__add_fd and bpf_linker__add_buf.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2libbpf: Pull file-opening logic up to top-level functionstools/lib/bpf/linker.c+41 -421 replyApplied
2/2libbpf: Extend linker API to support in-memory ELF filestools/lib/bpf/libbpf.h tools/lib/bpf/libbpf.map tools/lib/bpf/linker.c+152 -201 replyApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH bpf-next v3 0/2] libbpf: Extend linker API to support in-memory ELF files

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.

v3:
- Removed "filename" option. Now always generate our own filename for passed-in FDs and buffers.
- Use a common function (bpf_linker_add_file) for shared implementation of bpf_linker__add_file, bpf_linker__add_fd and bpf_linker__add_buf.

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   |   5 +
 tools/lib/bpf/libbpf.map |   4 +
 tools/lib/bpf/linker.c   | 228 ++++++++++++++++++++++++++++++---------
 3 files changed, 184 insertions(+), 53 deletions(-)
Signature · 1 line
2.43.5