| 1 |
From 796deb4725c9b501305fb87002f22bdc851d28ab Mon Sep 17 00:00:00 2001 |
| 2 |
Message-Id: <796deb4725c9b501305fb87002f22bdc851d28ab.1685662812.git.osandov@osandov.com> |
| 3 |
From: Ilya Leoshkevich <[email protected]> |
| 4 |
Date: Tue, 13 Apr 2021 21:00:43 +0200 |
| 5 |
Subject: [PATCH] bpf: Generate BTF_KIND_FLOAT when linking vmlinux |
| 6 |
|
| 7 |
pahole v1.21 supports the --btf_gen_floats flag, which makes it |
| 8 |
generate the information about the floating-point types [1]. |
| 9 |
|
| 10 |
Adjust link-vmlinux.sh to pass this flag to pahole in case it's |
| 11 |
supported, which is determined using a simple version check. |
| 12 |
|
| 13 |
[1] https://lore.kernel.org/dwarves/[email protected]/ |
| 14 |
|
| 15 |
Signed-off-by: Ilya Leoshkevich <[email protected]> |
| 16 |
Signed-off-by: Andrii Nakryiko <[email protected]> |
| 17 |
Acked-by: Andrii Nakryiko <[email protected]> |
| 18 |
Link: https://lore.kernel.org/bpf/[email protected] |
| 19 |
(cherry picked from commit db16c1fe92d7ba7d39061faef897842baee2c887) |
| 20 |
[Omar: only define and use extra_paholeopt] |
| 21 |
Signed-off-by: Omar Sandoval <[email protected]> |
| 22 |
--- |
| 23 |
scripts/link-vmlinux.sh | 3 ++- |
| 24 |
1 file changed, 2 insertions(+), 1 deletion(-) |
| 25 |
|
| 26 |
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh |
| 27 |
index 1ddb8961fc49..94c548b11db9 100755 |
| 28 |
--- a/scripts/link-vmlinux.sh |
| 29 |
+++ b/scripts/link-vmlinux.sh |
| 30 |
@@ -140,6 +140,7 @@ vmlinux_link() |
| 31 |
gen_btf() |
| 32 |
{ |
| 33 |
local pahole_ver |
| 34 |
+ local extra_paholeopt= |
| 35 |
|
| 36 |
if ! [ -x "$(command -v ${PAHOLE})" ]; then |
| 37 |
echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available" |
| 38 |
@@ -155,7 +156,7 @@ gen_btf() |
| 39 |
vmlinux_link ${1} |
| 40 |
|
| 41 |
info "BTF" ${2} |
| 42 |
- LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${1} |
| 43 |
+ LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1} |
| 44 |
|
| 45 |
# Create ${2} which contains just .BTF section but no symbols. Add |
| 46 |
# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all |
| 47 |
-- |
| 48 |
2.40.1 |
| 49 |
|