mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 07:09:18 +02:00
* equivalent of r32525/32526 for the assembler version of the startup code
git-svn-id: trunk@32528 -
This commit is contained in:
parent
2249d95ddb
commit
f65cb5d933
@ -324,17 +324,33 @@ _restvr_31: addi r12,r0,-16
|
|||||||
* Main program entry point for dynamic executables.
|
* Main program entry point for dynamic executables.
|
||||||
*
|
*
|
||||||
* r7 contains the function pointer that needs to be registered for calling at exit.
|
* r7 contains the function pointer that needs to be registered for calling at exit.
|
||||||
|
* r3/r4/r5 contain argc/argv/envp
|
||||||
*/
|
*/
|
||||||
FUNCTION_PROLOG _dynamic_start
|
FUNCTION_PROLOG _dynamic_start
|
||||||
LOAD_64BIT_VAL 11, __dl_fini
|
LOAD_64BIT_VAL 11, __dl_fini
|
||||||
std 7,0(11)
|
std 7,0(11)
|
||||||
LOAD_64BIT_VAL 11, _start
|
LOAD_64BIT_VAL 11, PASCALMAIN
|
||||||
/* do not bother loading the actual function address of _start. We can directly jump to it */
|
/* set up GOT pointer from PASCALMAIN */
|
||||||
/* set up GOT pointer from original start function */
|
|
||||||
ld 2,8(11)
|
ld 2,8(11)
|
||||||
/* and environment pointer */
|
/* and environment pointer */
|
||||||
ld 11,16(11)
|
ld 11,16(11)
|
||||||
b _start
|
/* store argument count */
|
||||||
|
LOAD_64BIT_VAL 10,operatingsystem_parameter_argc
|
||||||
|
stw 3,0(10)
|
||||||
|
/* store argument address */
|
||||||
|
LOAD_64BIT_VAL 10,operatingsystem_parameter_argv
|
||||||
|
std 4,0(10)
|
||||||
|
/* store environment pointer */
|
||||||
|
std 5,0(10)
|
||||||
|
|
||||||
|
LOAD_64BIT_VAL 8,__stkptr
|
||||||
|
std 1,0(8)
|
||||||
|
|
||||||
|
bl PASCALMAIN
|
||||||
|
nop
|
||||||
|
|
||||||
|
/* we should not reach here. Crash horribly */
|
||||||
|
trap
|
||||||
.long 0
|
.long 0
|
||||||
.byte 0, 12, 64, 0, 0, 0, 0, 0
|
.byte 0, 12, 64, 0, 0, 0, 0, 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user