Subject: Thanks and ... Was: MIPS, VM and exception handling?
To: None <port-pmax@sun-lamp.cs.berkeley.edu>
From: Andrew Cagney <cagney@highland.oz.au>
List: port-pmax
Date: 08/04/1994 13:33:25
Hello,

Thanks for all the responses to my MIPS question.  I'm now very
enlightened.  It's going to be useful for the work i'm (slowly) doing.

Any way, 

Excerpts from mail: 4-Aug-94 good news Adam Glass@microsoft.com (446)

> binaries progress: gas/gcc seem happy now.  ld is the next target and 
> should be relatively uneventful.

In return (?), who ever is doing your ld may be interested in the
patches below to binutils-2.* (ld et.al.).  They allow bunutils to be
targeted at aout-mips-netbsd from (at least) a   netbsd-386 host. 
Assuming that you've used gas-2.*, binutils can be compiled by droping
in the directories binutils & ld and applying these patches.

They are relativly uneventful. Your A.OUT`s may differ ...

If you find bugs, please let me know.

					enjoy, Andrew

PPS:  I've included an interesting patch to objdump.  The assembler
below could cause a crash ...

	# Bug-1, crash when only one symbol on object file
	.text
		.long 0
	a:
	.data
		.long a

----

*** 1.1	1994/05/30 19:14:17
--- ld/Makefile.in	1994/08/01 01:27:47
***************
*** 180,185 ****
--- 180,186 ----
  	ehppaelf.o emipsidtl.o esh.o eelf_i386.o ealpha.o \
  	ei386lynx.o em68klynx.o esparclynx.o ecoff_sparc.o \
  	eelf32ppc.o ei386go32.o em68kaout.o \
+ 	enetbsdi386.o enetbsdppc.o enetbsdmips.o \
  	$(OTHER_EMULATIONS)
  
  # This is now set by configure.in.
***************
*** 392,397 ****
--- 393,409 ----
  em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
    $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} m68kaout
+ enetbsdi386.c: $(srcdir)/emulparams/netbsdi386.sh \
+   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} netbsdi386
+ enetbsdppc.c: $(srcdir)/emulparams/netbsdppc.sh \
+   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} netbsdppc
+ enetbsdmips.c: $(srcdir)/emulparams/netbsdmips.sh \
+   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} netbsdmips
+ 
+ 
  
  $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
  	$(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB)
$(LIBIBERTY) $(EXTRALIBS)
*** 1.1	1994/05/30 18:39:56
--- ld/configure.in	1994/05/31 00:49:10
***************
*** 38,43 ****
--- 38,53 ----
  for targ in $target $canon_targets
  do
  
+         if [ "x$targ" = "x$target" ]; then
+             cpu=$target_cpu
+ 	    vendor=$target_vendor
+ 	    os=$target_os
+         else
+             cpu=`echo $targ | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
+             vendor=`echo $targ | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
+             os=`echo $targ | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+         fi
+ 
  case "${targ}" in
  
    sparc-sun-sunos4*) 	ld_target=sun4 ;;
***************
*** 105,113 ****
    alpha-*-netware*)	ld_target=alpha ;;
    z8k-*-sim | z8k-*-coff) ld_target=z8ksim ;;
    powerpc-*-elf*)	ld_target=ppc-elf32 ;;
!   *-*-aout)		ld_target=${target_cpu}-${target_vendor} ;;
!   *-*-coff)		ld_target=${target_cpu}-${target_vendor} ;;
!   *-*-netware)		ld_target=${target_cpu}-elf ;;
  
    all)			ld_target=all ;;
  esac
--- 115,126 ----
    alpha-*-netware*)	ld_target=alpha ;;
    z8k-*-sim | z8k-*-coff) ld_target=z8ksim ;;
    powerpc-*-elf*)	ld_target=ppc-elf32 ;;
!   powerpc-*-netbsd*)	ld_target=ppc-netbsd ;;
!   *-*-aout)		ld_target=${cpu}-${vendor} ;;
!   *-*-coff)		ld_target=${cpu}-${vendor} ;;
!   *-*-elf*)		ld_target=${cpu}-elf32 ;;
!   *-*-netbsd*)		ld_target=${cpu}-netbsd ;;
!   *-*-netware)		ld_target=${cpu}-elf ;;
  
    all)			ld_target=all ;;
  esac
*** 1.1	1994/08/02 06:47:07
--- binutils/objdump.c	1994/08/02 06:55:43
***************
*** 408,417 ****
  	  {
  	    if (syms[i]->value != syms[thisplace]->value)
  	      {
- 		i--;
  		break;
  	      }
  	  }
  	for (; i >= 0; i--)
  	  {
  	    if (syms[i]->section == aux->sec)
--- 408,418 ----
  	  {
  	    if (syms[i]->value != syms[thisplace]->value)
  	      {
  		break;
  	      }
  	  }
+ 	i--;
+ 	/* Assert: i in [thisplace,symcount), i->value == thisplace->value */
  	for (; i >= 0; i--)
  	  {
  	    if (syms[i]->section == aux->sec)
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/config/i386-netbsd.mt	Mon May 30 12:16:23 1994
***************
*** 0 ****
--- 1 ----
+ EMUL=netbsdi386
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/config/mips-netbsd.mt	Sun Jul 31 18:25:10 1994
***************
*** 0 ****
--- 1 ----
+ EMUL=netbsdmips
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/config/ppc-netbsd.mt	Mon May 30 12:16:47 1994
***************
*** 0 ****
--- 1 ----
+ EMUL=netbsdppc
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/emulparams/netbsd.h.sh	Sat Jun 18 20:47:54 1994
***************
*** 0 ****
--- 1,4 ----
+ SCRIPT_NAME=aout
+ PAGE_SIZE=0x1000
+ TEXT_START_ADDR=0x1020
+ NONPAGED_TEXT_START_ADDR=0x1000
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/emulparams/netbsdi386.sh	Sat Jun 18 17:47:26 1994
***************
*** 0 ****
--- 1,3 ----
+ . ${srcdir}/emulparams/netbsd.h.sh
+ OUTPUT_FORMAT="a.out-i386-netbsd"
+ ARCH=i386
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/emulparams/netbsdmips.sh	Sun Jul 31 18:26:53 1994
***************
*** 0 ****
--- 1,3 ----
+ . ${srcdir}/emulparams/netbsd.h.sh
+ OUTPUT_FORMAT="a.out-mips-netbsd"
+ ARCH=mips
*** /dev/null	Thu Aug  4 12:43:40 1994
--- ld/emulparams/netbsdppc.sh	Sat Jun 18 17:47:00 1994
***************
*** 0 ****
--- 1,3 ----
+ . ${srcdir}/emulparams/netbsd.h.sh
+ OUTPUT_FORMAT="a.out-powerpc-netbsd"
+ ARCH=powerpc

------------------------------------------------------------------------------