mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 15:59:30 +02:00
* Do not use persistent register r5 in the library init code. It fixes crash during library load on some versions of Android. Issue #23974.
* Made the startup code Thumb-safe. git-svn-id: trunk@23694 -
This commit is contained in:
parent
63d1c3aa94
commit
5d061a7efa
@ -30,17 +30,17 @@ FPC_SHARED_LIB_START:
|
||||
|
||||
/* Get environment info from libc */
|
||||
ldr ip,=environ
|
||||
ldr r5,[ip]
|
||||
ldr r0,[ip]
|
||||
ldr ip,=operatingsystem_parameter_envp
|
||||
str r5,[ip]
|
||||
str r0,[ip]
|
||||
|
||||
/* Register exit handler. It is called only when the main process terminates */
|
||||
ldr r0,=FPC_LIB_EXIT
|
||||
bl atexit
|
||||
blx atexit
|
||||
|
||||
/* call main and exit normally */
|
||||
bl PASCALMAIN
|
||||
ldmdb fp, {fp, sp, pc}
|
||||
blx PASCALMAIN
|
||||
ldmea fp, {fp, sp, pc}
|
||||
|
||||
/* --------------------------------------------------------- */
|
||||
.globl _haltproc
|
||||
@ -52,7 +52,8 @@ _haltproc_eabi:
|
||||
ldr r0,=operatingsystem_result
|
||||
ldr r0,[r0]
|
||||
/* Go to libc exit() */
|
||||
b exit
|
||||
ldr ip,=exit
|
||||
bx ip
|
||||
|
||||
/* --------------------------------------------------------- */
|
||||
.data
|
||||
|
@ -57,7 +57,8 @@ _fpc_start:
|
||||
str r5,[ip]
|
||||
|
||||
/* Finally go to libc startup code. It will call "PASCALMAIN" via alias "main" */
|
||||
b _start
|
||||
ldr ip,=_start
|
||||
bx ip
|
||||
|
||||
/* --------------------------------------------------------- */
|
||||
.globl _haltproc
|
||||
@ -69,7 +70,8 @@ _haltproc_eabi:
|
||||
ldr r0,=operatingsystem_result
|
||||
ldr r0,[r0]
|
||||
/* Go to libc exit() */
|
||||
b exit
|
||||
ldr ip,=exit
|
||||
bx ip
|
||||
|
||||
/* --------------------------------------------------------- */
|
||||
.data
|
||||
|
Loading…
Reference in New Issue
Block a user