summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTony Ambardar <tony.ambardar@gmail.com>2020-09-19 22:01:34 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-14 10:32:58 +0200
commit6440fb9bda91c7bddad15d5dc9b0dd7fec652174 (patch)
tree92fc7e524d17127fffd1e86cf4bc9145b8b304af /include
parent67a57230b4bfb377cd479c9b32d1e2ab70bc96d1 (diff)
bpf: Prevent .BTF section elimination
commit 65c204398928f9c79f1a29912b410439f7052635 upstream. 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: 90ceddcb4950 ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f050039ca2c0..e5e242587595 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -599,7 +599,7 @@
#define BTF \
.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) { \
__start_BTF = .; \
- *(.BTF) \
+ KEEP(*(.BTF)) \
__stop_BTF = .; \
}
#else