Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: extract modules.builtin.modinfo from vmlinux.unstripped

Currently, we assume all the data for modules.builtin.modinfo are
available in vmlinux.o.

This makes it impossible for modpost, which is invoked after vmlinux.o,
to add additional module info.

This commit moves the modules.builtin.modinfo rule after modpost.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/cdb3e5b9a739666b755cd0097dc34ab69c350e51.1758182101.git.legion@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Masahiro Yamada and committed by
Nathan Chancellor
39cfd5b1 3e86e4d7

+27 -25
+26
scripts/Makefile.vmlinux
··· 99 99 vmlinux: vmlinux.unstripped FORCE 100 100 $(call if_changed,strip_relocs) 101 101 102 + # modules.builtin.modinfo 103 + # --------------------------------------------------------------------------- 104 + 105 + OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary 106 + 107 + targets += modules.builtin.modinfo 108 + modules.builtin.modinfo: vmlinux.unstripped FORCE 109 + $(call if_changed,objcopy) 110 + 111 + # modules.builtin 112 + # --------------------------------------------------------------------------- 113 + 114 + __default: modules.builtin 115 + 116 + # The second line aids cases where multiple modules share the same object. 117 + 118 + quiet_cmd_modules_builtin = GEN $@ 119 + cmd_modules_builtin = \ 120 + tr '\0' '\n' < $< | \ 121 + sed -n 's/^[[:alnum:]:_]*\.file=//p' | \ 122 + tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@ 123 + 124 + targets += modules.builtin 125 + modules.builtin: modules.builtin.modinfo FORCE 126 + $(call if_changed,modules_builtin) 127 + 102 128 # modules.builtin.ranges 103 129 # --------------------------------------------------------------------------- 104 130 ifdef CONFIG_BUILTIN_MODULE_RANGES
+1 -25
scripts/Makefile.vmlinux_o
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 3 3 PHONY := __default 4 - __default: vmlinux.o modules.builtin.modinfo modules.builtin 4 + __default: vmlinux.o 5 5 6 6 include include/config/auto.conf 7 7 include $(srctree)/scripts/Kbuild.include ··· 72 72 $(call if_changed_rule,ld_vmlinux.o) 73 73 74 74 targets += vmlinux.o 75 - 76 - # modules.builtin.modinfo 77 - # --------------------------------------------------------------------------- 78 - 79 - OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary 80 - 81 - targets += modules.builtin.modinfo 82 - modules.builtin.modinfo: vmlinux.o FORCE 83 - $(call if_changed,objcopy) 84 - 85 - # modules.builtin 86 - # --------------------------------------------------------------------------- 87 - 88 - # The second line aids cases where multiple modules share the same object. 89 - 90 - quiet_cmd_modules_builtin = GEN $@ 91 - cmd_modules_builtin = \ 92 - tr '\0' '\n' < $< | \ 93 - sed -n 's/^[[:alnum:]:_]*\.file=//p' | \ 94 - tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$$/.ko/' > $@ 95 - 96 - targets += modules.builtin 97 - modules.builtin: modules.builtin.modinfo FORCE 98 - $(call if_changed,modules_builtin) 99 75 100 76 # Add FORCE to the prerequisites of a target to force it to be always rebuilt. 101 77 # ---------------------------------------------------------------------------