link-vmlinux.sh (c74a7469f97c0f40b46e82ee979f9fb1bb6e847c) link-vmlinux.sh (d503ac531a5246e4d910f971b213807fea925956)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# link vmlinux
5#
6# vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_INIT) and
7# $(KBUILD_VMLINUX_MAIN) and $(KBUILD_VMLINUX_LIBS). Most are built-in.a files
8# from top-level directories in the kernel tree, others are specified in

--- 61 unchanged lines hidden (view full) ---

70
71 objects="--whole-archive \
72 built-in.a \
73 --no-whole-archive \
74 --start-group \
75 ${KBUILD_VMLINUX_LIBS} \
76 --end-group"
77
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# link vmlinux
5#
6# vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_INIT) and
7# $(KBUILD_VMLINUX_MAIN) and $(KBUILD_VMLINUX_LIBS). Most are built-in.a files
8# from top-level directories in the kernel tree, others are specified in

--- 61 unchanged lines hidden (view full) ---

70
71 objects="--whole-archive \
72 built-in.a \
73 --no-whole-archive \
74 --start-group \
75 ${KBUILD_VMLINUX_LIBS} \
76 --end-group"
77
78 ${LD} ${LDFLAGS} -r -o ${1} ${objects}
78 ${LD} ${KBUILD_LDFLAGS} -r -o ${1} ${objects}
79}
80
81# Link of vmlinux
82# ${1} - optional extra .o files
83# ${2} - output file
84vmlinux_link()
85{
86 local lds="${objtree}/${KBUILD_LDS}"
87 local objects
88
89 if [ "${SRCARCH}" != "um" ]; then
90 objects="--whole-archive \
91 built-in.a \
92 --no-whole-archive \
93 --start-group \
94 ${KBUILD_VMLINUX_LIBS} \
95 --end-group \
96 ${1}"
97
79}
80
81# Link of vmlinux
82# ${1} - optional extra .o files
83# ${2} - output file
84vmlinux_link()
85{
86 local lds="${objtree}/${KBUILD_LDS}"
87 local objects
88
89 if [ "${SRCARCH}" != "um" ]; then
90 objects="--whole-archive \
91 built-in.a \
92 --no-whole-archive \
93 --start-group \
94 ${KBUILD_VMLINUX_LIBS} \
95 --end-group \
96 ${1}"
97
98 ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
98 ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
99 -T ${lds} ${objects}
100 else
101 objects="-Wl,--whole-archive \
102 built-in.a \
103 -Wl,--no-whole-archive \
104 -Wl,--start-group \
105 ${KBUILD_VMLINUX_LIBS} \
106 -Wl,--end-group \

--- 195 unchanged lines hidden ---
99 -T ${lds} ${objects}
100 else
101 objects="-Wl,--whole-archive \
102 built-in.a \
103 -Wl,--no-whole-archive \
104 -Wl,--start-group \
105 ${KBUILD_VMLINUX_LIBS} \
106 -Wl,--end-group \

--- 195 unchanged lines hidden ---