? Dependency chain:
_all->all->vmlinux->$ (Vmlinux-init) +$ (Vmlinux-main)
Check this out:
# vmlinux# ^# |# +-< $ (vmlinux-init) # | +--< INIT/VERSION.O + more# |# +--< $ (vmlinux-main) # | +--< driver/built-in.o mm/built-in.o + more# |# +-< kallsyms.o (see description in config_kallsyms section)
The key sections are listed above and listed here again:
Vmlinux: $ (vmlinux-lds) $ (vmlinux-init) $ (vmlinux-main) VMLINUX.O $ (KALLSYMS.O) force
So what is a $ (vmlinux-init) variable? Through analysis, the first expansion is: "$ (head-y) $ (init-y)". $ (head-y) was not found, while $ (init-y) eventually unfolded as: INIT/BUILT-IN.O. Here's a little bit of a look (looking back at the information the make process output, there's a lot of BUILT-IN.O). It can be said that many built-in.o constitute the vmlinux. Therefore, the relationship between Vmlinux and source becomes the relationship between BUILT-IN.O and source code. Or look at the output information of make:
CC init/version.occ init/do_mounts.occ init/do_mounts_rd.occ init/do_mounts_initrd.old Init/mounts.oCC init/ INITRAMFS.OCC Init/calibrate.old INIT/BUILT-IN.O
It can be speculated that the INIT/BUILT-IN.O is compiled and linked by the source code under the Init directory. Makefile found under the init directory:
Obj-y: = main.o version.o mounts.oifneq ($ (CONFIG_BLK_DEV_INITRD),y) obj-y += noinitramfs.oelseobj-$ (CONFIG_BLK_DEV_INITRD) += initramfs.oendifobj-$ (config_generic_calibrate_delay) + = calibrate.omounts-y:= do_mounts.omounts-$ (config_blk_dev_ram) += Do_mounts_ rd.omounts-$ (CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.omounts-$ (CONFIG_BLK_DEV_MD) += Do_mounts_ md.o
Developers with kernel development experience should know that the assignment to Obj-y Target will be compiled into the vmlinux, as to how to control, speculation Kbuild system is involved, this is the internal principle of make and kubild, here does not analyze, know that there is such a thing, will be used on the line. The $ (CONFIG_BLK_DEV_INITRD) variables are defined in. CONFIG (yes, the file that holds the kernel configuration) in the file:
config_relay=yconfig_blk_dev_initrd=Yconfig_initramfs_source= ""
Here Vmlinux and the source of the relationship is clear, is by the BUILT-IN.O to be a middleman:
Vmlinux<->built-in.o<->*.c