bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/7] BPF static linker: global symbols visibility
@ 2021-05-07  5:41 Andrii Nakryiko
  2021-05-07  5:41 ` [RFC PATCH bpf-next 1/7] bpftool: strip const/volatile/restrict modifiers from .bss and .data vars Andrii Nakryiko
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Andrii Nakryiko @ 2021-05-07  5:41 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii, kernel-team

This RFC explores dropping static variables from BPF skeleton and leaving them
for use only within BPF object file. Instead, BPF static linker is extended
with support for controlling global symbol visibility outside of a single BPF
object file through STV_HIDDEN and STV_INTERNAL ELF symbol visibility.

See patch #7 for all the details, justification, and comparison with
user-space linker behavior.

Andrii Nakryiko (7):
  bpftool: strip const/volatile/restrict modifiers from .bss and .data
    vars
  libbpf: add per-file linker opts
  selftests/bpf: stop using static variables for passing data to/from
    user-space
  bpftool: stop emitting static variables in BPF skeleton
  libbpf: fix ELF symbol visibility update logic
  libbpf: treat STV_INTERNAL same as STV_HIDDEN for functions
  libbpf: convert STV_HIDDEN symbols into STV_INTERNAL after linking

 tools/bpf/bpftool/gen.c                       |  8 ++-
 tools/lib/bpf/libbpf.c                        | 11 ++--
 tools/lib/bpf/libbpf.h                        | 10 ++-
 tools/lib/bpf/linker.c                        | 62 +++++++++++++++----
 .../selftests/bpf/prog_tests/send_signal.c    |  2 +-
 .../selftests/bpf/prog_tests/skeleton.c       |  6 +-
 .../selftests/bpf/prog_tests/static_linked.c  |  5 --
 .../selftests/bpf/progs/bpf_iter_test_kern4.c |  4 +-
 tools/testing/selftests/bpf/progs/kfree_skb.c |  4 +-
 tools/testing/selftests/bpf/progs/tailcall3.c |  2 +-
 tools/testing/selftests/bpf/progs/tailcall4.c |  2 +-
 tools/testing/selftests/bpf/progs/tailcall5.c |  2 +-
 .../selftests/bpf/progs/tailcall_bpf2bpf2.c   |  2 +-
 .../selftests/bpf/progs/tailcall_bpf2bpf4.c   |  2 +-
 .../selftests/bpf/progs/test_check_mtu.c      |  4 +-
 .../selftests/bpf/progs/test_cls_redirect.c   |  4 +-
 .../bpf/progs/test_global_func_args.c         |  2 +-
 .../selftests/bpf/progs/test_rdonly_maps.c    |  6 +-
 .../selftests/bpf/progs/test_skeleton.c       |  4 +-
 .../bpf/progs/test_snprintf_single.c          |  2 +-
 .../selftests/bpf/progs/test_sockmap_listen.c |  4 +-
 .../selftests/bpf/progs/test_static_linked1.c |  8 +--
 .../selftests/bpf/progs/test_static_linked2.c |  8 +--
 23 files changed, 105 insertions(+), 59 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-07  5:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  5:41 [RFC PATCH bpf-next 0/7] BPF static linker: global symbols visibility Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 1/7] bpftool: strip const/volatile/restrict modifiers from .bss and .data vars Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 2/7] libbpf: add per-file linker opts Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 3/7] selftests/bpf: stop using static variables for passing data to/from user-space Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 4/7] bpftool: stop emitting static variables in BPF skeleton Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 5/7] libbpf: fix ELF symbol visibility update logic Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 6/7] libbpf: treat STV_INTERNAL same as STV_HIDDEN for functions Andrii Nakryiko
2021-05-07  5:41 ` [RFC PATCH bpf-next 7/7] libbpf: convert STV_HIDDEN symbols into STV_INTERNAL after linking Andrii Nakryiko

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).