History

scripts/link-vmlinux.sh: force error on kallsyms failure

Since the output of the invocation of scripts/kallsyms is piped directly into the assembler, error messages it emits are visible on stderr, but a non-zero return code is ignored, and the build simply proceeds in that case. However, the resulting kernel is most likely broken, and will crash at boot. So instead, capture the output of kallsyms in a separate .S file, and pass that to the assembler in a separate step.

Ard Biesheuvel committed 10 years ago

Commit a0439341 parent b41c29b1 file · +4 −3Browse files

Unified · Split

scripts/link-vmlinux.sh+4−3
@@ -93,9 +93,10 @@ kallsyms() · 92 unmodified lines
93 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \93 local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
94 ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"94 ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
95 95
96 ${NM} -n ${1} | \96 local afile="`basename ${2} .o`.S"
97 scripts/kallsyms ${kallsymopt} | \97
98 ${CC} ${aflags} -c -o ${2} -x assembler-with-cpp -98 ${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile}
99 ${CC} ${aflags} -c -o ${2} ${afile}
99}100}
100 101
101# Create map file with all symbols from ${1}102# Create map file with all symbols from ${1}