Skip to content

Commit e493f47

Browse files
committed
kbuild: generate a list of objects in vmlinux
A *.mod file lists the member objects of a module, but vmlinux does not have such a file. Generate this list to allow modpost to know all the member objects. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]> Tested-by: Nathan Chancellor <[email protected]>
1 parent a44abac commit e493f47

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/link-vmlinux.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ cleanup()
311311
rm -f vmlinux.map
312312
rm -f vmlinux.o
313313
rm -f .vmlinux.d
314+
rm -f .vmlinux.objs
314315
}
315316

316317
# Use "make V=1" to debug this script
@@ -342,6 +343,16 @@ ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1
342343
modpost_link vmlinux.o
343344
objtool_link vmlinux.o
344345

346+
# Generate the list of objects in vmlinux
347+
for f in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}; do
348+
case ${f} in
349+
*.a)
350+
${AR} t ${f} ;;
351+
*)
352+
echo ${f} ;;
353+
esac
354+
done > .vmlinux.objs
355+
345356
# modpost vmlinux.o to check for section mismatches
346357
${MAKE} -f "${srctree}/scripts/Makefile.modpost" MODPOST_VMLINUX=1
347358

0 commit comments

Comments
 (0)