summaryrefslogtreecommitdiffstats
path: root/linker/arch
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commita27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 (patch)
treedefd1cc07d16ad2f3b21154114e092d11c94c5bb /linker/arch
downloadbionic-a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349.zip
bionic-a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349.tar.gz
bionic-a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349.tar.bz2
Initial Contributionandroid-1.0
Diffstat (limited to 'linker/arch')
-rw-r--r--linker/arch/arm/begin.S17
-rw-r--r--linker/arch/x86/begin.S23
2 files changed, 40 insertions, 0 deletions
diff --git a/linker/arch/arm/begin.S b/linker/arch/arm/begin.S
new file mode 100644
index 0000000..f9b3bac
--- /dev/null
+++ b/linker/arch/arm/begin.S
@@ -0,0 +1,17 @@
+ .text
+ .align 4
+ .type _start,#function
+ .globl _start
+
+_start:
+ mov r0, sp
+ mov r1, #0
+ bl __linker_init
+
+ /* linker init returns the _entry address in the main image */
+ mov pc, r0
+
+ .section .ctors, "wa"
+ .globl __CTOR_LIST__
+__CTOR_LIST__:
+ .long -1
diff --git a/linker/arch/x86/begin.S b/linker/arch/x86/begin.S
new file mode 100644
index 0000000..8f468e6
--- /dev/null
+++ b/linker/arch/x86/begin.S
@@ -0,0 +1,23 @@
+.text
+.align 4
+.type _start, @function
+.globl _start
+
+_start:
+ /* save the elfdata ptr to %eax, AND push it onto the stack */
+ mov %esp, %eax
+ pushl %esp
+
+ pushl %eax
+ call __linker_init
+
+ /* linker init returns (%eax) the _entry address in the main image */
+ /* entry point expects sp to point to elfdata */
+ popl %esp
+ jmp *%eax
+
+.section .ctors, "wa"
+.globl __CTOR_LIST__
+
+__CTOR_LIST__:
+ .long -1