mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-03 23:29:06 +08:00
libbpf: Add per-file linker opts
For better future extensibility add per-file linker options. Currently the set of available options is empty. This changes bpf_linker__add_file() API, but it's not a breaking change as bpf_linker APIs hasn't been released yet. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210507054119.270888-3-andrii@kernel.org
This commit is contained in:
committed by
Andrii Nakryiko
parent
c5389a965b
commit
6f585ab88f
10
src/libbpf.h
10
src/libbpf.h
@@ -768,10 +768,18 @@ struct bpf_linker_opts {
|
||||
};
|
||||
#define bpf_linker_opts__last_field sz
|
||||
|
||||
struct bpf_linker_file_opts {
|
||||
/* size of this struct, for forward/backward compatiblity */
|
||||
size_t sz;
|
||||
};
|
||||
#define bpf_linker_file_opts__last_field sz
|
||||
|
||||
struct bpf_linker;
|
||||
|
||||
LIBBPF_API struct bpf_linker *bpf_linker__new(const char *filename, struct bpf_linker_opts *opts);
|
||||
LIBBPF_API int bpf_linker__add_file(struct bpf_linker *linker, const char *filename);
|
||||
LIBBPF_API int bpf_linker__add_file(struct bpf_linker *linker,
|
||||
const char *filename,
|
||||
const struct bpf_linker_file_opts *opts);
|
||||
LIBBPF_API int bpf_linker__finalize(struct bpf_linker *linker);
|
||||
LIBBPF_API void bpf_linker__free(struct bpf_linker *linker);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user