Skip to content

Commit fdf3703

Browse files
iii-iborkmann
authored andcommitted
btf: do not use CONFIG_OUTPUT_FORMAT
Building s390 kernel with CONFIG_DEBUG_INFO_BTF fails, because CONFIG_OUTPUT_FORMAT is not defined. As a matter of fact, this variable appears to be x86-only, so other arches might be affected as well. Fix by obtaining this value from objdump output, just like it's already done for bin_arch. The exact objdump invocation is "inspired" by arch/powerpc/boot/wrapper. Also, use LANG=C for the existing bin_arch objdump invocation to avoid potential build issues on systems with non-English locale. Fixes: 341dfcf ("btf: expose BTF info through sysfs") Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent bb4b5c0 commit fdf3703

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎scripts/link-vmlinux.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ gen_btf()
115115
LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
116116

117117
# dump .BTF section into raw binary file to link with final vmlinux
118-
bin_arch=$(${OBJDUMP} -f ${1} | grep architecture | \
118+
bin_arch=$(LANG=C ${OBJDUMP} -f ${1} | grep architecture | \
119119
cut -d, -f1 | cut -d' ' -f2)
120+
bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \
121+
awk '{print $4}')
120122
${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null
121-
${OBJCOPY} -I binary -O ${CONFIG_OUTPUT_FORMAT} -B ${bin_arch} \
123+
${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \
122124
--rename-section .data=.BTF .btf.vmlinux.bin ${2}
123125
}
124126

0 commit comments

Comments
 (0)