Kbuild, link-vmlinux: Reuse vmlinux.o for final link

Even without kallsyms, link-vmlinux links the kernel twice: once
to generate a vmlinux.o for modpost and objtool, and another
time for the final executable.

This patch reuses the vmlinux.o to create the final executable
to avoid some redundant linking work.

Of course this particularly helps with Link Time Optimization, where
it prevents a double optimization of the whole kernel, but it's
midly beneficial on a standard build too.

This is a config option for now, but probably should be unconditional
at some point once all the architectures have been tested.
um support would need some extra work.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
2 files changed