]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Prevent .BTF section elimination
authorTony Ambardar <tony.ambardar@gmail.com>
Sun, 20 Sep 2020 05:01:34 +0000 (22:01 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 21 Sep 2020 19:50:44 +0000 (21:50 +0200)
commit139c481e1703ad7e8c76aadcf34e255eb241b585
tree4c5e8a30ef866a06423b426ef05fee560eca03c8
parentbdb6df4b3d7fd4145e17f5d89deee803bb8cfcb5
bpf: Prevent .BTF section elimination

Systems with memory or disk constraints often reduce the kernel footprint
by configuring LD_DEAD_CODE_DATA_ELIMINATION. However, this can result in
removal of any BTF information.

Use the KEEP() macro to preserve the BTF data as done with other important
sections, while still allowing for smaller kernels.

Fixes: f8f7c0f28bd0 ("bpf: Support llvm-objcopy for vmlinux BTF")
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/a635b5d3e2da044e7b51ec1315e8910fbce0083f.1600417359.git.Tony.Ambardar@gmail.com
include/asm-generic/vmlinux.lds.h