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
See also
make vmlinux
and
make all