x86/mm/KASLR: Use only one PUD entry for real mode trampoline
[linux-2.6-microblaze.git] / scripts / link-vmlinux.sh
index c8cf453..dc0e8c5 100755 (executable)
@@ -3,22 +3,17 @@
 #
 # link vmlinux
 #
-# vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_INIT) and
-# $(KBUILD_VMLINUX_MAIN) and $(KBUILD_VMLINUX_LIBS). Most are built-in.a files
-# from top-level directories in the kernel tree, others are specified in
-# arch/$(ARCH)/Makefile. Ordering when linking is important, and
-# $(KBUILD_VMLINUX_INIT) must be first. $(KBUILD_VMLINUX_LIBS) are archives
-# which are linked conditionally (not within --whole-archive), and do not
-# require symbol indexes added.
+# vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_OBJS) and
+# $(KBUILD_VMLINUX_LIBS). Most are built-in.a files from top-level directories
+# in the kernel tree, others are specified in arch/$(ARCH)/Makefile.
+# $(KBUILD_VMLINUX_LIBS) are archives which are linked conditionally
+# (not within --whole-archive), and do not require symbol indexes added.
 #
 # vmlinux
 #   ^
 #   |
-#   +-< $(KBUILD_VMLINUX_INIT)
-#   |   +--< init/version.o + more
-#   |
-#   +--< $(KBUILD_VMLINUX_MAIN)
-#   |    +--< drivers/built-in.a mm/built-in.a + more
+#   +--< $(KBUILD_VMLINUX_OBJS)
+#   |    +--< init/built-in.a drivers/built-in.a mm/built-in.a + more
 #   |
 #   +--< $(KBUILD_VMLINUX_LIBS)
 #   |    +--< lib/lib.a + more
@@ -44,24 +39,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 +46,7 @@ modpost_link()
        local objects
 
        objects="--whole-archive                                \
-               built-in.a                                      \
+               ${KBUILD_VMLINUX_OBJS}                          \
                --no-whole-archive                              \
                --start-group                                   \
                ${KBUILD_VMLINUX_LIBS}                          \
@@ -88,7 +65,7 @@ vmlinux_link()
 
        if [ "${SRCARCH}" != "um" ]; then
                objects="--whole-archive                        \
-                       built-in.a                              \
+                       ${KBUILD_VMLINUX_OBJS}                  \
                        --no-whole-archive                      \
                        --start-group                           \
                        ${KBUILD_VMLINUX_LIBS}                  \
@@ -99,7 +76,7 @@ vmlinux_link()
                        -T ${lds} ${objects}
        else
                objects="-Wl,--whole-archive                    \
-                       built-in.a                              \
+                       ${KBUILD_VMLINUX_OBJS}                  \
                        -Wl,--no-whole-archive                  \
                        -Wl,--start-group                       \
                        ${KBUILD_VMLINUX_LIBS}                  \
@@ -160,7 +137,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
@@ -195,14 +171,7 @@ if [ "$1" = "clean" ]; then
 fi
 
 # We need access to CONFIG_ symbols
-case "${KCONFIG_CONFIG}" in
-*/*)
-       . "${KCONFIG_CONFIG}"
-       ;;
-*)
-       # Force using a file from the current directory
-       . "./${KCONFIG_CONFIG}"
-esac
+. include/config/auto.conf
 
 # Update version
 info GEN .version
@@ -217,8 +186,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