public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* patches to add mips-dec-netbsd configuration
@ 1995-09-18  2:02 Arne H. Juul
  1995-09-18 11:48 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Arne H. Juul @ 1995-09-18  2:02 UTC (permalink / raw)
  To: gas2

For some time now I've been using binutils snapshots successfully on
NetBSD/pmax, aka mips-dec-netbsd.  These patches are against 950909 but
should work with the current version as well.

Most of the patches only add recognizing the name to be handled
like mips*el-*-elf.

However, there is one patch to elf.c that modifies ld behaviour on
linking: don't merge together readonly and writable object sections
into one program segment.  I think this patch is OK on other systems
as well, but in the long term better control on the relationship
between sections and segments is probably desirable.  If you don't
like this part I hope you will merge in the rest anyway - the elf.c
part is only needed to link the NetBSD kernel.

Yours,

  -  Arne H. J.


diff -ru gas-950909.orig/bfd/elf.c ./bfd/elf.c
--- gas-950909.orig/bfd/elf.c	Sat Sep  9 10:18:17 1995
+++ ./bfd/elf.c	Sat Sep 16 21:56:26 1995
@@ -1706,7 +1706,9 @@
       if (phdr->p_type != PT_NULL
 	  && (hdr->sh_offset - (phdr->p_offset + phdr->p_memsz)
 	      == hdr->sh_addr - (phdr->p_vaddr + phdr->p_memsz))
-	  && (last_type != SHT_NOBITS || hdr->sh_type == SHT_NOBITS))
+	  && (last_type != SHT_NOBITS || hdr->sh_type == SHT_NOBITS)
+	  && ((phdr->p_flags & PF_W ) || !(hdr->sh_flags & SHF_WRITE)))
+
 	{
 	  bfd_size_type adjust;
 
diff -ru gas-950909.orig/bfd/config.bfd ./bfd/config.bfd
--- gas-950909.orig/bfd/config.bfd	Sat Sep  9 10:18:14 1995
+++ ./bfd/config.bfd	Sat Sep 16 21:56:26 1995
@@ -271,6 +271,10 @@
     targ_defvec=ecoff_big_vec
     targ_selvecs=ecoff_little_vec
     ;;
+  mips-dec-netbsd*)
+    targ_defvec=bfd_elf32_littlemips_vec
+    targ_selvecs=bfd_elf32_bigmips_vec
+    ;;
   mips*-dec-bsd*)
     targ_defvec=aout_mips_little_vec
     targ_underscore=yes
diff -ru gas-950909.orig/bfd/configure ./bfd/configure
--- gas-950909.orig/bfd/configure	Sat Sep  9 10:18:16 1995
+++ ./bfd/configure	Sat Sep 16 21:56:26 1995
@@ -1052,6 +1052,8 @@
 EOF
 
 	;;
+  mips-dec-netbsd*)
+	;;
   mips-dec-*)
 	COREFILE=trad-core.o
 	cat >> confdefs.h <<\EOF
diff -ru gas-950909.orig/bfd/configure.host ./bfd/configure.host
--- gas-950909.orig/bfd/configure.host	Thu Sep  7 00:50:36 1995
+++ ./bfd/configure.host	Sat Sep 16 21:56:26 1995
@@ -53,6 +53,7 @@
 			RANLIB=${RANLIB-i386-win32-ranlib}
 			;;
 
+mips-dec-netbsd*)	;;
 mips-dec-*)		HDEFINES="-G 4"	;;
 mips-sgi-irix3*)	HDEFINES="-G 4"
 			test -z "$LDFLAGS" && LDFLAGS=-lmalloc
diff -ru gas-950909.orig/bfd/configure.in ./bfd/configure.in
--- gas-950909.orig/bfd/configure.in	Sat Sep  9 10:18:15 1995
+++ ./bfd/configure.in	Sat Sep 16 21:56:26 1995
@@ -158,6 +158,8 @@
 	COREFILE=trad-core.o
 	AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
 	;;
+  mips-dec-netbsd*)
+	;;
   mips-dec-*)
 	COREFILE=trad-core.o
 	AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
diff -ru gas-950909.orig/gas/configure ./gas/configure
--- gas-950909.orig/gas/configure	Sat Sep  9 10:22:20 1995
+++ ./gas/configure	Sat Sep 16 21:56:26 1995
@@ -729,6 +729,7 @@
       m88k-*-coff*)         fmt=coff targ=m88kcoff ;;
 
       # don't change em like *-*-bsd does
+      mips-dec-netbsd*)     fmt=elf targ=mips-lit endian=little ;;
       mips-dec-bsd*)        fmt=aout targ=mips-lit ;;
       mips-sony-bsd*)       fmt=ecoff targ=mips-big ;;
       mips-*-bsd*)          { echo "configure: error: Unknown vendor for mips-bsd configuration." 1>&2; exit 1; } ;;
diff -ru gas-950909.orig/gas/configure.in ./gas/configure.in
--- gas-950909.orig/gas/configure.in	Sat Sep  9 10:22:19 1995
+++ ./gas/configure.in	Sat Sep 16 21:56:26 1995
@@ -202,6 +202,7 @@
       m88k-*-coff*)         fmt=coff targ=m88kcoff ;;
 
       # don't change em like *-*-bsd does
+      mips-dec-netbsd*)     fmt=elf targ=mips-lit endian=little ;;
       mips-dec-bsd*)        fmt=aout targ=mips-lit ;;
       mips-sony-bsd*)       fmt=ecoff targ=mips-big ;;
       mips-*-bsd*)          AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
diff -ru gas-950909.orig/ld/configure.tgt ./ld/configure.tgt
--- gas-950909.orig/ld/configure.tgt	Sat Sep  9 10:24:55 1995
+++ ./ld/configure.tgt	Sat Sep 16 21:56:26 1995
@@ -95,6 +95,7 @@
 mips*el-*-ecoff*)	targ_emul=mipsidtl ;;
 mips*-*-ecoff*)		targ_emul=mipsidt ;;
 mips*-dec-bsd*)		targ_emul=mipsbsd ;;
+mips-dec-netbsd*)	targ_emul=elf32lmip ;;
 mips*-*-bsd*)		targ_emul=mipsbig ;;
 mips*vr4300el-*-elf*)	targ_emul=elf32vr4300el ;;
 mips*vr4300-*-elf*)	targ_emul=elf32vr4300 ;;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: patches to add mips-dec-netbsd configuration
  1995-09-18  2:02 patches to add mips-dec-netbsd configuration Arne H. Juul
@ 1995-09-18 11:48 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 1995-09-18 11:48 UTC (permalink / raw)
  To: arnej; +Cc: gas2

   From: "Arne H. Juul" <arnej@pvv.unit.no>
   Date: Mon, 18 Sep 1995 11:01:55 +0200

   Most of the patches only add recognizing the name to be handled
   like mips*el-*-elf.

I checked in versions of these patches.

   However, there is one patch to elf.c that modifies ld behaviour on
   linking: don't merge together readonly and writable object sections
   into one program segment.

It seems to me that this patch could cause trouble.  When the linker
script uses SIZEOF_HEADERS, as the default linker script does, the ELF
linker computes the program header size before it knows the final
positions of the sections.  That means that it must guess at the total
number of program segments which will be required.  Your patch will
cause the linker to sometimes allocate an additional program segment,
and in some cases that will not fit, causing a fatal error.

The right fix for this is rather complex: the linker must be able to
relax the final positions of the segments based on the number of
program header segments which are required, and vice-versa.

Ian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-09-18 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-09-18  2:02 patches to add mips-dec-netbsd configuration Arne H. Juul
1995-09-18 11:48 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).