OSDN Git Service

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

index 59a8cca..0a85da1 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=__longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \
     setjmp.S divl.S reml.S remq.S divq.S 
@@ -37,7 +38,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/
 
@@ -53,6 +54,30 @@ $(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/alpha/fpu_control.h $(TOPDIR)/include/
 
diff --git a/libc/sysdeps/linux/alpha/crti.S b/libc/sysdeps/linux/alpha/crti.S
new file mode 100644 (file)
index 0000000..5c25539
--- /dev/null
@@ -0,0 +1,43 @@
+       .set noat
+       .set noreorder
+       .set nomacro
+       .set    macro
+       
+       .section .init
+       .set    nomacro
+       .align 2
+       .globl _init
+       .ent _init
+_init:
+       .frame $30,0,$26,0
+       .mask 0x4000000,0
+       ldah $29,0($27)         !gpdisp!3
+       lda $29,0($29)          !gpdisp!3
+$_init..ng:
+       lda $30,-16($30)
+       stq $26,0($30)
+       .prologue 1
+       .set    macro
+       
+       .align 2
+       .end _init
+       
+       .section .fini
+       .set    nomacro
+       .align 2
+       .globl _fini
+       .ent _fini
+_fini:
+       .frame $30,0,$26,0
+       .mask 0x4000000,0
+       ldah $29,0($27)         !gpdisp!6
+       lda $29,0($29)          !gpdisp!6
+$_fini..ng:
+       lda $30,-16($30)
+       stq $26,0($30)
+       .prologue 1
+       .set    macro
+       .align 2
+       .end _fini
+       
+       .ident  "GCC: (GNU) 3.3.2"
diff --git a/libc/sysdeps/linux/alpha/crtn.S b/libc/sysdeps/linux/alpha/crtn.S
new file mode 100644 (file)
index 0000000..c6fec15
--- /dev/null
@@ -0,0 +1,30 @@
+       .set noat
+       .set noreorder
+       .set nomacro
+       .set    macro
+       
+       .section .init
+       .set    nomacro
+       .align 2
+       .globl _init
+       .ent _init
+       .set    nomacro
+       ldq $26,0($30)
+       lda $30,16($30)
+       ret $31,($26),1
+       .end _init
+       .set    macro
+       
+       .section .fini
+       .set    nomacro
+       .align 2
+       .globl _fini
+       .ent _fini
+       .set    nomacro
+       ldq $26,0($30)
+       lda $30,16($30)
+       ret $31,($26),1
+       .end _fini
+       .set    macro
+       
+       .ident  "GCC: (GNU) 3.3.2"