summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/arm/crt0.S')
-rw-r--r--libc/sysdeps/linux/arm/crt0.S66
1 files changed, 66 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/arm/crt0.S b/libc/sysdeps/linux/arm/crt0.S
new file mode 100644
index 000000000..3944bd34c
--- /dev/null
+++ b/libc/sysdeps/linux/arm/crt0.S
@@ -0,0 +1,66 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+
+#define BASEREG r9
+
+@ r0 = argc
+@ r1 = argv
+@ r2 = envp
+@ sl = data segment
+
+
+
+ .text
+ .align 2
+ .global _start, exit, main
+ .type _start,%function
+
+.text
+_start:
+ @ adjust the data sgement base pointer
+ ldr r3,=__data_start
+ sub sl,sl,r3
+ mov BASEREG,sl
+
+ ldr r3, .L3
+ str r2,[BASEREG,r3]
+ ldr r0,[sp, #0]
+ ldr r1,[sp, #4]
+ ldr r2,[sp, #8]
+ bl main
+ ldr r0,=0
+ bl exit
+
+
+.L3: .word environ
+
+
+ .data
+ .align 2
+ .global __errno, __environ
+
+__environ: .long 0
+.weak environ
+environ = __environ
+
+__errno: .long 0
+.weak errno
+errno = __errno
+
+