summaryrefslogtreecommitdiff
path: root/scripts/link-vmlinux.sh
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-17 09:10:03 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-01-28 09:11:17 +0900
commitdee9495303f2c6d63a20c43a26420765909898eb (patch)
tree743ef93dc34e18f12cd67d7379979ee4651e6c96 /scripts/link-vmlinux.sh
parent58156ba4468f1d0de166a4330374bc9df9b74efc (diff)
kbuild: remove top-level built-in.a
The symbol table in the final archive is unneeded; the linker does not require the symbol table after the --whole-archive option. Every object file in the archive is included in the link anyway. Pass thin archives from subdirectories directly to the linker, and remove the final archiving step. Fix up the document and comments as well. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'scripts/link-vmlinux.sh')
-rwxr-xr-xscripts/link-vmlinux.sh30
1 files changed, 6 insertions, 24 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index c8cf45362bd6..4788def71358 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -44,24 +44,6 @@ info()
fi
}
-# Thin archive build here makes a final archive with symbol table and indexes
-# from vmlinux objects INIT and MAIN, which can be used as input to linker.
-# KBUILD_VMLINUX_LIBS archives should already have symbol table and indexes
-# added.
-#
-# Traditional incremental style of link does not require this step
-#
-# built-in.a output file
-#
-archive_builtin()
-{
- info AR built-in.a
- rm -f built-in.a;
- ${AR} rcsTP${KBUILD_ARFLAGS} built-in.a \
- ${KBUILD_VMLINUX_INIT} \
- ${KBUILD_VMLINUX_MAIN}
-}
-
# Link of vmlinux.o used for section mismatch analysis
# ${1} output file
modpost_link()
@@ -69,7 +51,8 @@ modpost_link()
local objects
objects="--whole-archive \
- built-in.a \
+ ${KBUILD_VMLINUX_INIT} \
+ ${KBUILD_VMLINUX_MAIN} \
--no-whole-archive \
--start-group \
${KBUILD_VMLINUX_LIBS} \
@@ -88,7 +71,8 @@ vmlinux_link()
if [ "${SRCARCH}" != "um" ]; then
objects="--whole-archive \
- built-in.a \
+ ${KBUILD_VMLINUX_INIT} \
+ ${KBUILD_VMLINUX_MAIN} \
--no-whole-archive \
--start-group \
${KBUILD_VMLINUX_LIBS} \
@@ -99,7 +83,8 @@ vmlinux_link()
-T ${lds} ${objects}
else
objects="-Wl,--whole-archive \
- built-in.a \
+ ${KBUILD_VMLINUX_INIT} \
+ ${KBUILD_VMLINUX_MAIN} \
-Wl,--no-whole-archive \
-Wl,--start-group \
${KBUILD_VMLINUX_LIBS} \
@@ -160,7 +145,6 @@ cleanup()
rm -f .tmp_System.map
rm -f .tmp_kallsyms*
rm -f .tmp_vmlinux*
- rm -f built-in.a
rm -f System.map
rm -f vmlinux
rm -f vmlinux.o
@@ -217,8 +201,6 @@ fi;
# final build of init/
${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init
-archive_builtin
-
#link vmlinux.o
info LD vmlinux.o
modpost_link vmlinux.o