From: Lorenz Bauer <lmb@cloudflare.com>
To: ast@kernel.org, yhs@fb.com, daniel@iogearbox.net, kafai@fb.com
Cc: bpf@vger.kernel.org, kernel-team@cloudflare.com,
Lorenz Bauer <lmb@cloudflare.com>
Subject: [PATCH bpf-next 01/11] btf: Fix BTF_SET_START_GLOBAL macro
Date: Fri, 4 Sep 2020 12:23:51 +0100 [thread overview]
Message-ID: <20200904112401.667645-2-lmb@cloudflare.com> (raw)
In-Reply-To: <20200904112401.667645-1-lmb@cloudflare.com>
The extern symbol declaration should be on the BTF_SET_START macro, not
on BTF_SET_START_GLOBAL, since in the global case the symbol will be
declared in a header somewhere.
Fixes: eae2e83e6263 ("bpf: Add BTF_SET_START/END macros")
Signed-off-by: Lorenz Bauer <lmb@cloudflare.com>
---
include/linux/btf_ids.h | 6 +++---
tools/include/linux/btf_ids.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index 210b086188a3..42aa667d4433 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -121,7 +121,8 @@ asm( \
#define BTF_SET_START(name) \
__BTF_ID_LIST(name, local) \
-__BTF_SET_START(name, local)
+__BTF_SET_START(name, local) \
+extern struct btf_id_set name;
#define BTF_SET_START_GLOBAL(name) \
__BTF_ID_LIST(name, globl) \
@@ -131,8 +132,7 @@ __BTF_SET_START(name, globl)
asm( \
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
".size __BTF_ID__set__" #name ", .-" #name " \n" \
-".popsection; \n"); \
-extern struct btf_id_set name;
+".popsection; \n");
#else
diff --git a/tools/include/linux/btf_ids.h b/tools/include/linux/btf_ids.h
index 210b086188a3..42aa667d4433 100644
--- a/tools/include/linux/btf_ids.h
+++ b/tools/include/linux/btf_ids.h
@@ -121,7 +121,8 @@ asm( \
#define BTF_SET_START(name) \
__BTF_ID_LIST(name, local) \
-__BTF_SET_START(name, local)
+__BTF_SET_START(name, local) \
+extern struct btf_id_set name;
#define BTF_SET_START_GLOBAL(name) \
__BTF_ID_LIST(name, globl) \
@@ -131,8 +132,7 @@ __BTF_SET_START(name, globl)
asm( \
".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
".size __BTF_ID__set__" #name ", .-" #name " \n" \
-".popsection; \n"); \
-extern struct btf_id_set name;
+".popsection; \n");
#else
--
2.25.1
next prev parent reply other threads:[~2020-09-04 11:29 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 11:23 [PATCH bpf-next 00/11] RFC: Make check_func_arg table driven Lorenz Bauer
2020-09-04 11:23 ` Lorenz Bauer [this message]
2020-09-09 4:04 ` [PATCH bpf-next 01/11] btf: Fix BTF_SET_START_GLOBAL macro Andrii Nakryiko
2020-09-09 9:51 ` Lorenz Bauer
2020-09-04 11:23 ` [PATCH bpf-next 02/11] btf: add a global set of valid BTF socket ids Lorenz Bauer
2020-09-09 4:12 ` Andrii Nakryiko
2020-09-04 11:23 ` [PATCH bpf-next 03/11] btf: make btf_set_contains take a const pointer Lorenz Bauer
2020-09-09 4:13 ` Andrii Nakryiko
2020-09-04 11:23 ` [PATCH bpf-next 04/11] bpf: check scalar or invalid register in check_helper_mem_access Lorenz Bauer
2020-09-09 4:22 ` Andrii Nakryiko
2020-09-09 10:02 ` Lorenz Bauer
2020-09-04 11:23 ` [PATCH bpf-next 05/11] bpf: allow specifying a set of BTF IDs for helper arguments Lorenz Bauer
2020-09-06 23:04 ` Martin KaFai Lau
2020-09-07 9:15 ` Lorenz Bauer
2020-09-09 4:47 ` Andrii Nakryiko
2020-09-09 5:56 ` Martin KaFai Lau
2020-09-09 10:06 ` Lorenz Bauer
2020-09-09 10:11 ` Lorenz Bauer
2020-09-04 11:23 ` [PATCH bpf-next 06/11] bpf: make reference tracking in check_func_arg generic Lorenz Bauer
2020-09-09 4:50 ` Andrii Nakryiko
2020-09-04 11:23 ` [PATCH bpf-next 07/11] bpf: always check access to PTR_TO_CTX regardless of arg_type Lorenz Bauer
2020-09-04 11:23 ` [PATCH bpf-next 08/11] bpf: set meta->raw_mode for pointers to memory closer to it's use Lorenz Bauer
2020-09-04 11:23 ` [PATCH bpf-next 09/11] bpf: check ARG_PTR_TO_SPINLOCK register type in check_func_arg Lorenz Bauer
2020-09-04 11:24 ` [PATCH bpf-next 10/11] bpf: hoist type checking for nullable arg types Lorenz Bauer
2020-09-09 5:07 ` Andrii Nakryiko
2020-09-04 11:24 ` [PATCH bpf-next 11/11] bpf: use a table to drive helper arg type checks Lorenz Bauer
2020-09-09 6:17 ` [PATCH bpf-next 00/11] RFC: Make check_func_arg table driven Martin KaFai Lau
2020-09-09 10:15 ` Lorenz Bauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200904112401.667645-2-lmb@cloudflare.com \
--to=lmb@cloudflare.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=kernel-team@cloudflare.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).