Clang will complain if main() is not declared with 0, 2, or 3 arguments. In order to allow an extra 4th parameter, a new weak main() symbol which just jumps to driver_main is defined, and _start passes the extra init pointer to main. Additionally, libc's crt0.s _start is made weak, and a matching _libc_crt0_start symbol is defined for implementations that wish to override _start but still call libc's _start. (Will be used by init.)
7 lines
100 B
ArmAsm
7 lines
100 B
ArmAsm
extern driver_main
|
|
global main:function weak (main.end - main)
|
|
main:
|
|
jmp driver_main
|
|
main.end:
|
|
|