The top Makefile does not need to export KBUILD_VMLINUX_INIT and KBUILD_VMLINUX_MAIN separately. Put every built-in.a into KBUILD_VMLINUX_OBJS. The order of $(head-y), $(init-y), $(core-y), ... is still retained.
Showing the changes to scripts (1 of 3 files). Show all
Unified · Split
| @@ -3,22 +3,17 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | # link vmlinux |
| 5 | 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 | |
| 9 | −# arch/$(ARCH)/Makefile. Ordering when linking is important, and | |
| 10 | −# $(KBUILD_VMLINUX_INIT) must be first. $(KBUILD_VMLINUX_LIBS) are archives | |
| 11 | −# which are linked conditionally (not within --whole-archive), and do not | |
| 12 | −# require symbol indexes added. | |
| 6 | +# vmlinux is linked from the objects selected by $(KBUILD_VMLINUX_OBJS) and | |
| 7 | +# $(KBUILD_VMLINUX_LIBS). Most are built-in.a files from top-level directories | |
| 8 | +# in the kernel tree, others are specified in arch/$(ARCH)/Makefile. | |
| 9 | +# $(KBUILD_VMLINUX_LIBS) are archives which are linked conditionally | |
| 10 | +# (not within --whole-archive), and do not require symbol indexes added. | |
| 13 | 11 | # |
| 14 | 12 | # vmlinux |
| 15 | 13 | # ^ |
| 16 | 14 | # | |
| 17 | −# +-< $(KBUILD_VMLINUX_INIT) | |
| 18 | −# | +--< init/version.o + more | |
| 19 | −# | | |
| 20 | −# +--< $(KBUILD_VMLINUX_MAIN) | |
| 21 | −# | +--< drivers/built-in.a mm/built-in.a + more | |
| 15 | +# +--< $(KBUILD_VMLINUX_OBJS) | |
| 16 | +# | +--< init/built-in.a drivers/built-in.a mm/built-in.a + more | |
| 22 | 17 | # | |
| 23 | 18 | # +--< $(KBUILD_VMLINUX_LIBS) |
| 24 | 19 | # | +--< lib/lib.a + more |
| @@ -51,8 +46,7 @@ modpost_link() · 26 unmodified lines | ||
| 51 | 46 | local objects |
| 52 | 47 | |
| 53 | 48 | objects="--whole-archive \ |
| 54 | − ${KBUILD_VMLINUX_INIT} \ | |
| 55 | − ${KBUILD_VMLINUX_MAIN} \ | |
| 49 | + ${KBUILD_VMLINUX_OBJS} \ | |
| 56 | 50 | --no-whole-archive \ |
| 57 | 51 | --start-group \ |
| 58 | 52 | ${KBUILD_VMLINUX_LIBS} \ |
| @@ -71,8 +65,7 @@ vmlinux_link() · 12 unmodified lines | ||
| 71 | 65 | |
| 72 | 66 | if [ "${SRCARCH}" != "um" ]; then |
| 73 | 67 | objects="--whole-archive \ |
| 74 | − ${KBUILD_VMLINUX_INIT} \ | |
| 75 | − ${KBUILD_VMLINUX_MAIN} \ | |
| 68 | + ${KBUILD_VMLINUX_OBJS} \ | |
| 76 | 69 | --no-whole-archive \ |
| 77 | 70 | --start-group \ |
| 78 | 71 | ${KBUILD_VMLINUX_LIBS} \ |
| @@ -83,8 +76,7 @@ vmlinux_link() · 4 unmodified lines | ||
| 83 | 76 | -T ${lds} ${objects} |
| 84 | 77 | else |
| 85 | 78 | objects="-Wl,--whole-archive \ |
| 86 | − ${KBUILD_VMLINUX_INIT} \ | |
| 87 | − ${KBUILD_VMLINUX_MAIN} \ | |
| 79 | + ${KBUILD_VMLINUX_OBJS} \ | |
| 88 | 80 | -Wl,--no-whole-archive \ |
| 89 | 81 | -Wl,--start-group \ |
| 90 | 82 | ${KBUILD_VMLINUX_LIBS} \ |