kbuild: Generalize adding of additional sections to vmlinux
kallsyms needs to actually have a final vmlinux to extract the symbols, and then add this information as a new section to the final vmlinux. Currently, we basically just do the vmlinux link twice, adding .tmp_kallsyms.o the second time. However, it's actually possible to just link together the temporary vmlinux generated the first time and the new object file directly without going back to all the single parts that the temporary vmlinux was linked from. This mechanism should be useful for sparc as well, where the btfix mechanism needs an already linked vmlinux, too. IMPORTANT: This does only work as desired if the link script can be used recursively, i.e. ld <flags> -T arch/$(ARCH)/vmlinux.lds.s -o vmlinux.test vmlinux generates a vmlinux.test which is identical to vmlinux. arch/i386/vmlinux.lds.S needed a little tweaking, so probably the other archs do as well.
Showing
Please register or sign in to comment