init, fini, rtld_fini, stack_end) */
adrp x0,:got:PASCALMAIN
ldr x0,[x0,#:got_lo12:PASCALMAIN]
- adrp x3,:got:__libc_csu_init
- ldr x3,[x3,#:got_lo12:__libc_csu_init]
- adrp x4,:got:__libc_csu_fini
- ldr x4,[x4,#:got_lo12:__libc_csu_fini]
+ mov x3, #0
+ mov x4, #0
bl __libc_start_main
/* This should never happen */
/* Set up the other arguments in registers */
ldr a1, =PASCALMAIN
- ldr a4, =_init
+ ldr a4, = #0
/* Push fini */
- str ip, [sp, #-4]!
+ str a4, [sp, #-4]!
/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
{$asmmode att}
-procedure __libc_csu_init; cdecl; external;
-procedure __libc_csu_fini; cdecl; external;
procedure libc_start_main; external name '__libc_start_main';
procedure libc_exit(code: longint); cdecl; external name 'exit';
pushl %esp { stack_end }
pushl %edx { function to be registered with
atexit(), passed by loader }
- pushl $__libc_csu_fini
- pushl $__libc_csu_init
+ pushl $0
+ pushl $0
pushl %esi { Push second argument: argv. }
pushl %ecx { Push first argument: argc. }
pea (%sp) /* highest available stack address */
pea (%a1) /* termination function provided by kernel */
- pea __libc_csu_fini
- pea __libc_csu_init
+
+ clr.l -(%sp)
+ clr.l -(%sp)
+
pea (%a0) /* argv */
move.l %d0,-(%sp) /* argc */
pea PASCALMAIN
and $29, -2 * 4
subu $29, 32
- lw $7,%got(__libc_csu_init)($gp) /* init */
- lw $8,%got(__libc_csu_fini)($gp) /* fini */
+ move $7, $0
- sw $8, 16($29) /* fini */
+ sw $0, 16($29)
sw $2, 20($29) /* rtld_fini */
sw $29, 24($29) /* stack_end */
start_addresses:
.long _SDA_BASE_
.long main_stub
- .long __libc_csu_init
- .long __libc_csu_fini
+ .long 0
+ .long 0
.size start_adresses, .-start_addresses
.section ".text"
start_addresses:
.quad 0 /* was _SDA_BASE_ but not in 64-bit ABI*/
.quad main_stub
- .quad __libc_csu_init
- .quad __libc_csu_fini
+ .quad 0
+ .quad 0
.size start_adresses, .-start_addresses
/*
start_addresses:
.quad 0 /* was _SDA_BASE_ but not in 64-bit ABI*/
.quad main_stub
- .quad __libc_csu_init
- .quad __libc_csu_fini
+ .quad 0
+ .quad 0
.size start_adresses, .-start_addresses
/*
Process start/halt
******************************************************************************}
-procedure __libc_csu_init; cdecl; external;
-procedure __libc_csu_fini; cdecl; external;
-
procedure __libc_start_main(r3,r4,r5,r6,r7,r8,r9: pointer); cdecl; external;
var
end
= (sda_base: nil; {* was _SDA_BASE_ but not in 64-bit ABI }
main: @main_stub;
- libc_csu_init: @__libc_csu_init;
- libc_csu_fini: @__libc_csu_fini
+ libc_csu_init: pointer(0);
+ libc_csu_fini: pointer(0)
);
Process start/halt
******************************************************************************}
-procedure __libc_csu_init; cdecl; external;
-procedure __libc_csu_fini; cdecl; external;
-
procedure __libc_start_main(r3,r4,r5,r6,r7,r8,r9: pointer); cdecl; external;
type
end
= (sda_base: nil; {* was _SDA_BASE_ but not in 64-bit ABI }
main: @main_stub;
- libc_csu_init: @__libc_csu_init;
- libc_csu_fini: @__libc_csu_fini
+ libc_csu_init: pointer(0);
+ libc_csu_fini: pointer(0)
);
procedure call_libc_start_main(r3,r4,r5,r6,r7,r8,r9: pointer); cdecl;
which grow downwards). */
pushq %rsp
- /* Pass address of our own entry points to .fini and .init. */
- movq __libc_csu_init@GOTPCREL(%rip), %rcx
- movq __libc_csu_fini@GOTPCREL(%rip), %r8
+ xorl %r8d, %r8d
+ xorl %ecx, %ecx
movq main_stub@GOTPCREL(%rip), %rdi