kbuild: remove head-y syntax
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 24 Sep 2022 18:19:15 +0000 (03:19 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 2 Oct 2022 09:06:03 +0000 (18:06 +0900)
commitce697ccee1a8661da4e23fbe5f3d45d8d6922c20
tree3e4a66982f38b33d4c17b13a04161eb764bf6220
parent3216484550610470013b7ce1c9ed272da0a74589
kbuild: remove head-y syntax

Kbuild puts the objects listed in head-y at the head of vmlinux.
Conventionally, we do this for head*.S, which contains the kernel entry
point.

A counter approach is to control the section order by the linker script.
Actually, the code marked as __HEAD goes into the ".head.text" section,
which is placed before the normal ".text" section.

I do not know if both of them are needed. From the build system
perspective, head-y is not mandatory. If you can achieve the proper code
placement by the linker script only, it would be cleaner.

I collected the current head-y objects into head-object-list.txt. It is
a whitelist. My hope is it will be reduced in the long run.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
24 files changed:
Documentation/kbuild/makefiles.rst
Makefile
arch/alpha/Makefile
arch/arc/Makefile
arch/arm/Makefile
arch/arm64/Makefile
arch/csky/Makefile
arch/hexagon/Makefile
arch/ia64/Makefile
arch/loongarch/Makefile
arch/m68k/Makefile
arch/microblaze/Makefile
arch/mips/Makefile
arch/nios2/Makefile
arch/openrisc/Makefile
arch/parisc/Makefile
arch/powerpc/Makefile
arch/riscv/Makefile
arch/s390/Makefile
arch/sh/Makefile
arch/sparc/Makefile
arch/x86/Makefile
arch/xtensa/Makefile
scripts/head-object-list.txt [new file with mode: 0644]