Skip to content

Commit

Permalink
kbuild: generate a list of objects in vmlinux
Browse files Browse the repository at this point in the history
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 <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Tested-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
Masahiro Yamada committed May 11, 2022
1 parent a44abac commit e493f47
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ cleanup()
rm -f vmlinux.map
rm -f vmlinux.o
rm -f .vmlinux.d
rm -f .vmlinux.objs
}

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

# Generate the list of objects in vmlinux
for f in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}; do
case ${f} in
*.a)
${AR} t ${f} ;;
*)
echo ${f} ;;
esac
done > .vmlinux.objs

# modpost vmlinux.o to check for section mismatches
${MAKE} -f "${srctree}/scripts/Makefile.modpost" MODPOST_VMLINUX=1

Expand Down

0 comments on commit e493f47

Please sign in to comment.