summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-07-20 09:33:59 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-07-21 13:26:26 -0700
commitd8dfe5bfe856c0c72b1750322dbfcad402e73373 (patch)
tree85cda7933e3f4bbacf3a7d8d7f5fbe7fff83a672 /tools/include
parentbc4f0548f683a3d53359cef15f088d2d5bb4bc39 (diff)
tools/bpf: Sync btf_ids.h to tools
Sync kernel header btf_ids.h to tools directory. Also define macro CONFIG_DEBUG_INFO_BTF before including btf_ids.h in prog_tests/resolve_btfids.c since non-stub definitions for BTF_ID_LIST etc. macros are defined under CONFIG_DEBUG_INFO_BTF. This prevented test_progs from failing. Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200720163359.1393079-1-yhs@fb.com
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/linux/btf_ids.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
index fe019774f8a7..1cdb56950ffe 100644
--- a/tools/include/linux/btf_ids.h
+++ b/tools/include/linux/btf_ids.h
@@ -3,6 +3,8 @@
#ifndef _LINUX_BTF_IDS_H
#define _LINUX_BTF_IDS_H
+#ifdef CONFIG_DEBUG_INFO_BTF
+
#include <linux/compiler.h> /* for __PASTE */
/*
@@ -21,7 +23,7 @@
asm( \
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
".local " #symbol " ; \n" \
-".type " #symbol ", @object; \n" \
+".type " #symbol ", STT_OBJECT; \n" \
".size " #symbol ", 4; \n" \
#symbol ": \n" \
".zero 4 \n" \
@@ -83,5 +85,12 @@ asm( \
".zero 4 \n" \
".popsection; \n");
+#else
+
+#define BTF_ID_LIST(name) static u32 name[5];
+#define BTF_ID(prefix, name)
+#define BTF_ID_UNUSED
+
+#endif /* CONFIG_DEBUG_INFO_BTF */
#endif