io_uring: don't attempt to copy iovec for READ/WRITE
[linux-2.6-microblaze.git] / scripts / link-vmlinux.sh
index 0649537..4363799 100755 (executable)
@@ -127,7 +127,9 @@ gen_btf()
                cut -d, -f1 | cut -d' ' -f2)
        bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \
                awk '{print $4}')
-       ${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null
+       ${OBJCOPY} --change-section-address .BTF=0 \
+               --set-section-flags .BTF=alloc -O binary \
+               --only-section=.BTF ${1} .btf.vmlinux.bin
        ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \
                --rename-section .data=.BTF .btf.vmlinux.bin ${2}
 }
@@ -253,6 +255,10 @@ btf_vmlinux_bin_o=""
 if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
        if gen_btf .tmp_vmlinux.btf .btf.vmlinux.bin.o ; then
                btf_vmlinux_bin_o=.btf.vmlinux.bin.o
+       else
+               echo >&2 "Failed to generate BTF for vmlinux"
+               echo >&2 "Try to disable CONFIG_DEBUG_INFO_BTF"
+               exit 1
        fi
 fi