]> Git Repo - uclibc-ng.git/commitdiff
Now works on StrongArm (using crt0.S) and arm7tdmi/uClinux with
authorEric Andersen <[email protected]>
Wed, 17 Jan 2001 10:37:05 +0000 (10:37 -0000)
committerEric Andersen <[email protected]>
Wed, 17 Jan 2001 10:37:05 +0000 (10:37 -0000)
the arm-pic-elf compiler (using crt0pic.S).
 -Erik

libc/sysdeps/linux/arm/Makefile
libc/sysdeps/linux/arm/crt0pic.S [new file with mode: 0644]

index c6505c93cfe4a6b55944c4e0bc5247f0d0c66c02..4b23adae70c2ca0e122f46836c933b10a87a0d95 100644 (file)
@@ -25,7 +25,14 @@ include $(TOPDIR)Rules.mak
 LIBC=$(TOPDIR)libc.a
 ASFLAGS=$(CFLAGS)
 
-CRT0=crt0.S
+TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
+
+ifeq ($(TARGET_MACHINE_TYPE),arm-pic-elf)
+    CRT0=crt0pic.S
+else
+    CRT0=crt0.S
+endif
+
 CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
 
 SSRC=longjmp.S setjmp.S
@@ -43,7 +50,7 @@ $(LIBC): ar-target
 
 ar-target: $(OBJS) $(CRT0_OBJ)
        $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
-       cp $(CRT0_OBJ) $(TOPDIR)$(CRT0_OBJ)
+       cp $(CRT0_OBJ) $(TOPDIR)crt0.o
 
 $(CRT0_OBJ): %.o : %.S
        $(CC) $(CFLAGS) -c $< -o $@
diff --git a/libc/sysdeps/linux/arm/crt0pic.S b/libc/sysdeps/linux/arm/crt0pic.S
new file mode 100644 (file)
index 0000000..8e22578
--- /dev/null
@@ -0,0 +1,74 @@
+.text\r
+       .align 2\r
+       .global __environ\r
+       .global _start\r
+       .global exit\r
+       .global main\r
+       .global __libc_init\r
+       .global __init_stdio\r
+       .global __stdio_close_all\r
+       .global _void_void_null_func\r
+\r
+       .type   _start,%function\r
+       .type   exit,%function\r
+       .type   main,%function\r
+       .type   __libc_init,%function\r
+       .type   __init_stdio,%function\r
+       .type   __stdio_close_all,%function\r
+       .type   _void_void_null_func,%function\r
+\r
+\r
+\r
+@ r0 = argc\r
+@ r1 = argv\r
+@ r2 = envp\r
+@ sl = data segment\r
+\r
+.text\r
+_start:\r
+       @ adjust the data segment base pointer\r
+       ldr r3,=__data_start\r
+       sub sl,sl,r3\r
+       mov r9,sl\r
+\r
+       ldr r3, .L3\r
+       str r2,[r9,r3]\r
+       ldr r0,[sp, #0]\r
+       ldr r1,[sp, #4]\r
+       ldr r2,[sp, #8]\r
+       \r
+       /* Tell libc to initialize whatever it needs */\r
+        bl __libc_init             \r
+        bl __init_stdio\r
+       bl      main\r
+/*     ldr r0,=0  */\r
+       bl      exit\r
+\r
+_void_void_null_func:\r
+       nop\r
+\r
+.weak __libc_init\r
+__libc_init = _void_void_null_func\r
+\r
+.weak __init_stdio\r
+__init_stdio = _void_void_null_func\r
+\r
+.weak __stdio_close_all\r
+__stdio_close_all = _void_void_null_func\r
+\r
+.align 2\r
+.L3:\r
+       .word environ\r
+\r
+\r
+.data\r
+       .align 2\r
+       .global __environ\r
+       \r
+__environ:  \r
+       .long 0\r
+\r
+.weak environ\r
+environ = __environ\r
+\r
+\r
This page took 0.028721 seconds and 4 git commands to generate.