PERFORCE change 139929 for review

Warner Losh imp at FreeBSD.org
Sat Apr 12 20:17:13 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=139929

Change 139929 by imp at imp_lighthouse on 2008/04/12 20:16:21

	
	Move from sgi mips stuff to trad mips stuff.  The formats are
	nearly identical, but tradmips is what Linux, NetBSD and
	OpenBSD all use.  This also adds support to generate n32 and
	64 (aka n64) ABI binaries, but there's a lot of work needed to
	make these work (including some kernel work).  Binaries
	generated with the 32 ABI (aka o32) seem to work.
	
	Hopefully, this won't reveal other, nastier bugs like the
	"second identical string" bug we hit in gas a while back.

Affected files ...

.. //depot/projects/mips2-jnpr/src/contrib/binutils/bfd/config.bfd#2 edit
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32bmip.sh#2 edit
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32bmipn32-defs.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32bmipn32.sh#2 edit
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32btsmip.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32btsmipn32.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32ltsmip.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32ltsmipn32.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf64btsmip.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf64ltsmip.sh#1 add
.. //depot/projects/mips2-jnpr/src/contrib/gcc/config/mips/freebsd.h#2 edit
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h#2 edit
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h#2 edit
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/Makefile.arm#2 edit
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/Makefile.mips#2 edit
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/elf32btsmip_fbsd.sh#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/elf32ltsmip_fbsd.sh#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/elf64btsmip_fbsd.sh#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/elf64ltsmip_fbsd.sh#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/ldgram.c#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/ldgram.h#1 add
.. //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/libbfd/Makefile.mips#3 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/contrib/binutils/bfd/config.bfd#2 (text+ko) ====

@@ -769,8 +769,8 @@
     targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
     ;;
   mips*-*-freebsd*)
-    targ_defvec=bfd_elf32_bigmips_vec
-    targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
+    targ_defvec=bfd_elf32_tradbigmips_vec
+    targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
     ;;
   mips*-*-netbsd*)
     targ_defvec=bfd_elf32_bigmips_vec

==== //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32bmip.sh#2 (text+ko) ====

@@ -10,6 +10,7 @@
 MAXPAGESIZE=0x40000
 COMMONPAGESIZE=0x1000
 NONPAGED_TEXT_START_ADDR=0x0400000
+SHLIB_TEXT_START_ADDR=0x5ffe0000
 test -n "${EMBEDDED}" || TEXT_DYNAMIC=
 INITIAL_READONLY_SECTIONS="
   .reginfo      ${RELOCATING-0} : { *(.reginfo) }

==== //depot/projects/mips2-jnpr/src/contrib/binutils/ld/emulparams/elf32bmipn32.sh#2 (text+ko) ====

@@ -2,6 +2,7 @@
 OUTPUT_FORMAT="elf32-nbigmips"
 BIG_OUTPUT_FORMAT="elf32-nbigmips"
 LITTLE_OUTPUT_FORMAT="elf32-nlittlemips"
+SHLIB_TEXT_START_ADDR=0x5ffe0000
 COMMONPAGESIZE=0x1000
 
 # IRIX6 defines these symbols.  0x34 is the size of the ELF header.

==== //depot/projects/mips2-jnpr/src/contrib/gcc/config/mips/freebsd.h#2 (text+ko) ====

@@ -33,6 +33,8 @@
 #define MACHINE_TYPE "FreeBSD/mipsel ELF"
 #endif
 
+#define MIPS_ABI_DEFAUL ABI_32
+
 #ifdef LIB_SPEC
 #undef LIB_SPEC
 #define LIB_SPEC	FBSD_LIB_SPEC

==== //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/as/mips-freebsd/itbl-cpu.h#2 (text+ko) ====

@@ -15,3 +15,5 @@
 /* Allow use of E_MIPS_ABI_O32 on MIPS targets.  */
 #define USE_E_MIPS_ABI_O32 1
 
+/* Use traditional mips */
+#define TE_TMIPS 1

==== //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/as/mips-freebsd/targ-cpu.h#2 (text+ko) ====

@@ -1,2 +1,4 @@
 /* $FreeBSD$ */
+#define TE_TMIPS 1
+
 #include "tc-mips.h"

==== //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/Makefile.arm#2 (text+ko) ====

@@ -1,5 +1,6 @@
 # $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile.arm,v 1.3 2006/09/14 07:44:05 imp Exp $
 
+# xxxIMPxxx: should use arm and armeb for this, ala netbsd.
 .if defined(TARGET_BIG_ENDIAN)
 NATIVE_EMULATION= armelfb_fbsd
 .else

==== //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/ld/Makefile.mips#2 (text+ko) ====

@@ -1,14 +1,24 @@
 # $FreeBSD$
 
-NATIVE_EMULATION= elf32bmip_fbsd
+#xxxIMPxxx: size?
+#xxxIMPxxx: TARGET_BIG_ENDIAN is lame.  We should use the netbsd convention
+# of mipsel and mips.
+_sz?=32
+.if defined(TARGET_BIG_ENDIAN)
+NATIVE_EMULATION=elf${_sz}btsmip_fbsd
+.else
+NATIVE_EMULATION=elf${_sz}ltsmip_fbsd
+.endif
 
 SRCS+=	e${NATIVE_EMULATION}.c 
 CLEANFILES+=	e${NATIVE_EMULATION}.c
 
-e${NATIVE_EMULATION}.c:	emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
+# nb: elf32 handles both elf32 and elf64 targets
+e${NATIVE_EMULATION}.c:	${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \
     scripttempl/elf.sc genscripts.sh stringify.sed
 	sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \
 	    ${TOOLS_PREFIX}/usr \
 	    ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
-	    ${NATIVE_EMULATION} ""  no ${NATIVE_EMULATION} ${TARGET_TUPLE}
+	    ${NATIVE_EMULATION} ""  no ${NATIVE_EMULATION} ${TARGET_TUPLE} \
+	    ${.CURDIR}/${NATIVE_EMULATION}.sh
 

==== //depot/projects/mips2-jnpr/src/gnu/usr.bin/binutils/libbfd/Makefile.mips#3 (text+ko) ====

@@ -1,6 +1,7 @@
 # $FreeBSD$
 
-DEFAULT_VECTOR=	bfd_elf32_bigmips_vec
+#xxxIMPxxx: endian and size
+DEFAULT_VECTOR=	bfd_elf32_tradbigmips_vec
 
 SRCS+=	coff-mips.c \
 	cpu-mips.c \
@@ -8,6 +9,7 @@
 	ecofflink.c \
 	elf32.c \
 	elf64.c \
+	elfn32-mips.c \
 	elf32-mips.c \
 	elf64-mips.c \
 	elfxx-mips.c \
@@ -15,7 +17,11 @@
 	elf64-target.h \
 	elflink.c
 
-VECS=	${DEFAULT_VECTOR} \
-	bfd_elf32_littlemips_vec \
-	bfd_elf64_bigmips_vec \
-	bfd_elf64_littlemips_vec
+VECS=	bfd_elf32_tradbigmips_vec \
+	bfd_elf32_tradlittlemips_vec \
+	bfd_elf32_ntradbigmips_vec \
+	bfd_elf32_ntradlittlemips_vec \
+	bfd_elf64_tradbigmips_vec \
+	bfd_elf64_tradlittlemips_vec \
+	ecoff_little_vec \
+	ecoff_big_vec


More information about the p4-projects mailing list