linux-stable/tools/lib/bpf
Andrey Ignatov ab9e084821 libbpf: Per-symbol visibility for DSO
Make global symbols in libbpf DSO hidden by default with
-fvisibility=hidden and export symbols that are part of ABI explicitly
with __attribute__((visibility("default"))).

This is common practice that should prevent from accidentally exporting
a symbol, that is not supposed to be a part of ABI what, in turn,
improves both libbpf developer- and user-experiences. See [1] for more
details.

Export control becomes more important since more and more projects use
libbpf.

The patch doesn't export a bunch of netlink related functions since as
agreed in [2] they'll be reworked. That doesn't break bpftool since
bpftool links libbpf statically.

[1] https://www.akkadia.org/drepper/dsohowto.pdf (2.2 Export Control)
[2] https://www.mail-archive.com/netdev@vger.kernel.org/msg251434.html

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-10-16 15:16:47 -07:00
..
.gitignore tools lib bpf: Change FEATURE-DUMP to FEATURE-DUMP.libbpf 2015-11-05 12:47:51 -03:00
bpf.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
bpf.h libbpf: Per-symbol visibility for DSO 2018-10-16 15:16:47 -07:00
btf.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
btf.h libbpf: Per-symbol visibility for DSO 2018-10-16 15:16:47 -07:00
Build Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-09-25 20:29:38 -07:00
libbpf.c bpf: bpftool, add flag to allow non-compat map definitions 2018-10-15 16:13:14 -07:00
libbpf.h libbpf: Per-symbol visibility for DSO 2018-10-16 15:16:47 -07:00
libbpf_errno.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
Makefile libbpf: Per-symbol visibility for DSO 2018-10-16 15:16:47 -07:00
netlink.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
nlattr.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
nlattr.h libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
str_error.c libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
str_error.h libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00