Skip to content

Commit

Permalink
kbuild: thin archives final link close --whole-archives option
Browse files Browse the repository at this point in the history
Close the --whole-archives option with --no-whole-archive. Some
architectures end up including additional .o and files multiple
times after this, and they get duplicate symbols when they are
brought under the --whole-archives option.

This matches more closely with the incremental final link.

Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
npiggin authored and masahir0y committed Jun 30, 2017
1 parent df91b02 commit 1328a1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ modpost_link()
local objects

if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
objects="--whole-archive built-in.o"
objects="--whole-archive built-in.o --no-whole-archive"
else
objects="${KBUILD_VMLINUX_INIT} \
--start-group \
Expand All @@ -83,7 +83,7 @@ vmlinux_link()

if [ "${SRCARCH}" != "um" ]; then
if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
objects="--whole-archive built-in.o ${1}"
objects="--whole-archive built-in.o ${1} --no-whole-archive"
else
objects="${KBUILD_VMLINUX_INIT} \
--start-group \
Expand All @@ -96,7 +96,7 @@ vmlinux_link()
-T ${lds} ${objects}
else
if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
objects="-Wl,--whole-archive built-in.o ${1}"
objects="-Wl,--whole-archive built-in.o ${1} -Wl,--no-whole-archive"
else
objects="${KBUILD_VMLINUX_INIT} \
-Wl,--start-group \
Expand Down

0 comments on commit 1328a1a

Please sign in to comment.