svn commit: r209869 - head/lib/csu/powerpc64

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sat Jul 10 03:45:55 UTC 2010


Author: nwhitehorn
Date: Sat Jul 10 03:45:55 2010
New Revision: 209869
URL: http://svn.freebsd.org/changeset/base/209869

Log:
  C startup support for 64-bit PowerPC.
  
  Obtained from:	projects/ppc64

Added:
  head/lib/csu/powerpc64/
     - copied from r209845, head/lib/csu/powerpc/
Modified:
  head/lib/csu/powerpc64/Makefile
  head/lib/csu/powerpc64/crt1.c
  head/lib/csu/powerpc64/crti.S
  head/lib/csu/powerpc64/crtn.S

Modified: head/lib/csu/powerpc64/Makefile
==============================================================================
--- head/lib/csu/powerpc/Makefile	Fri Jul  9 11:27:33 2010	(r209845)
+++ head/lib/csu/powerpc64/Makefile	Sat Jul 10 03:45:55 2010	(r209869)
@@ -4,8 +4,9 @@
 
 SRCS=		crt1.c crti.S crtn.S
 OBJS=		${SRCS:N*.h:R:S/$/.o/g}
-OBJS+=		Scrt1.o gcrt1.o
-CFLAGS+=	-I${.CURDIR}/../common \
+OBJS+=		gcrt1.o
+CFLAGS+=	-Wall -Wno-unused \
+		-I${.CURDIR}/../common \
 		-I${.CURDIR}/../../libc/include
 
 all: ${OBJS}
@@ -15,9 +16,6 @@ CLEANFILES=	${OBJS}
 gcrt1.o: crt1.c
 	${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC}
 
-Scrt1.o: crt1.c
-	${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC}
-
 realinstall:
 	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
 	    ${OBJS} ${DESTDIR}${LIBDIR}

Modified: head/lib/csu/powerpc64/crt1.c
==============================================================================
--- head/lib/csu/powerpc/crt1.c	Fri Jul  9 11:27:33 2010	(r209845)
+++ head/lib/csu/powerpc64/crt1.c	Sat Jul 10 03:45:55 2010	(r209869)
@@ -59,6 +59,8 @@ extern int _DYNAMIC;
 extern void _fini(void);
 extern void _init(void);
 extern int main(int, char **, char **);
+extern void _start(int, char **, char **, const struct Struct_Obj_Entry *,
+    void (*)(void), struct ps_strings *);
 
 #ifdef GCRT
 extern void _mcleanup(void);
@@ -71,9 +73,6 @@ char **environ;
 const char *__progname = "";
 struct ps_strings *__ps_strings;
 
-void _start(int, char **, char **, const struct Struct_Obj_Entry *,
-    void (*)(void), struct ps_strings *);
-
 /* The entry function. */
 /*
  * First 5 arguments are specified by the PowerPC SVR4 ABI.

Modified: head/lib/csu/powerpc64/crti.S
==============================================================================
--- head/lib/csu/powerpc/crti.S	Fri Jul  9 11:27:33 2010	(r209845)
+++ head/lib/csu/powerpc64/crti.S	Sat Jul 10 03:45:55 2010	(r209869)
@@ -26,25 +26,36 @@
 	.section .init,"ax", at progbits
 	.align	2
 	.globl	_init
-	.type	_init, at function
+	.section ".opd","aw"
+	.align	3
 _init:
-	stwu 1,-16(1)
-	mflr 0
-	stw 31,12(1)
-	stw 0,20(1)
-	mr 31,1
+	.quad	._init,.TOC. at tocbase,0
+	.previous
 
+	.align 4
+	.global	._init
+	.type	._init, at function
+._init:
+	stdu 1,-48(1)
+	mflr 0
+	std 0,64(1)
 
 	.section .fini,"ax", at progbits
 	.align	2
 	.globl	_fini
+	.section ".opd","aw"
+	.align	3
 _fini:
-	stwu 1,-16(1)
-	mflr 0
-	stw 31,12(1)
-	stw 0,20(1)
-	mr 31,1
+	.quad	._fini,.TOC. at tocbase,0
+	.previous
 
+	.align 4
+	.global	._fini
+	.type	._fini, at function
+._fini:
+	stdu 1,-48(1)
+	mflr 0
+	std 0,64(1)
 
 	.section .rodata
 .ascii "$FreeBSD$\0"

Modified: head/lib/csu/powerpc64/crtn.S
==============================================================================
--- head/lib/csu/powerpc/crtn.S	Fri Jul  9 11:27:33 2010	(r209845)
+++ head/lib/csu/powerpc64/crtn.S	Sat Jul 10 03:45:55 2010	(r209869)
@@ -24,20 +24,16 @@
  */
 
 	.section .init,"ax", at progbits
-	lwz 11,0(1)
-	lwz 0,4(11)
+	ld %r1,0(%r1)
+	ld 0,16(%r1)
 	mtlr 0
-	lwz 31,-4(11)
-	mr 1,11
 	blr
 
 
 	.section .fini,"ax", at progbits
-	lwz 11,0(1)
-	lwz 0,4(11)
+	ld %r1,0(%r1)
+	ld 0,16(%r1)
 	mtlr 0
-	lwz 31,-4(11)
-	mr 1,11
 	blr
 
 


More information about the svn-src-all mailing list