arm: riscv: efi: Export _start symbol from crt0_*_efi stubs
authorSam Edwards <cfsworks@gmail.com>
Sat, 15 Mar 2025 22:18:09 +0000 (15:18 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 2 Apr 2025 20:33:50 +0000 (14:33 -0600)
commitf692540b24a7775e43f1d315d3e13a5d3ed21dd4
treedb338ac53dd7f68f2b0cd57e8649e7c8278c9027
parent586bb720e776396208df399874665ae8c6eb81e8
arm: riscv: efi: Export _start symbol from crt0_*_efi stubs

While the _start label is only intended for use locally to populate the
(hand-written) PE header, the linker script includes ENTRY(_start) which
designates it as the entry point in the output ELF, resulting in linker
warnings under some linkers (e.g. LLVM's lld) due to _start not being a
globally-visible symbol. Since  ELF is only an intermediary build
format, and the aforementioned PE header correctly points to _start, the
ENTRY(_start) directive could easily be removed to silence this warning.

However, since some developers who are debugging EFI by analyzing the
intermediary ELF may appreciate having correct entry-point information,
this patch instead promotes the _start labels to global symbols,
silencing the linker warning and making the intermediary ELF reflect the
true entry point.

This patch doesn't affect the final output binaries in any way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
arch/arm/lib/crt0_aarch64_efi.S
arch/arm/lib/crt0_arm_efi.S
arch/riscv/lib/crt0_riscv_efi.S