Debian Codegraph @

vmtest/patches/5.10-bpf-Generate-BTF_KIND_FLOAT-when-linking-vmlinux.patch

raw
1 From bbaea0f1cd33d702d053d5bdaf6d6dec3932894c Mon Sep 17 00:00:00 2001
2 Message-Id: <bbaea0f1cd33d702d053d5bdaf6d6dec3932894c.1676499122.git.osandov@osandov.com>
3 From: Ilya Leoshkevich <[email protected]>
4 Date: Wed, 19 Oct 2022 10:56:00 +0200
5 Subject: [PATCH] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
6
7 commit db16c1fe92d7ba7d39061faef897842baee2c887 upstream.
8
9 [backported for dependency only extra_paholeopt variable setup and
10 usage, we don't want floats generated in 5.10]
11
12 pahole v1.21 supports the --btf_gen_floats flag, which makes it
13 generate the information about the floating-point types [1].
14
15 Adjust link-vmlinux.sh to pass this flag to pahole in case it's
16 supported, which is determined using a simple version check.
17
18 [1] https://lore.kernel.org/dwarves/[email protected]/
19
20 Signed-off-by: Ilya Leoshkevich <[email protected]>
21 Signed-off-by: Andrii Nakryiko <[email protected]>
22 Acked-by: Andrii Nakryiko <[email protected]>
23 Link: https://lore.kernel.org/bpf/[email protected]
24 Signed-off-by: Jiri Olsa <[email protected]>
25 Signed-off-by: Greg Kroah-Hartman <[email protected]>
26 ---
27 scripts/link-vmlinux.sh | 3 ++-
28 1 file changed, 2 insertions(+), 1 deletion(-)
29
30 diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
31 index d0b44bee9286..cdfccbfed452 100755
32 --- a/scripts/link-vmlinux.sh
33 +++ b/scripts/link-vmlinux.sh
34 @@ -146,6 +146,7 @@ vmlinux_link()
35 gen_btf()
36 {
37 local pahole_ver
38 + local extra_paholeopt=
39
40 if ! [ -x "$(command -v ${PAHOLE})" ]; then
41 echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
42 @@ -161,7 +162,7 @@ gen_btf()
43 vmlinux_link ${1}
44
45 info "BTF" ${2}
46 - LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
47 + LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1}
48
49 # Create ${2} which contains just .BTF section but no symbols. Add
50 # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all
51 --
52 2.30.2
53