Quellcode durchsuchen

--- Merging r16981 into '.':
U rtl/linux/arm/dllprt0.as
--- Merging r16982 into '.':
G rtl/linux/arm/dllprt0.as
--- Merging r17033 into '.':
G rtl/linux/arm/dllprt0.as
--- Merging r17254 into '.':
G rtl/linux/arm/dllprt0.as

# revisions: 16981,16982,17033,17254
------------------------------------------------------------------------
r16981 | tom_at_work | 2011-02-22 23:32:44 +0100 (Tue, 22 Feb 2011) | 1 line
Changed paths:
M /trunk/rtl/linux/arm/dllprt0.as

Set up environment variables and call Pascal initialization in arm/linux shared library initialization
------------------------------------------------------------------------
------------------------------------------------------------------------
r16982 | tom_at_work | 2011-02-23 10:41:19 +0100 (Wed, 23 Feb 2011) | 1 line
Changed paths:
M /trunk/rtl/linux/arm/dllprt0.as

Correctly return to caller in ARM/Linux shared library startup code instead of fall-through to system exit.
------------------------------------------------------------------------
------------------------------------------------------------------------
r17033 | tom_at_work | 2011-02-27 18:22:29 +0100 (Sun, 27 Feb 2011) | 1 line
Changed paths:
M /trunk/rtl/linux/arm/dllprt0.as

Fixed argc/argv/envp for arm/linux shared libraries. They are by default in registers a1/a2/a3 as per ABI: the first arguments when calling a method (in this case the FPC_SHARED_LIB_START) are passed via registers, not on the stack.
------------------------------------------------------------------------
------------------------------------------------------------------------
r17254 | florian | 2011-04-05 21:42:36 +0200 (Tue, 05 Apr 2011) | 1 line
Changed paths:
M /trunk/rtl/linux/arm/dllprt0.as

* fix compilation of dllprt0.as for older arm assemblers without push support
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17591 -

marco vor 14 Jahren
Ursprung
Commit
8ea2b75636
1 geänderte Dateien mit 33 neuen und 1 gelöschten Zeilen
  1. 33 1
      rtl/linux/arm/dllprt0.as

+ 33 - 1
rtl/linux/arm/dllprt0.as

@@ -1,5 +1,36 @@
-.file   "androidprt0.as"
+.file   "dllprt0.as"
 .text
+        .globl  _startlib
+        .type   _startlib,#function
+_startlib:
+        .globl  FPC_SHARED_LIB_START
+        .type   FPC_SHARED_LIB_START,#function
+FPC_SHARED_LIB_START:
+        mov ip, sp
+        stmfd sp!,{fp, ip, lr, pc}
+        sub fp, ip, #4
+
+        /* a1 contains argc, a2 contains argv and a3 contains envp */
+        ldr ip, =operatingsystem_parameter_argc
+        str a1, [ip]
+
+        ldr ip, =operatingsystem_parameter_argv
+        str a2, [ip]
+
+        ldr ip, =operatingsystem_parameter_envp
+        str a3, [ip]
+
+        /* save initial stackpointer */
+        ldr ip, =__stklen
+        str sp, [ip]
+
+        ldr ip, =TC_SYSTEM_ISLIBRARY
+        mov a1, #1
+        str a1, [ip]
+
+        /* call main and exit normally */
+        bl PASCALMAIN
+        ldmdb fp, {fp, sp, pc}
 
         .globl  _haltproc
         .type   _haltproc,#function
@@ -32,3 +63,4 @@ operatingsystem_parameters:
 .bss
 
         .comm __stkptr,4
+