summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/alpha')
-rw-r--r--libc/sysdeps/linux/alpha/Makefile27
-rw-r--r--libc/sysdeps/linux/alpha/crti.S43
-rw-r--r--libc/sysdeps/linux/alpha/crtn.S30
3 files changed, 99 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/alpha/Makefile b/libc/sysdeps/linux/alpha/Makefile
index 59a8ccaa9..0a85da17d 100644
--- a/libc/sysdeps/linux/alpha/Makefile
+++ b/libc/sysdeps/linux/alpha/Makefile
@@ -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
index 000000000..5c25539cd
--- /dev/null
+++ b/libc/sysdeps/linux/alpha/crti.S
@@ -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
index 000000000..c6fec15ba
--- /dev/null
+++ b/libc/sysdeps/linux/alpha/crtn.S
@@ -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"