OSDN Git Service

Continue the conversion to using per-arch crti.S and crtn.S
authorEric Andersen <andersen@codepoet.org>
Wed, 5 Nov 2003 01:44:16 +0000 (01:44 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 5 Nov 2003 01:44:16 +0000 (01:44 -0000)
libc/sysdeps/linux/mips/Makefile
libc/sysdeps/linux/mips/crti.S [new file with mode: 0644]
libc/sysdeps/linux/mips/crtn.S [new file with mode: 0644]

index e363003..a10933c 100644 (file)
@@ -22,6 +22,7 @@ ASFLAGS=$(CFLAGS)
 
 CRT0_SRC = crt0.S
 CRT0_OBJ = crt0.o crt1.o
+CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
 
 SSRC=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S fork.S syscall.S pipe.S
 SOBJS=$(patsubst %.S,%.o, $(SSRC))
@@ -36,7 +37,7 @@ all: $(OBJS) $(LIBC)
 
 $(LIBC): ar-target 
 
-ar-target: $(OBJS) $(CRT0_OBJ)
+ar-target: $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS)
        $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
        cp $(CRT0_OBJ) $(TOPDIR)lib/
 
@@ -52,6 +53,31 @@ $(COBJS): %.o : %.c
        $(CC) $(CFLAGS) -c $< -o $@
        $(STRIPTOOL) -x -R .note -R .comment $*.o
 
+
+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
+crti.o: crti.S
+       $(CC) $(SAFECFLAGS) -c crti.S -o crti.o
+
+$(TOPDIR)lib/crti.o: crti.o
+       $(INSTALL) -d $(TOPDIR)lib/
+       cp crti.o $(TOPDIR)lib/
+
+crtn.o: crtn.S
+       $(CC) $(SAFECFLAGS) -c crtn.S -o crtn.o
+
+$(TOPDIR)lib/crtn.o: crtn.o
+       $(INSTALL) -d $(TOPDIR)lib/
+       cp crtn.o $(TOPDIR)lib/
+else
+$(TOPDIR)lib/crti.o:
+       $(INSTALL) -d $(TOPDIR)lib/
+       $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
+$(TOPDIR)lib/crtn.o:
+       $(INSTALL) -d $(TOPDIR)lib/
+       $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
+endif
+
+
 headers:
        $(LN) -fs ../libc/sysdeps/linux/mips/sgidefs.h $(TOPDIR)/include/
 #      $(LN) -fs ../libc/sysdeps/linux/mips/regdef.h $(TOPDIR)/include/
diff --git a/libc/sysdeps/linux/mips/crti.S b/libc/sysdeps/linux/mips/crti.S
new file mode 100644 (file)
index 0000000..b0d523b
--- /dev/null
@@ -0,0 +1,50 @@
+       .file   1 "initfini.c"
+       .section .mdebug.abi32
+       .previous
+       .abicalls
+#APP
+       
+       .section .init
+#NO_APP
+       .align  2
+       .globl  _init
+       .ent    _init
+       .type   _init, @function
+_init:
+       .frame  $sp,32,$31              # vars= 0, regs= 2/0, args= 16, extra= 8
+       .mask   0x90000000,-4
+       .fmask  0x00000000,0
+       .set    noreorder
+       .cpload $25
+       .set    reorder
+       subu    $sp,$sp,32
+       .cprestore 16
+       sw      $31,28($sp)
+       sw      $28,24($sp)
+#APP
+       
+       .align 2
+       .end _init
+       
+       .section .fini
+#NO_APP
+       .align  2
+       .globl  _fini
+       .ent    _fini
+       .type   _fini, @function
+_fini:
+       .frame  $sp,32,$31              # vars= 0, regs= 2/0, args= 16, extra= 8
+       .mask   0x90000000,-4
+       .fmask  0x00000000,0
+       .set    noreorder
+       .cpload $25
+       .set    reorder
+       subu    $sp,$sp,32
+       .cprestore 16
+       sw      $31,28($sp)
+       sw      $28,24($sp)
+#APP
+       .align 2
+       .end _fini
+       
+       .ident  "GCC: (GNU) 3.3.2"
diff --git a/libc/sysdeps/linux/mips/crtn.S b/libc/sysdeps/linux/mips/crtn.S
new file mode 100644 (file)
index 0000000..7a5e4db
--- /dev/null
@@ -0,0 +1,45 @@
+       .file   1 "initfini.c"
+       .section .mdebug.abi32
+       .previous
+       .abicalls
+#APP
+       
+       .section .init
+#NO_APP
+       .align  2
+       .globl  _init
+       .ent    _init
+       .type   _init, @function
+#NO_APP
+       lw      $31,28($sp)
+       #nop
+       .set    noreorder
+       .set    nomacro
+       j       $31
+       addu    $sp,$sp,32
+       .set    macro
+       .set    reorder
+
+       .end    _init
+#APP
+       
+       .section .fini
+#NO_APP
+       .align  2
+       .globl  _fini
+       .ent    _fini
+       .type   _fini, @function
+#NO_APP
+       lw      $31,28($sp)
+       #nop
+       .set    noreorder
+       .set    nomacro
+       j       $31
+       addu    $sp,$sp,32
+       .set    macro
+       .set    reorder
+
+       .end    _fini
+#APP
+       
+       .ident  "GCC: (GNU) 3.3.2"