aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/asm-generic/vmlinux.lds.h
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2020-07-11 23:53:23 +0200
committerAlexei Starovoitov <ast@kernel.org>2020-07-13 10:42:02 -0700
commit5a2798ab32ba2952cfe25701ee460bccbd434c75 (patch)
tree129a8daa75fe60daa836cdf4de8a5418311de5a9 /include/asm-generic/vmlinux.lds.h
parentbpf: Compile resolve_btfids tool at kernel compilation start (diff)
downloadwireguard-linux-5a2798ab32ba2952cfe25701ee460bccbd434c75.tar.xz
wireguard-linux-5a2798ab32ba2952cfe25701ee460bccbd434c75.zip
bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros
Adding support to generate .BTF_ids section that will hold BTF ID lists for verifier. Adding macros that will help to define lists of BTF ID values placed in .BTF_ids section. They are initially filled with zeros (during compilation) and resolved later during the linking phase by resolve_btfids tool. Following defines list of one BTF ID value: BTF_ID_LIST(bpf_skb_output_btf_ids) BTF_ID(struct, sk_buff) It also defines following variable to access the list: extern u32 bpf_skb_output_btf_ids[]; The BTF_ID_UNUSED macro defines 4 zero bytes. It's used when we want to define 'unused' entry in BTF_ID_LIST, like: BTF_ID_LIST(bpf_skb_output_btf_ids) BTF_ID(struct, sk_buff) BTF_ID_UNUSED BTF_ID(struct, task_struct) Suggested-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Tested-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20200711215329.41165-4-jolsa@kernel.org
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r--include/asm-generic/vmlinux.lds.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index db600ef218d7..0be2ee265931 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -641,6 +641,10 @@
__start_BTF = .; \
*(.BTF) \
__stop_BTF = .; \
+ } \
+ . = ALIGN(4); \
+ .BTF_ids : AT(ADDR(.BTF_ids) - LOAD_OFFSET) { \
+ *(.BTF_ids) \
}
#else
#define BTF