Skip to content

Commit 08beb66

Browse files
committed
kbuild: split the build log of kallsyms
Currently, the build log shows KSYM + object name. Precisely speaking, kallsyms generates a .S file and then the compiler compiles it into a .o file. Split the build log into two. [Before] GEN modules.builtin LD .tmp_vmlinux.kallsyms1 KSYM .tmp_vmlinux.kallsyms1.o LD .tmp_vmlinux.kallsyms2 KSYM .tmp_vmlinux.kallsyms2.o LD vmlinux [After] GEN modules.builtin LD .tmp_vmlinux.kallsyms1 KSYMS .tmp_vmlinux.kallsyms1.S AS .tmp_vmlinux.kallsyms1.o LD .tmp_vmlinux.kallsyms2 KSYMS .tmp_vmlinux.kallsyms2.S AS .tmp_vmlinux.kallsyms2.o LD vmlinux Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent a968433 commit 08beb66

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

scripts/link-vmlinux.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ gen_btf()
169169
printf '\1' | dd of=${2} conv=notrunc bs=1 seek=16 status=none
170170
}
171171

172-
# Create ${2} .o file with all symbols from the ${1} object file
172+
# Create ${2} .S file with all symbols from the ${1} object file
173173
kallsyms()
174174
{
175-
info KSYM ${2}
176175
local kallsymopt;
177176

178177
if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then
@@ -187,13 +186,8 @@ kallsyms()
187186
kallsymopt="${kallsymopt} --base-relative"
188187
fi
189188

190-
local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
191-
${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
192-
193-
local afile="`basename ${2} .o`.S"
194-
195-
${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${afile}
196-
${CC} ${aflags} -c -o ${2} ${afile}
189+
info KSYMS ${2}
190+
${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${2}
197191
}
198192

199193
# Perform one step in kallsyms generation, including temporary linking of
@@ -203,9 +197,15 @@ kallsyms_step()
203197
kallsymso_prev=${kallsymso}
204198
kallsyms_vmlinux=.tmp_vmlinux.kallsyms${1}
205199
kallsymso=${kallsyms_vmlinux}.o
200+
kallsyms_S=${kallsyms_vmlinux}.S
206201

207202
vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o}
208-
kallsyms ${kallsyms_vmlinux} ${kallsymso}
203+
kallsyms ${kallsyms_vmlinux} ${kallsyms_S}
204+
205+
info AS ${kallsyms_S}
206+
${CC} ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS} \
207+
${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
208+
-c -o ${kallsymso} ${kallsyms_S}
209209
}
210210

211211
# Create map file with all symbols from ${1}

0 commit comments

Comments
 (0)