Skip to content

Commit db16c1f

Browse files
iii-ianakryiko
authored andcommitted
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: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210413190043.21918-1-iii@linux.ibm.com
1 parent 5c50732 commit db16c1f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎scripts/link-vmlinux.sh‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ vmlinux_link()
213213
gen_btf()
214214
{
215215
local pahole_ver
216+
local extra_paholeopt=
216217

217218
if ! [ -x "$(command -v ${PAHOLE})" ]; then
218219
echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
@@ -227,8 +228,12 @@ gen_btf()
227228

228229
vmlinux_link ${1}
229230

231+
if [ "${pahole_ver}" -ge "121" ]; then
232+
extra_paholeopt="${extra_paholeopt} --btf_gen_floats"
233+
fi
234+
230235
info "BTF" ${2}
231-
LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
236+
LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1}
232237

233238
# Create ${2} which contains just .BTF section but no symbols. Add
234239
# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all

0 commit comments

Comments
 (0)