Skip to content

Commit 65c2043

Browse files
guidosarducciborkmann
authored andcommitted
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: 90ceddc ("bpf: Support llvm-objcopy for vmlinux BTF") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: John Fastabend <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/a635b5d3e2da044e7b51ec1315e8910fbce0083f.1600417359.git.Tony.Ambardar@gmail.com
1 parent e23bb04 commit 65c2043

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@
661661
#define BTF \
662662
.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) { \
663663
__start_BTF = .; \
664-
*(.BTF) \
664+
KEEP(*(.BTF)) \
665665
__stop_BTF = .; \
666666
} \
667667
. = ALIGN(4); \

0 commit comments

Comments
 (0)