Skip to content
Commit 4827721e authored by Peter Hoyes's avatar Peter Hoyes Committed by Leandro Belli
Browse files

arch/aarch64: Add support for FWK_CONSTRUCTOR functions



Certain SCP-firmware framework functionality (notifications, time,
buffered logging) requires initializers that run before arm_main(),
using the FWK_CONSTRUCTOR attribute.

Newlib provides __libc_init_array to iterate and call these, so add
this to arch_crt0.s, so long as Newlib is being used.

__libc_init_array calls _init, which is defined in crti, which is
linked by default by GCC but must be manually linked when using
Clang. Therefore add the path of crti to the Clang linker flags.

Add a note to aarch64.md about the Newlib requirement to use
FWK_CONSTRUCTOR attributes.

Signed-off-by: Peter Hoyes's avatarPeter Hoyes <peter.hoyes@arm.com>
parent 7c00612f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment