[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 5 May 2022 16:22:34 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org,
Nicolas Schier a <nicolas@...sle.eu>,
Ard Biesheuvel <ardb@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
linuxppc-dev@...ts.ozlabs.org, linux-um@...ts.infradead.org,
linux-s390@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <masahiroy@...nel.org>
Subject: [PATCH v3 05/15] 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 to list out all the member objects.
Generate this list to allow modpost to know all the member objects.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
---
(no changes since v2)
Changes in v2:
- Move '> .vmlinux.objs' to the outside of the loop (Nicolas)
- Clean up .vmlinux.objs explicitly
scripts/link-vmlinux.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 20f44504a644..eceb3ee7ec06 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -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
@@ -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
--
2.32.0
Powered by blists - more mailing lists