Commit db16c1fe authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Andrii Nakryiko

bpf: Generate BTF_KIND_FLOAT when linking vmlinux

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: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413190043.21918-1-iii@linux.ibm.com
parent 5c507329
...@@ -213,6 +213,7 @@ vmlinux_link() ...@@ -213,6 +213,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"
...@@ -227,8 +228,12 @@ gen_btf() ...@@ -227,8 +228,12 @@ gen_btf()
vmlinux_link ${1} vmlinux_link ${1}
if [ "${pahole_ver}" -ge "121" ]; then
extra_paholeopt="${extra_paholeopt} --btf_gen_floats"
fi
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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment