提交 492ab132 编写于 作者: I Ilya Leoshkevich 提交者: Lipeng Sang

bpf: Generate BTF_KIND_FLOAT when linking vmlinux

stable inclusion
from stable-v5.10.151
commit bbaea0f1cd33d702d053d5bdaf6d6dec3932894c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64L0X

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bbaea0f1cd33d702d053d5bdaf6d6dec3932894c

--------------------------------

commit db16c1fe  upstream.

[backported for dependency only extra_paholeopt variable setup and
usage, we don't want floats generated in 5.10]

pahole v1.21 supports the --btf_gen_floats flag, which makes it
generate the information about the floating-point types [1].

Adjust link-vmlinux.sh to pass this flag to pahole in case it's
supported, which is determined using a simple version check.

[1] https://lore.kernel.org/dwarves/YHRiXNX1JUF2Az0A@kernel.org/Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Acked-by: NAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413190043.21918-1-iii@linux.ibm.comSigned-off-by: NJiri Olsa <jolsa@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NLipeng Sang <sanglipeng1@jd.com>
上级 9b40194a
...@@ -146,6 +146,7 @@ vmlinux_link() ...@@ -146,6 +146,7 @@ vmlinux_link()
gen_btf() gen_btf()
{ {
local pahole_ver local pahole_ver
local extra_paholeopt=
if ! [ -x "$(command -v ${PAHOLE})" ]; then if ! [ -x "$(command -v ${PAHOLE})" ]; then
echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available" echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
...@@ -161,7 +162,7 @@ gen_btf() ...@@ -161,7 +162,7 @@ gen_btf()
vmlinux_link ${1} vmlinux_link ${1}
info "BTF" ${2} info "BTF" ${2}
LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1}
# Create ${2} which contains just .BTF section but no symbols. Add # Create ${2} which contains just .BTF section but no symbols. Add
# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册