This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
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 ;;