diff options
author | Delyan Kratunov <delyank@fb.com> | 2022-03-17 02:37:24 +0300 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-03-18 09:11:15 +0300 |
commit | bc380eb9d04812eda23fd1d2904389012b50d946 (patch) | |
tree | b59066dea814603fb3e32b0702d1d72669445dd9 /tools/lib/bpf/libbpf_legacy.h | |
parent | 5a5c11ee3e655744dbee79b8caaadb15de3377eb (diff) | |
download | linux-bc380eb9d04812eda23fd1d2904389012b50d946.tar.xz |
libbpf: .text routines are subprograms in strict mode
Currently, libbpf considers a single routine in .text to be a program. This
is particularly confusing when it comes to library objects - a single routine
meant to be used as an extern will instead be considered a bpf_program.
This patch hides this compatibility behavior behind the pre-existing
SEC_NAME strict mode flag.
Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/018de8d0d67c04bf436055270d35d394ba393505.1647473511.git.delyank@fb.com
Diffstat (limited to 'tools/lib/bpf/libbpf_legacy.h')
-rw-r--r-- | tools/lib/bpf/libbpf_legacy.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_legacy.h b/tools/lib/bpf/libbpf_legacy.h index a283cf031665..d7bcbd01f66f 100644 --- a/tools/lib/bpf/libbpf_legacy.h +++ b/tools/lib/bpf/libbpf_legacy.h @@ -54,6 +54,10 @@ enum libbpf_strict_mode { * * Note, in this mode the program pin path will be based on the * function name instead of section name. + * + * Additionally, routines in the .text section are always considered + * sub-programs. Legacy behavior allows for a single routine in .text + * to be a program. */ LIBBPF_STRICT_SEC_NAME = 0x04, /* |