]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: .text routines are subprograms in strict mode
authorDelyan Kratunov <delyank@fb.com>
Wed, 16 Mar 2022 23:37:24 +0000 (23:37 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 18 Mar 2022 06:11:15 +0000 (23:11 -0700)
commit250e997325f88f362903a62b3071c4953a11ca4b
treeb59066dea814603fb3e32b0702d1d72669445dd9
parent1fc5868361ef7cb856bd3b3b8f470dee1f690340
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
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_legacy.h