summaryrefslogtreecommitdiffstats
path: root/tools/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-12-19 01:28:34 +0100
committerAlexei Starovoitov <ast@kernel.org>2019-12-19 02:33:36 +0100
commit81bfdd087bf31a87c5ff25cc7004d5308954a35c (patch)
tree364a9d81d8f7bd736c22c12e5e7795be1fd50dd6 /tools/bpf
parentlibbpf: Add bpf_link__disconnect() API to preserve underlying BPF resource (diff)
downloadlinux-81bfdd087bf31a87c5ff25cc7004d5308954a35c.tar.xz
linux-81bfdd087bf31a87c5ff25cc7004d5308954a35c.zip
libbpf: Put Kconfig externs into .kconfig section
Move Kconfig-provided externs into custom .kconfig section. Add __kconfig into bpf_helpers.h for user convenience. Update selftests accordingly. Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191219002837.3074619-2-andriin@fb.com
Diffstat (limited to 'tools/bpf')
-rw-r--r--tools/bpf/bpftool/gen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 851c465f99dc..a14d8bc5d31d 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -83,8 +83,8 @@ static const char *get_map_ident(const struct bpf_map *map)
return "rodata";
else if (str_has_suffix(name, ".bss"))
return "bss";
- else if (str_has_suffix(name, ".extern"))
- return "externs"; /* extern is a C keyword */
+ else if (str_has_suffix(name, ".kconfig"))
+ return "kconfig";
else
return NULL;
}
@@ -112,8 +112,8 @@ static int codegen_datasec_def(struct bpf_object *obj,
sec_ident = "bss";
else if (strcmp(sec_name, ".rodata") == 0)
sec_ident = "rodata";
- else if (strcmp(sec_name, ".extern") == 0)
- sec_ident = "externs"; /* extern is a C keyword */
+ else if (strcmp(sec_name, ".kconfig") == 0)
+ sec_ident = "kconfig";
else
return 0;