Search notes:

vmlinux

vmlinux is linked from the objects in vmlinux.a and $KBUILD_VMLINUX_LIBS.
vmlinux.a contains objects that are linked unconditionally.
$KBUILD_VMLINUX_LIBS are archives which are linked conditionally (not within --whole-archive) and don't require symbol indexes added.
The (or one of the possible) command(s) to link vmlinux (version 6.5) is
ld         \
   -m elf_x86_64 \
   -z noexecstack \
   --emit-relocs \
   --discard-none \
   -z max-page-size=0x200000 \
   --build-id=sha1 \
   --orphan-handling=error \
   --script=./arch/x86/kernel/vmlinux.lds \
   -o vmlinux \
   --whole-archive \
   vmlinux.o .vmlinux.export.o init/version-timestamp.o \
   --no-whole-archive \
   --start-group --end-group \
   .tmp_vmlinux.kallsyms2.o
This command is executed from the script scripts/link-vmlinux.sh (function vmlinux_link).

See also

The file scripts/head-object-list.txt contains the paths and names of object files that will be placed at the head of vmlinux.
make vmlinux and make all
scripts/mksysmap
arch/x86/boot/compressed/vmlinux
scripts/link-vmlinux.sh
scripts/Makefile.vmlinux
arch/x86/Makefile.postlink
arch/x86/tools/relocs is a tool to create arch/x86/boot/compressed/vmlinux.relocs from vmlinux.

Index