summaryrefslogtreecommitdiffstats
path: root/scripts/link-vmlinux.sh
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-02-11 00:25:03 +1000
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-03-26 02:01:19 +0900
commit6358d6e8b9846c2ff6fd1d4ad2809145635dd813 (patch)
tree3e2ac4f41fef7aaa4207eec852b992f0cfa3b73c /scripts/link-vmlinux.sh
parent1fe7d2bb24d7db6175e0b0a31d8fe03dc6ffb16e (diff)
downloadlinux-6358d6e8b9846c2ff6fd1d4ad2809145635dd813.tar.bz2
kbuild: remove incremental linking option
This removes the old `ld -r` incremental link option, which has not been selected by any architecture since June 2017. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/link-vmlinux.sh')
-rwxr-xr-xscripts/link-vmlinux.sh91
1 files changed, 32 insertions, 59 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index be56a1153014..601ca8b528b3 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -55,13 +55,11 @@ info()
#
archive_builtin()
{
- if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
- info AR built-in.o
- rm -f built-in.o;
- ${AR} rcsTP${KBUILD_ARFLAGS} built-in.o \
- ${KBUILD_VMLINUX_INIT} \
- ${KBUILD_VMLINUX_MAIN}
- fi
+ info AR built-in.o
+ rm -f built-in.o;
+ ${AR} rcsTP${KBUILD_ARFLAGS} built-in.o \
+ ${KBUILD_VMLINUX_INIT} \
+ ${KBUILD_VMLINUX_MAIN}
}
# Link of vmlinux.o used for section mismatch analysis
@@ -70,20 +68,13 @@ modpost_link()
{
local objects
- if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
- objects="--whole-archive \
- built-in.o \
- --no-whole-archive \
- --start-group \
- ${KBUILD_VMLINUX_LIBS} \
- --end-group"
- else
- objects="${KBUILD_VMLINUX_INIT} \
- --start-group \
- ${KBUILD_VMLINUX_MAIN} \
- ${KBUILD_VMLINUX_LIBS} \
- --end-group"
- fi
+ objects="--whole-archive \
+ built-in.o \
+ --no-whole-archive \
+ --start-group \
+ ${KBUILD_VMLINUX_LIBS} \
+ --end-group"
+
${LD} ${LDFLAGS} -r -o ${1} ${objects}
}
@@ -96,46 +87,28 @@ vmlinux_link()
local objects
if [ "${SRCARCH}" != "um" ]; then
- if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
- objects="--whole-archive \
- built-in.o \
- --no-whole-archive \
- --start-group \
- ${KBUILD_VMLINUX_LIBS} \
- --end-group \
- ${1}"
- else
- objects="${KBUILD_VMLINUX_INIT} \
- --start-group \
- ${KBUILD_VMLINUX_MAIN} \
- ${KBUILD_VMLINUX_LIBS} \
- --end-group \
- ${1}"
- fi
-
- ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
+ objects="--whole-archive \
+ built-in.o \
+ --no-whole-archive \
+ --start-group \
+ ${KBUILD_VMLINUX_LIBS} \
+ --end-group \
+ ${1}"
+
+ ${LD} ${LDFLAGS} ${LDFLAGS_vmlinux} -o ${2} \
-T ${lds} ${objects}
else
- if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then
- objects="-Wl,--whole-archive \
- built-in.o \
- -Wl,--no-whole-archive \
- -Wl,--start-group \
- ${KBUILD_VMLINUX_LIBS} \
- -Wl,--end-group \
- ${1}"
- else
- objects="${KBUILD_VMLINUX_INIT} \
- -Wl,--start-group \
- ${KBUILD_VMLINUX_MAIN} \
- ${KBUILD_VMLINUX_LIBS} \
- -Wl,--end-group \
- ${1}"
- fi
-
- ${CC} ${CFLAGS_vmlinux} -o ${2} \
- -Wl,-T,${lds} \
- ${objects} \
+ objects="-Wl,--whole-archive \
+ built-in.o \
+ -Wl,--no-whole-archive \
+ -Wl,--start-group \
+ ${KBUILD_VMLINUX_LIBS} \
+ -Wl,--end-group \
+ ${1}"
+
+ ${CC} ${CFLAGS_vmlinux} -o ${2} \
+ -Wl,-T,${lds} \
+ ${objects} \
-lutil -lrt -lpthread
rm -f linux
fi