diff -urPX exclude binutils-950901-orig/bfd/Makefile.in binutils-950901/bfd/Makefile.in
--- binutils-950901-orig/bfd/Makefile.in	Fri Sep  1 18:15:03 1995
+++ binutils-950901/bfd/Makefile.in	Fri Sep  1 18:42:58 1995
@@ -45,13 +45,14 @@
 
 SHELL = /bin/sh
 
-INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
 
 AR = ar
 AR_FLAGS = rc
-CFLAGS = -g
+CFLAGS = @CFLAGS@
+PICFLAG =
 MAKEINFO = makeinfo
 RANLIB = @RANLIB@
 
@@ -64,6 +65,11 @@
 SUBDIRS = doc
 
 TARGETLIB = libbfd.a
+SHLIB = libbfd.so
+SHFLAGS =
+SHDEPS =
+
+BUILD_LIBS = $(TARGETLIB)
 
 # bfd.h goes here, for now
 BFD_H = bfd.h
@@ -165,6 +171,7 @@
 	i386mach3.o \
 	i386os9k.o \
 	ieee.o \
+	m68klinux.o \
 	m68klynx.o \
 	m68knetbsd.o \
 	m88kmach3.o \
@@ -224,6 +231,7 @@
 #### host and target dependent Makefile fragments come in here.
 # @target_makefile_frag@
 # @host_makefile_frag@
+# @host_extra_frag@
 ###
 
 FLAGS_TO_PASS = \
@@ -242,7 +250,7 @@
 	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
 	"BISON=$(BISON)"
 
-ALL_CFLAGS=$(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES)
+ALL_CFLAGS=$(CFLAGS) $(PICFLAG) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES)
 .c.o:
 	$(CC) -c $(ALL_CFLAGS) $<
 
@@ -254,6 +262,7 @@
 	 coff-a29k.c coff-rs6000.c coff-sparc.c coffgen.c format.c \
 	 section.c core.c syms.c stab-syms.c reloc.c init.c \
 	 coff-m88k.c coff-mips.c coff-sh.c trad-core.c cisco-core.c newsos3.c \
+	 m68klinux.c \
 	 i386aout.c i386linux.c i386mach3.c i386netbsd.c i386os9k.c \
 	 bout.c aout-adobe.c coff-we32k.c coff-w65.c \
 	 i386bsd.c i386dynix.c cpu-h8300.c cpu-i960.c cpu-sparc.c cpu-m68k.c \
@@ -278,9 +287,9 @@
 	 libcoff.h libecoff.h libelf.h libhppa.h libieee.h libnlm.h \
 	 liboasys.h nlm-target.h nlmcode.h som.h genlink.h netbsd.h
 
-STAGESTUFF = $(TARGETLIB) $(OFILES)
+STAGESTUFF = $(BUILD_LIBS) $(OFILES)
 
-all: Makefile $(TARGETLIB) 
+all: Makefile $(BUILD_LIBS) 
 	@$(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
 
 .NOEXPORT:
@@ -329,6 +338,9 @@
 	$(AR) $(AR_FLAGS) $(TARGETLIB) `cat ofiles`
 	$(RANLIB) $(TARGETLIB)
 
+$(SHLIB): $(OFILES) ofiles
+	$(CC) $(SHFLAGS) -shared -o $(SHLIB) `cat ofiles` $(SHDEPS)
+
 # When compiling archures.c and targets.c, supply the default target
 # info from configure.
 
@@ -470,10 +482,10 @@
 	$(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS); \
 	fi
 
-Makefile: Makefile.in config.status
-	$(SHELL) config.status
+Makefile: Makefile.in config.status @frags@
+	CONFIG_FILES=$@ $(SHELL) config.status
 
-config.status: configure configure.host config.bfd @frags@
+config.status: configure configure.host config.bfd
 	$(SHELL) config.status --recheck
 
 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
@@ -652,6 +664,9 @@
   aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
 i386linux.o: i386linux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
+  $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
+  $(INCDIR)/bfdlink.h aout-target.h
+m68klinux.o: m68klinux.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
   $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h libaout.h \
   $(INCDIR)/bfdlink.h aout-target.h
 i386mach3.o: i386mach3.c $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
diff -urPX exclude binutils-950901-orig/bfd/archive.c binutils-950901/bfd/archive.c
--- binutils-950901-orig/bfd/archive.c	Thu Jul 20 18:52:53 1995
+++ binutils-950901/bfd/archive.c	Thu Jul 20 19:57:47 1995
@@ -238,7 +238,9 @@
 
   if (prev == BFD_NO_MORE_SYMBOLS)
     prev = 0;
-  else if (++prev >= bfd_ardata (abfd)->symdef_count)
+  else
+    ++prev;
+  if (prev >= bfd_ardata (abfd)->symdef_count)
     return BFD_NO_MORE_SYMBOLS;
 
   *entry = (bfd_ardata (abfd)->symdefs + prev);
diff -urPX exclude binutils-950901-orig/bfd/config/linux.ml binutils-950901/bfd/config/linux.ml
--- binutils-950901-orig/bfd/config/linux.ml	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/config/linux.ml	Fri Sep  1 18:20:05 1995
@@ -0,0 +1,3 @@
+BUILD_LIBS = $(TARGETLIB) $(SHLIB)
+SHLIB = libbfd.so.2.5.2.6
+SHFLAGS = -Wl,-soname,$(SHLIB)
diff -urPX exclude binutils-950901-orig/bfd/config/m68k-laout.mt binutils-950901/bfd/config/m68k-laout.mt
--- binutils-950901-orig/bfd/config/m68k-laout.mt	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/config/m68k-laout.mt	Wed May 10 22:19:26 1995
@@ -0,0 +1,5 @@
+# Target: Motorola m68k running linux using a.out
+
+DEFAULT_VECTOR=m68klinux_vec
+SELECT_VECS=bfd_elf32_m68k_vec
+SELECT_ARCHITECTURES=bfd_m68k_arch
diff -urPX exclude binutils-950901-orig/bfd/config/m68k-linux.mt binutils-950901/bfd/config/m68k-linux.mt
--- binutils-950901-orig/bfd/config/m68k-linux.mt	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/config/m68k-linux.mt	Sat May  6 21:15:40 1995
@@ -0,0 +1,5 @@
+# Target:  Motorola m68k running linux using ELF
+
+DEFAULT_VECTOR=bfd_elf32_m68k_vec
+SELECT_VECS=m68klinux_vec
+SELECT_ARCHITECTURES=bfd_m68k_arch
diff -urPX exclude binutils-950901-orig/bfd/config/m68klinux.mh binutils-950901/bfd/config/m68klinux.mh
--- binutils-950901-orig/bfd/config/m68klinux.mh	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/config/m68klinux.mh	Wed May 10 22:16:56 1995
@@ -0,0 +1,4 @@
+# Host: Motorola m68k running linux using ELF
+
+HDEFINES=-DTRAD_CORE
+HDEPFILES=trad-core.o
diff -urPX exclude binutils-950901-orig/bfd/config.bfd binutils-950901/bfd/config.bfd
--- binutils-950901-orig/bfd/config.bfd	Tue Jul 11 10:19:12 1995
+++ binutils-950901/bfd/config.bfd	Wed Jul 12 20:24:17 1995
@@ -87,6 +87,8 @@
   m68*-*-coff*)		bfd_name=m68k-coff ;;
   m68*-*-elf*)		bfd_name=m68k-elf ;;
   m68*-*-hpux*)		bfd_name=hp300hpux strip_underscore=yes ;;
+  m68*-*-linuxaout*)	bfd_name=m68k-laout strip_underscore=yes ;;
+  m68*-*-linux*)	bfd_name=m68k-linux ;;
   m68*-*-lynxos*)	bfd_name=m68k-lynx ;;
   m68*-*-netbsd*)	bfd_name=m68k-nbsd strip_underscore=yes ;;
   m68*-*-os68k*)	bfd_name=m68k-aout strip_underscore=yes ;;
diff -urPX exclude binutils-950901-orig/bfd/configure.host binutils-950901/bfd/configure.host
--- binutils-950901-orig/bfd/configure.host	Mon Aug 14 20:22:56 1995
+++ binutils-950901/bfd/configure.host	Mon Aug 14 21:22:40 1995
@@ -71,6 +71,7 @@
 m68*-cbm-sysv4*)	my_host=m68kv4 ;;
 m68*-hp-hpux*)		my_host=hp300 ;;
 m68*-hp-bsd*)		my_host=hp300bsd ;;
+m68*-*-linux*)		my_host=m68klinux ;;
 m68*-*-lynxos*)		my_host=m68klynx ;;
 m68*-motorola-sysv*)	my_host=delta68 ;;
 m68*-sony-*)		my_host=news ;;
diff -urPX exclude binutils-950901-orig/bfd/configure.in binutils-950901/bfd/configure.in
--- binutils-950901-orig/bfd/configure.in	Thu Jul 20 19:35:08 1995
+++ binutils-950901/bfd/configure.in	Wed Aug  9 22:48:25 1995
@@ -16,6 +16,8 @@
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac])dnl
+AC_ARG_ENABLE(shared,
+[  --enable-shared         enable shared libraries])dnl
 
 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
 AC_CANONICAL_SYSTEM
@@ -32,6 +34,7 @@
 . ${srcdir}/configure.host
 
 AC_PROG_RANLIB
+AC_PROG_INSTALL
 
 # Set up to make a link between the host's include file and "sysdep.h".
 files=hosts/${my_host}.h
@@ -49,6 +52,13 @@
 	host_makefile_frag=/dev/null
 fi
 AC_SUBST_FILE(host_makefile_frag)
+host_extra_frag=/dev/null
+if test "$enable_shared" = yes; then
+	case "$host" in
+	*-*-linux*)		host_extra_frag=$srcdir/config/linux.ml ;;
+	esac
+fi
+AC_SUBST_FILE(host_extra_frag)
 
 # target stuff:
 
@@ -94,6 +104,9 @@
 if test $host_makefile_frag != /dev/null ; then
     frags="$frags $host_makefile_frag"
 fi
+if test $host_extra_frag != /dev/null; then
+    frags="$frags $host_extra_frag"
+fi
 AC_SUBST_FILE(target_makefile_frag)
 AC_SUBST(frags)
 
@@ -214,6 +227,7 @@
     ieee_vec)			tb="$tb ieee.o" ;;
     m68kcoff_vec)		tb="$tb coff-m68k.o cofflink.o" ;;
     m68kcoffun_vec)		tb="$tb coff-u68k.o coff-m68k.o cofflink.o" ;;
+    m68klinux_vec)		tb="$tb m68klinux.o aout32.o stab-syms.o" ;;
     m68klynx_aout_vec)		tb="$tb m68klynx.o lynx-core.o aout32.o stab-syms.o" ;;
     m68klynx_coff_vec)		tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;;
     m68knetbsd_vec)		tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;;
diff -urPX exclude binutils-950901-orig/bfd/doc/Makefile.in binutils-950901/bfd/doc/Makefile.in
--- binutils-950901-orig/bfd/doc/Makefile.in	Fri Sep  1 18:15:26 1995
+++ binutils-950901/bfd/doc/Makefile.in	Fri Sep  1 18:43:46 1995
@@ -44,13 +44,13 @@
 MKDOC=./chew
 SHELL = /bin/sh
 
-INSTALL = `cd $(srcdir)/../..;pwd`/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
 
 MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
-CFLAGS = -g
+CFLAGS = @CFLAGS@
 
 CC_FOR_BUILD = $(CC)
 
@@ -304,5 +304,5 @@
 force:
 
 Makefile: $(srcdir)/Makefile.in
-	cd .. && $(SHELL) ./config.status
+	cd .. && CONFIG_FILES=doc/$@ $(SHELL) ./config.status
 
diff -urPX exclude binutils-950901-orig/bfd/hosts/i386linux.h binutils-950901/bfd/hosts/i386linux.h
--- binutils-950901-orig/bfd/hosts/i386linux.h	Tue Apr 25 07:19:08 1995
+++ binutils-950901/bfd/hosts/i386linux.h	Thu Jul 13 01:03:59 1995
@@ -17,13 +17,18 @@
 #define TRAD_CORE_EXTRA_SIZE_ALLOWED 4096
 
 /* Used for core file stuff only.  */
-#if 0 /* Turning this on requires that you have support code which, as
+/* Turning this on requires that you have support code which, as
 	 I write this, is alpha-test code no more than a few days old.
 	 This is stupid.  Because of the way BFD is set up, it means
 	 you can't build a Linux-hosted ELF-targeted toolchain.  Leave
 	 it disabled until BFD is fixed or the newest Linux ELF code
 	 is widely distributed (including a few CD-ROM releases).
 	 [raeburn:95/04/24] */
-#define HAVE_PROCFS
-#endif
 
+#ifdef __ELF__
+/*  Used for core file stuff only. If the compiler is built for ELF, 
+    we assume the user has installed the appropriate C libraries and
+    header files. We let <sys/procfs.h> determine what should be
+    defined. */
+#include <sys/procfs.h>
+#endif
diff -urPX exclude binutils-950901-orig/bfd/hosts/m68klinux.h binutils-950901/bfd/hosts/m68klinux.h
--- binutils-950901-orig/bfd/hosts/m68klinux.h	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/hosts/m68klinux.h	Wed Jul 12 22:15:48 1995
@@ -0,0 +1 @@
+#include "hosts/i386linux.h"
diff -urPX exclude binutils-950901-orig/bfd/i386linux.c binutils-950901/bfd/i386linux.c
--- binutils-950901-orig/bfd/i386linux.c	Thu Jul 20 19:13:49 1995
+++ binutils-950901/bfd/i386linux.c	Thu Jul 20 20:01:16 1995
@@ -542,7 +542,7 @@
    are required.  */
 
 boolean
-bfd_linux_size_dynamic_sections (output_bfd, info)
+bfd_i386linux_size_dynamic_sections (output_bfd, info)
      bfd *output_bfd;
      struct bfd_link_info *info;
 {
diff -urPX exclude binutils-950901-orig/bfd/m68klinux.c binutils-950901/bfd/m68klinux.c
--- binutils-950901-orig/bfd/m68klinux.c	Thu Jan  1 01:00:00 1970
+++ binutils-950901/bfd/m68klinux.c	Thu Jul 20 19:17:23 1995
@@ -0,0 +1,765 @@
+/* BFD back-end for linux flavored m68k a.out binaries.
+   Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#define	PAGE_SIZE	4096
+#define ZMAGIC_DISK_BLOCK_SIZE 1024
+#define	SEGMENT_SIZE	4096
+#define TEXT_START_ADDR	0x0
+#define N_SHARED_LIB(x) 0
+#define BYTES_IN_WORD 4
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+#include "libaout.h"           /* BFD a.out internal data structures */
+
+#define TARGET_IS_BIG_ENDIAN_P
+#define DEFAULT_ARCH bfd_arch_m68k
+#define MY(OP) CAT(m68klinux_,OP)
+#define TARGETNAME "a.out-m68k-linux"
+
+/* We always generate QMAGIC files in preference to ZMAGIC files.  It
+   would be possible to make this a linker option, if that ever
+   becomes important.  */
+
+static void MY_final_link_callback
+  PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
+
+static boolean
+m68klinux_bfd_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  obj_aout_subformat (abfd) = q_magic_format;
+  return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
+}
+
+#define MY_bfd_final_link m68klinux_bfd_final_link
+
+/* Set the machine type correctly.  */
+
+static boolean
+m68klinux_write_object_contents (abfd)
+     bfd *abfd;
+{
+  struct external_exec exec_bytes;
+  struct internal_exec *execp = exec_hdr (abfd);
+
+  N_SET_MACHTYPE (*execp, M_68020);
+
+  obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+
+  WRITE_HEADERS(abfd, execp);
+
+  return true;
+}
+
+#define MY_write_object_contents m68klinux_write_object_contents
+
+/* Code to link against Linux a.out shared libraries.  */
+
+/* See if a symbol name is a reference to the global offset table.  */
+
+#ifndef GOT_REF_PREFIX
+#define	GOT_REF_PREFIX	"__GOT_"
+#endif
+
+#define IS_GOT_SYM(name) \
+  (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0)
+
+/* See if a symbol name is a reference to the procedure linkage table.  */
+
+#ifndef PLT_REF_PREFIX
+#define	PLT_REF_PREFIX	"__PLT_"
+#endif
+
+#define IS_PLT_SYM(name) \
+  (strncmp (name, PLT_REF_PREFIX, sizeof PLT_REF_PREFIX - 1) == 0)
+
+/* This string is used to generate specialized error messages.  */
+
+#ifndef NEEDS_SHRLIB
+#define NEEDS_SHRLIB "__NEEDS_SHRLIB_"
+#endif
+
+/* This special symbol is a set vector that contains a list of
+   pointers to fixup tables.  It will be present in any dynamicly
+   linked file.  The linker generated fixup table should also be added
+   to the list, and it should always appear in the second slot (the
+   first one is a dummy with a magic number that is defined in
+   crt0.o).  */
+
+#ifndef SHARABLE_CONFLICTS
+#define SHARABLE_CONFLICTS "__SHARABLE_CONFLICTS__"
+#endif
+
+/* We keep a list of fixups.  The terminology is a bit strange, but
+   each fixup contains two 32 bit numbers.  A regular fixup contains
+   an address and a pointer, and at runtime we should store the
+   address at the location pointed to by the pointer.  A builtin fixup
+   contains two pointers, and we should read the address using one
+   pointer and store it at the location pointed to by the other
+   pointer.  Builtin fixups come into play when we have duplicate
+   __GOT__ symbols for the same variable.  The builtin fixup will copy
+   the GOT pointer from one over into the other.  */
+
+struct fixup
+{
+  struct fixup *next;
+  struct linux_link_hash_entry *h;
+  bfd_vma value;
+
+  /* Nonzero if this is a jump instruction that needs to be fixed,
+     zero if this is just a pointer */
+  char jump;
+
+  char builtin;
+};
+
+/* We don't need a special hash table entry structure, but we do need
+   to keep some information between linker passes, so we use a special
+   hash table.  */
+
+struct linux_link_hash_entry
+{
+  struct aout_link_hash_entry root;
+};
+
+struct linux_link_hash_table
+{
+  struct aout_link_hash_table root;
+
+  /* First dynamic object found in link.  */
+  bfd *dynobj;
+
+  /* Number of fixups.  */
+  size_t fixup_count;
+
+  /* Number of builtin fixups.  */
+  size_t local_builtins;
+
+  /* List of fixups.  */
+  struct fixup *fixup_list;
+};
+
+static struct bfd_hash_entry *linux_link_hash_newfunc
+  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+static struct bfd_link_hash_table *linux_link_hash_table_create
+  PARAMS ((bfd *));
+static struct fixup *new_fixup
+  PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *,
+	   bfd_vma, int));
+static boolean linux_link_create_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+static boolean linux_add_one_symbol
+  PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
+	   bfd_vma, const char *, boolean, boolean,
+	   struct bfd_link_hash_entry **));
+static boolean linux_tally_symbols
+  PARAMS ((struct linux_link_hash_entry *, PTR));
+static boolean linux_finish_dynamic_link
+  PARAMS ((bfd *, struct bfd_link_info *));
+
+/* Routine to create an entry in an Linux link hash table.  */
+
+static struct bfd_hash_entry *
+linux_link_hash_newfunc (entry, table, string)
+     struct bfd_hash_entry *entry;
+     struct bfd_hash_table *table;
+     const char *string;
+{
+  struct linux_link_hash_entry *ret = (struct linux_link_hash_entry *) entry;
+
+  /* Allocate the structure if it has not already been allocated by a
+     subclass.  */
+  if (ret == (struct linux_link_hash_entry *) NULL)
+    ret = ((struct linux_link_hash_entry *)
+	   bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry)));
+  if (ret == NULL)
+    return (struct bfd_hash_entry *) ret;
+
+  /* Call the allocation method of the superclass.  */
+  ret = ((struct linux_link_hash_entry *)
+	 NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret,
+				       table, string));
+  if (ret != NULL)
+    {
+      /* Set local fields; there aren't any.  */
+    }
+
+  return (struct bfd_hash_entry *) ret;
+}
+
+/* Create a Linux link hash table.  */
+
+static struct bfd_link_hash_table *
+linux_link_hash_table_create (abfd)
+     bfd *abfd;
+{
+  struct linux_link_hash_table *ret;
+
+  ret = ((struct linux_link_hash_table *)
+	 bfd_alloc (abfd, sizeof (struct linux_link_hash_table)));
+  if (ret == (struct linux_link_hash_table *) NULL)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return (struct bfd_link_hash_table *) NULL;
+    }
+  if (! NAME(aout,link_hash_table_init) (&ret->root, abfd,
+					 linux_link_hash_newfunc))
+    {
+      free (ret);
+      return (struct bfd_link_hash_table *) NULL;
+    }
+
+  ret->dynobj = NULL;
+  ret->fixup_count = 0;
+  ret->local_builtins = 0;
+  ret->fixup_list = NULL;
+
+  return &ret->root.root;
+}
+
+/* Look up an entry in a Linux link hash table.  */
+
+#define linux_link_hash_lookup(table, string, create, copy, follow) \
+  ((struct linux_link_hash_entry *) \
+   aout_link_hash_lookup (&(table)->root, (string), (create), (copy),\
+			  (follow)))
+
+/* Traverse a Linux link hash table.  */
+
+#define linux_link_hash_traverse(table, func, info)			\
+  (aout_link_hash_traverse						\
+   (&(table)->root,							\
+    (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func),	\
+    (info)))
+
+/* Get the Linux link hash table from the info structure.  This is
+   just a cast.  */
+
+#define linux_hash_table(p) ((struct linux_link_hash_table *) ((p)->hash))
+
+/* Store the information for a new fixup.  */
+
+static struct fixup *
+new_fixup (info, h, value, builtin)
+     struct bfd_link_info *info;
+     struct linux_link_hash_entry *h;
+     bfd_vma value;
+     int builtin;
+{
+  struct fixup *f;
+
+  f = (struct fixup *) bfd_hash_allocate (&info->hash->table,
+					  sizeof (struct fixup));
+  if (f == NULL)
+    return f;
+  f->next = linux_hash_table (info)->fixup_list;
+  linux_hash_table (info)->fixup_list = f;
+  f->h = h;
+  f->value = value;
+  f->builtin = builtin;
+  f->jump = 0;
+  ++linux_hash_table (info)->fixup_count;
+  return f;
+}
+
+/* We come here once we realize that we are going to link to a shared
+   library.  We need to create a special section that contains the
+   fixup table, and we ultimately need to add a pointer to this into
+   the set vector for SHARABLE_CONFLICTS.  At this point we do not
+   know the size of the section, but that's OK - we just need to
+   create it for now.  */
+
+static boolean
+linux_link_create_dynamic_sections (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  flagword flags;
+  register asection *s;
+
+  /* Note that we set the SEC_IN_MEMORY flag.  */
+  flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
+
+  /* We choose to use the name ".linux-dynamic" for the fixup table.
+     Why not? */
+  s = bfd_make_section (abfd, ".linux-dynamic");
+  if (s == NULL
+      || ! bfd_set_section_flags (abfd, s, flags)
+      || ! bfd_set_section_alignment (abfd, s, 2))
+    return false;
+  s->_raw_size = 0;
+  s->contents = 0;
+
+  return true;
+}
+
+/* Function to add a single symbol to the linker hash table.  This is
+   a wrapper around _bfd_generic_link_add_one_symbol which handles the
+   tweaking needed for dynamic linking support.  */
+
+static boolean
+linux_add_one_symbol (info, abfd, name, flags, section, value, string,
+		      copy, collect, hashp)
+     struct bfd_link_info *info;
+     bfd *abfd;
+     const char *name;
+     flagword flags;
+     asection *section;
+     bfd_vma value;
+     const char *string;
+     boolean copy;
+     boolean collect;
+     struct bfd_link_hash_entry **hashp;
+{
+  struct linux_link_hash_entry *h;
+  boolean insert;
+
+  /* Look up and see if we already have this symbol in the hash table.
+     If we do, and the defining entry is from a shared library, we
+     need to create the dynamic sections.
+
+     FIXME: What if abfd->xvec != info->hash->creator?  We may want to
+     be able to link Linux a.out and ELF objects together, but serious
+     confusion is possible.  */
+
+  insert = false;
+
+  if (! info->relocateable
+      && linux_hash_table (info)->dynobj == NULL
+      && strcmp (name, SHARABLE_CONFLICTS) == 0
+      && (flags & BSF_CONSTRUCTOR) != 0
+      && abfd->xvec == info->hash->creator)
+    {
+      if (! linux_link_create_dynamic_sections (abfd, info))
+	return false;
+      linux_hash_table (info)->dynobj = abfd;
+      insert = true;
+    }
+
+  if (bfd_is_abs_section (section)
+      && abfd->xvec == info->hash->creator)
+    {
+      h = linux_link_hash_lookup (linux_hash_table (info), name, false,
+				  false, false);
+      if (h != NULL
+	  && (h->root.root.type == bfd_link_hash_defined
+	      || h->root.root.type == bfd_link_hash_defweak))
+	{
+	  struct fixup *f;
+
+	  if (hashp != NULL)
+	    *hashp = (struct bfd_link_hash_entry *) h;
+
+	  f = new_fixup (info, h, value, ! IS_PLT_SYM (name));
+	  if (f == NULL)
+	    return false;
+	  f->jump = IS_PLT_SYM (name);
+
+	  return true;
+	}
+    }
+
+  /* Do the usual procedure for adding a symbol.  */
+  if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section,
+					  value, string, copy, collect,
+					  hashp))
+    return false;
+
+  /* Insert a pointer to our table in the set vector.  The dynamic
+     linker requires this information */
+  if (insert)
+    {
+      asection *s;
+
+      /* Here we do our special thing to add the pointer to the
+	 dynamic section in the SHARABLE_CONFLICTS set vector.  */
+      s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+				   ".linux-dynamic");
+      BFD_ASSERT (s != NULL);
+
+      if (! (_bfd_generic_link_add_one_symbol
+	     (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS,
+	      BSF_GLOBAL | BSF_CONSTRUCTOR, s, 0, NULL, false, false, NULL)))
+	return false;
+    }
+
+  return true;
+}
+
+/* We will crawl the hash table and come here for every global symbol.
+   We will examine each entry and see if there are indications that we
+   need to add a fixup.  There are two possible cases - one is where
+   you have duplicate definitions of PLT or GOT symbols - these will
+   have already been caught and added as "builtin" fixups.  If we find
+   that the corresponding non PLT/GOT symbol is also present, we
+   convert it to a regular fixup instead.
+
+   This function is called via linux_link_hash_traverse.  */
+
+static boolean
+linux_tally_symbols (h, data)
+     struct linux_link_hash_entry *h;
+     PTR data;
+{
+  struct bfd_link_info *info = (struct bfd_link_info *) data;
+  struct fixup *f, *f1;
+  int is_plt;
+  struct linux_link_hash_entry *h1, *h2;
+  boolean exists;
+
+  if (h->root.root.type == bfd_link_hash_undefined
+      && strncmp (h->root.root.root.string, NEEDS_SHRLIB,
+		  sizeof NEEDS_SHRLIB - 1) == 0)
+    {
+      const char *name;
+      char *p;
+      char *alloc = NULL;
+
+      name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1;
+      p = strrchr (name, '_');
+      if (p != NULL)
+	alloc = (char *) malloc (strlen (name) + 1);
+
+      /* FIXME!  BFD should not call printf!  */
+      if (p == NULL || alloc == NULL)
+	fprintf (stderr, "Output file requires shared library `%s'\n", name);
+      else
+	{
+	  strcpy (alloc, name);
+	  p = strrchr (alloc, '_');
+	  *p++ = '\0';
+	  fprintf (stderr,
+		   "Output file requires shared library `%s.so.%s'\n",
+		   alloc, p);
+	  free (alloc);
+	}
+
+      abort ();
+    }
+
+  /* If this symbol is not a PLT/GOT, we do not even need to look at it */
+  is_plt = IS_PLT_SYM (h->root.root.root.string);
+
+  if (is_plt || IS_GOT_SYM (h->root.root.root.string))
+    {
+      /* Look up this symbol twice.  Once just as a regular lookup,
+	 and then again following all of the indirect links until we
+	 reach a real symbol.  */
+      h1 = linux_link_hash_lookup (linux_hash_table (info),
+				   (h->root.root.root.string
+				    + sizeof PLT_REF_PREFIX - 1),
+				   false, false, true);
+      /* h2 does not follow indirect symbols. */
+      h2 = linux_link_hash_lookup (linux_hash_table (info), 
+				   (h->root.root.root.string
+				    + sizeof PLT_REF_PREFIX - 1),
+				   false, false, false);
+
+      /* The real symbol must exist but if it is also an ABS symbol,
+	 there is no need to have a fixup.  This is because they both
+	 came from the same library.  If on the other hand, we had to
+	 use an indirect symbol to get to the real symbol, we add the
+	 fixup anyway, since there are cases where these symbols come
+	 from different shared libraries */
+      if (h1 != NULL
+	  && (((h1->root.root.type == bfd_link_hash_defined
+		|| h1->root.root.type == bfd_link_hash_defweak)
+	       && ! bfd_is_abs_section (h1->root.root.u.def.section))
+	      || h2->root.root.type == bfd_link_hash_indirect))
+	{
+	  /* See if there is a "builtin" fixup already present
+	     involving this symbol.  If so, convert it to a regular
+	     fixup.  In the end, this relaxes some of the requirements
+	     about the order of performing fixups.  */
+	  exists = false;
+	  for (f1 = linux_hash_table (info)->fixup_list;
+	       f1 != NULL;
+	       f1 = f1->next)
+	    {
+	      if ((f1->h != h && f1->h != h1)
+		  || (! f1->builtin && ! f1->jump))
+		continue;
+	      if (f1->h == h1)
+		exists = true;
+	      if (! exists
+		  && bfd_is_abs_section (h->root.root.u.def.section))
+		{
+		  f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0);
+		  f->jump = is_plt;
+		}
+	      f1->h = h1;
+	      f1->jump = is_plt;
+	      f1->builtin = 0;
+	      exists = true;
+	    }
+	  if (! exists
+	      && bfd_is_abs_section (h->root.root.u.def.section))
+	    {
+	      f = new_fixup (info, h1, h->root.root.u.def.value, 0);
+	      if (f == NULL)
+		{
+		  /* FIXME: No way to return error.  */
+		  abort ();
+		}
+	      f->jump = is_plt;
+	    }
+	}
+
+      /* Quick and dirty way of stripping these symbols from the
+	 symtab. */
+      if (bfd_is_abs_section (h->root.root.u.def.section))
+	h->root.written = true;
+    }
+
+  return true;
+}
+
+/* This is called to set the size of the .linux-dynamic section is.
+   It is called by the Linux linker emulation before_allocation
+   routine.  We have finished reading all of the input files, and now
+   we just scan the hash tables to find out how many additional fixups
+   are required.  */
+
+boolean
+bfd_m68klinux_size_dynamic_sections (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+{
+  struct fixup *f;
+  asection *s;
+
+  /* First find the fixups... */
+  linux_link_hash_traverse (linux_hash_table (info),
+			    linux_tally_symbols,
+			    (PTR) info);
+
+  /* If there are builtin fixups, leave room for a marker.  This is
+     used by the dynamic linker so that it knows that all that follow
+     are builtin fixups instead of regular fixups.  */
+  for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+    {
+      if (f->builtin)
+	{
+	  ++linux_hash_table (info)->fixup_count;
+	  ++linux_hash_table (info)->local_builtins;
+	  break;
+	}
+    }
+
+  if (linux_hash_table (info)->dynobj == NULL)
+    {
+      if (linux_hash_table (info)->fixup_count > 0)
+	abort ();
+      return true;
+    }
+
+  /* Allocate memory for our fixup table.  We will fill it in later.  */
+  s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+			       ".linux-dynamic");
+  if (s != NULL)
+    {
+      s->_raw_size = 8 + linux_hash_table (info)->fixup_count * 8;
+      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
+      if (s->contents == NULL)
+	{
+	  bfd_set_error (bfd_error_no_memory);
+	  return false;
+	}
+      memset (s->contents, 0, (size_t) s->_raw_size);
+    }
+
+  return true;
+}
+
+/* We come here once we are ready to actually write the fixup table to
+   the output file.  Scan the fixup tables and so forth and generate
+   the stuff we need.  */
+
+static boolean
+linux_finish_dynamic_link (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+{
+  asection *s, *os, *is;
+  bfd_byte *fixup_table;
+  struct linux_link_hash_entry *h;
+  struct fixup *f;
+  unsigned int new_addr;
+  int section_offset;
+  int fixups_written;
+
+  if (linux_hash_table (info)->dynobj == NULL)
+    return true;
+
+  s = bfd_get_section_by_name (linux_hash_table (info)->dynobj,
+			       ".linux-dynamic");
+  BFD_ASSERT (s != NULL);
+  os = s->output_section;
+  fixups_written = 0;
+
+#ifdef LINUX_LINK_DEBUG
+  printf ("Fixup table file offset: %x  VMA: %x\n", 
+	  os->filepos + s->output_offset,
+	  os->vma + s->output_offset);
+#endif
+
+  fixup_table = s->contents;
+  bfd_put_32 (output_bfd, linux_hash_table (info)->fixup_count, fixup_table);
+  fixup_table += 4;
+
+  /* Fill in fixup table.  */
+  for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+    {
+      if (f->builtin)
+	continue;
+
+      if (f->h->root.root.type != bfd_link_hash_defined
+	  && f->h->root.root.type != bfd_link_hash_defweak)
+	{
+	  /* FIXME!  */
+	  fprintf (stderr,
+		   "Symbol %s not defined for fixups\n",
+		   f->h->root.root.root.string);
+	  continue;
+	}
+
+      is = f->h->root.root.u.def.section;
+      section_offset = is->output_section->vma + is->output_offset;
+      new_addr = f->h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+      printf ("Fixup(%d) %s: %x %x\n",f->jump, f->h->root.root.string,
+	      new_addr, f->value);
+#endif
+
+      if (f->jump)
+	{
+	  bfd_put_32 (output_bfd, new_addr, fixup_table);
+	  fixup_table += 4;
+	  bfd_put_32 (output_bfd, f->value + 2, fixup_table);
+	  fixup_table += 4;
+	}
+      else
+	{
+	  bfd_put_32 (output_bfd, new_addr, fixup_table);
+	  fixup_table += 4;
+	  bfd_put_32 (output_bfd, f->value, fixup_table);
+	  fixup_table += 4;
+	}
+      ++fixups_written;
+    }
+
+  if (linux_hash_table (info)->local_builtins != 0)
+    {
+      /* Special marker so we know to switch to the other type of fixup */
+      bfd_put_32 (output_bfd, 0, fixup_table);
+      fixup_table += 4;
+      bfd_put_32 (output_bfd, 0, fixup_table);
+      fixup_table += 4;
+      ++fixups_written;
+      for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next)
+	{
+	  if (! f->builtin)
+	    continue;
+
+	  if (f->h->root.root.type != bfd_link_hash_defined
+	      && f->h->root.root.type != bfd_link_hash_defweak)
+	    {
+	      /* FIXME!  */
+	      fprintf (stderr,
+		       "Symbol %s not defined for fixups\n",
+		       f->h->root.root.root.string);
+	      continue;
+	    }
+
+	  is = f->h->root.root.u.def.section;
+	  section_offset = is->output_section->vma + is->output_offset;
+	  new_addr = f->h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+	  printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string,
+		  new_addr, f->value);
+#endif
+
+	  bfd_put_32 (output_bfd, new_addr, fixup_table);
+	  fixup_table += 4;
+	  bfd_put_32 (output_bfd, f->value, fixup_table);
+	  fixup_table += 4;
+	  ++fixups_written;
+	}
+  }
+
+  if (linux_hash_table (info)->fixup_count != fixups_written)
+    {
+      /* FIXME!  */
+      fprintf (stderr, "Warning: fixup count mismatch\n");
+      while (linux_hash_table (info)->fixup_count > fixups_written)
+	{
+	  bfd_put_32 (output_bfd, 0, fixup_table);
+	  fixup_table += 4;
+	  bfd_put_32 (output_bfd, 0, fixup_table);
+	  fixup_table += 4;
+	  ++fixups_written;
+	}
+    }
+
+  h = linux_link_hash_lookup (linux_hash_table (info), 
+			      "__BUILTIN_FIXUPS__",
+			      false, false, false);
+
+  if (h != NULL
+      && (h->root.root.type == bfd_link_hash_defined
+	  || h->root.root.type == bfd_link_hash_defweak))
+    {
+      is = h->root.root.u.def.section;
+      section_offset = is->output_section->vma + is->output_offset;
+      new_addr = h->root.root.u.def.value + section_offset;
+
+#ifdef LINUX_LINK_DEBUG
+      printf ("Builtin fixup table at %x\n", new_addr);
+#endif
+
+      bfd_put_32 (output_bfd, new_addr, fixup_table);
+    }
+  else
+    bfd_put_32 (output_bfd, 0, fixup_table);
+
+  if (bfd_seek (output_bfd, os->filepos + s->output_offset, SEEK_SET) != 0)
+    return false;
+
+  if (bfd_write ((PTR) s->contents, 1, s->_raw_size, output_bfd)
+      != s->_raw_size)
+    return false;
+
+  return true;
+}
+
+#define MY_bfd_link_hash_table_create linux_link_hash_table_create
+#define MY_add_one_symbol linux_add_one_symbol
+#define MY_finish_dynamic_link linux_finish_dynamic_link
+
+#define MY_zmagic_contiguous 1
+
+#include "aout-target.h"
diff -urPX exclude binutils-950901-orig/bfd/ptrace-core.c binutils-950901/bfd/ptrace-core.c
--- binutils-950901-orig/bfd/ptrace-core.c	Sat Jul  8 00:41:33 1995
+++ binutils-950901/bfd/ptrace-core.c	Wed Jul 12 20:44:00 1995
@@ -51,7 +51,7 @@
     asection *stack_section;
     asection *reg_section;
     struct ptrace_user u;
-  } *rawptr;
+  };
 
 #define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
 #define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
@@ -74,6 +74,7 @@
 {
   int val;
   struct ptrace_user u;
+  struct trad_core_struct *rawptr;
 
   val = bfd_read ((void *)&u, 1, sizeof u, abfd);
   if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC 
diff -urPX exclude binutils-950901-orig/bfd/targets.c binutils-950901/bfd/targets.c
--- binutils-950901-orig/bfd/targets.c	Fri Sep  1 18:15:35 1995
+++ binutils-950901/bfd/targets.c	Fri Sep  1 18:44:32 1995
@@ -513,6 +513,7 @@
 extern const bfd_target ieee_vec;
 extern const bfd_target m68kcoff_vec;
 extern const bfd_target m68kcoffun_vec;
+extern const bfd_target m68klinux_vec;
 extern const bfd_target m68klynx_aout_vec;
 extern const bfd_target m68klynx_coff_vec;
 extern const bfd_target m68knetbsd_vec;
diff -urPX exclude binutils-950901-orig/bfd/trad-core.c binutils-950901/bfd/trad-core.c
--- binutils-950901-orig/bfd/trad-core.c	Sat Jul  8 00:42:26 1995
+++ binutils-950901/bfd/trad-core.c	Wed Jul 12 20:44:55 1995
@@ -54,7 +54,7 @@
       asection *stack_section;
       asection *reg_section;
       struct user u;
-    } *rawptr;
+    };
 
 #define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
 #define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
@@ -79,6 +79,7 @@
 {
   int val;
   struct user u;
+  struct trad_core_struct *rawptr;
 
 #ifdef TRAD_CORE_USER_OFFSET
   /* If defined, this macro is the file position of the user struct.  */
diff -urPX exclude binutils-950901-orig/binutils/Makefile.in binutils-950901/binutils/Makefile.in
--- binutils-950901-orig/binutils/Makefile.in	Fri Sep  1 18:15:40 1995
+++ binutils-950901/binutils/Makefile.in	Fri Sep  1 18:45:20 1995
@@ -46,9 +46,9 @@
 
 INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
 INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL) 
+INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
-INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
+INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 -m 644
 
 AR = ar
 AR_FLAGS = qv
@@ -156,9 +156,12 @@
 BULIBS = bucomm.o version.o filemode.o
 
 ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY) 
+ADDL_LIBS_DEP = $(MALLOC) $(BULIBS) $(BFD_DEP) $(LIBIBERTY) 
 
-BFD = ../bfd/libbfd.a
-OPCODES = ../opcodes/libopcodes.a
+BFD = -L../bfd -lbfd
+BFD_DEP = ../bfd/libbfd.a
+OPCODES = -L../opcodes -lopcodes
+OPCODES_DEP = ../opcodes/libopcodes.a
 
 EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
           echo $${rootme}/../expect/expect ; \
@@ -176,7 +179,7 @@
 #
 ## The rules
 
-all: $(ADDL_LIBS) $(PROGS)
+all: $(ADDL_LIBS_DEP) $(PROGS) ar_with_ranlib objcopy_with_strip
 
 # These targets are for the dejagnu testsuites. The file site.exp 
 # contains global variables that all the testsuites will use.
@@ -226,22 +229,24 @@
 
 dvi: binutils.dvi
 
-$(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD)
+$(SIZE_PROG): $(ADDL_LIBS_DEP) size.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS)
 
-$(OBJCOPY_PROG): $(ADDL_LIBS) objcopy.o not-strip.o $(BFD)
+$(OBJCOPY_PROG): $(ADDL_LIBS_DEP) objcopy.o not-strip.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(ADDL_LIBS) $(EXTRALIBS)
+	@rm -f objcopy_with_strip
 
-$(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD)
+$(STRINGS_PROG): $(ADDL_LIBS_DEP) strings.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS)
 
-$(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD)
+$(STRIP_PROG): $(ADDL_LIBS_DEP) objcopy.o is-strip.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS)
+	@rm -f objcopy_with_strip
 
-$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
+$(NM_PROG): $(ADDL_LIBS_DEP) nm.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS)
 
-$(OBJDUMP_PROG): $(ADDL_LIBS) objdump.o $(BFD) $(OPCODES)
+$(OBJDUMP_PROG): $(ADDL_LIBS_DEP) objdump.o $(OPCODES_DEP)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS)
 
 underscore.c: Makefile
@@ -272,11 +277,13 @@
 	$(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
 	mv lex.yy.c arlex.c
 
-$(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o
+$(AR_PROG): $(ADDL_LIBS_DEP) ar.o arparse.o arlex.o not-ranlib.o arsup.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+	@rm -f ar_with_ranlib
 
-$(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD)
+$(RANLIB_PROG): $(ADDL_LIBS_DEP) ar.o is-ranlib.o arparse.o arlex.o arsup.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+	@rm -f ar_with_ranlib
 
 # This rule creates a single binary that switches between ar and ranlib
 # by looking at argv[0].  Use this kludge to save some disk space.
@@ -285,17 +292,21 @@
 
 # Alternatively, you can install ranlib.sh as ranlib.
 
-ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD)
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
+ar_with_ranlib: $(ADDL_LIBS_DEP) ar.o arparse.o arlex.o maybe-ranlib.o arsup.o
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
 	-rm -f $(RANLIB_PROG)
 	-ln $(AR_PROG) $(RANLIB_PROG)
+	-rm -f $@
+	-ln $(AR_PROG) $@
 
 # objcopy and strip in one binary that uses argv[0] to decide its action.
 
-objcopy_with_strip: $(ADDL_LIBS) objcopy.o maybe-strip.o $(BFD)
+objcopy_with_strip: $(ADDL_LIBS_DEP) objcopy.o maybe-strip.o
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
 	-rm -f $(STRIP_PROG)
 	-ln $(OBJCOPY_PROG) $(STRIP_PROG)
+	-rm -f $@
+	-ln $(OBJCOPY_PROG) $@
 
 sysroff.c: sysinfo sysroff.info 
 	./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c
@@ -341,7 +352,7 @@
 srconv.o: srconv.c sysroff.h sysroff.c coffgrok.h $(INCDIR)/coff/internal.h \
   ../bfd/libcoff.h
 
-srconv: srconv.o coffgrok.o $(ADDL_LIBS)
+srconv: srconv.o coffgrok.o $(ADDL_LIBS_DEP)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ srconv.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
 
 dlltool:dlltool.o defparse.o deflex.o
@@ -361,12 +372,12 @@
 dlltool.o:dlltool.c
 	$(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(DLLTOOL_DEFS) $(CFLAGS) $(srcdir)/dlltool.c
 
-coffdump: coffdump.o coffgrok.o $(ADDL_LIBS)
+coffdump: coffdump.o coffgrok.o $(ADDL_LIBS_DEP)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@  coffdump.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
 
 sysdump.o: sysdump.c sysroff.h sysroff.c
 
-sysdump: sysdump.o $(ADDL_LIBS)
+sysdump: sysdump.o $(ADDL_LIBS_DEP)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ sysdump.o $(ADDL_LIBS) $(EXTRALIBS)
 
 # Depend upon sysinfo.c to avoid building both nlmheader.c and sysinfo.c
@@ -380,7 +391,7 @@
 	ldname=`t='$(program_transform_name)'; echo ld | sed -e "s/brokensed/brokensed/" $$t`; \
 	$(CC) -c -DLD_NAME="\"$${ldname}\"" $(INCLUDES) $(HDEFINES) $(TDEFINES) $(NLMCONV_DEFS) $(CFLAGS) $(srcdir)/nlmconv.c
 
-$(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_LIBS) $(BFD)
+$(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_LIBS_DEP)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ nlmconv.o nlmheader.o $(ADDL_LIBS) $(EXTRALIBS)
 
 # This list of dependencies was generated by doing a make with gcc -MM
diff -urPX exclude binutils-950901-orig/binutils/ar.1 binutils-950901/binutils/ar.1
--- binutils-950901-orig/binutils/ar.1	Tue Jul  4 22:28:22 1995
+++ binutils-950901/binutils/ar.1	Wed Jul 12 20:50:52 1995
@@ -465,7 +465,7 @@
 , Roland H. Pesch (October 1991).
 .BR nm ( 1 )\c
 \&,
-.BR ranlib( 1 )\c
+.BR ranlib ( 1 )\c
 \&.
 
 .SH COPYING
diff -urPX exclude binutils-950901-orig/binutils/ar.c binutils-950901/binutils/ar.c
--- binutils-950901-orig/binutils/ar.c	Fri Aug  4 19:43:45 1995
+++ binutils-950901/binutils/ar.c	Fri Aug  4 20:14:22 1995
@@ -1071,6 +1071,7 @@
   bfd *current;
   bfd **current_ptr;
   bfd *temp;
+  boolean something_changed = false;
 
   while (files_to_move && *files_to_move)
     {
@@ -1113,6 +1114,7 @@
 		  bfd_fatal (*files_to_move);
 		}
 	      (*after_bfd)->next = temp;
+	      something_changed = true;
 
 	      if (verbose)
 		{
@@ -1132,6 +1134,7 @@
 	{
 	  bfd_fatal (*files_to_move);
 	}
+      something_changed = true;
       if (verbose)
 	{
 	  printf ("a - %s\n", *files_to_move);
@@ -1144,7 +1147,8 @@
       files_to_move++;
     }
 
-  write_archive (arch);
+  if (something_changed || write_armap > 0)
+    write_archive (arch);
 }
 
 static void
diff -urPX exclude binutils-950901-orig/binutils/nm.1 binutils-950901/binutils/nm.1
--- binutils-950901-orig/binutils/nm.1	Wed Sep 14 18:28:41 1994
+++ binutils-950901/binutils/nm.1	Wed Jul 12 20:51:13 1995
@@ -94,7 +94,7 @@
 .TP
 .B "\-f \fIformat"
 Use the output format \fIformat\fP, which can be ``bsd'',
-``sysv'', or ``posix''.  The default is `bsd''.
+``sysv'', or ``posix''.  The default is ``bsd''.
 Only the first character of \fIformat\fP is significant; it can be
 either upper or lower case.
 
@@ -160,8 +160,7 @@
 ``d'' for decimal, ``o'' for octal, or ``x'' for hexadecimal.
 
 .TP
-.BI "\-\-target=" "bfdname"\c
-\&
+.BI "\-\-target=" "bfdname"
 Specify an object code format other than your system's default format.
 See 
 .BR objdump ( 1 ),
diff -urPX exclude binutils-950901-orig/binutils/nm.c binutils-950901/binutils/nm.c
--- binutils-950901-orig/binutils/nm.c	Mon Aug 14 20:23:13 1995
+++ binutils-950901/binutils/nm.c	Mon Aug 14 21:24:21 1995
@@ -959,7 +959,7 @@
      char *format, *name;
      bfd *abfd;
 {
-  if (do_demangle)
+  if (do_demangle && *name)
     {
       char *res;
 
diff -urPX exclude binutils-950901-orig/binutils/objdump.1 binutils-950901/binutils/objdump.1
--- binutils-950901-orig/binutils/objdump.1	Wed Feb 15 00:07:18 1995
+++ binutils-950901/binutils/objdump.1	Wed Jul 12 20:52:38 1995
@@ -93,8 +93,7 @@
 .TP
 .BI "\-b " "bfdname"\c
 .TP
-.BI "\-\-target=" "bfdname"\c
-\&
+.BI "\-\-target=" "bfdname"
 Specify the object-code format for the object files to be
 \c
 .I bfdname\c
@@ -107,7 +106,6 @@
 objdump\ \-b\ oasys\ \-m\ vax\ \-h\ fu.o
 .br
 .sp
-
 display summary information from the section headers (`\|\c
 .B \-h\c
 \|') of
@@ -177,11 +175,10 @@
 .TP
 .BI "\-j " "name"\c
 .TP
-.BI "\-\-section=" "name"\c
-\&
+.BI "\-\-section=" "name"
 Display information only for section \c
 .I name\c
-\&
+\&.
 
 .TP
 .B \-l
@@ -194,8 +191,7 @@
 .TP
 .BI "\-m " "machine"\c
 .TP
-.BI "\-\-architecture=" "machine"\c
-\&
+.BI "\-\-architecture=" "machine"
 Specify the object files \c
 .I objfile\c
 \& are for architecture
diff -urPX exclude binutils-950901-orig/binutils/objdump.c binutils-950901/binutils/objdump.c
--- binutils-950901-orig/binutils/objdump.c	Fri Sep  1 18:15:45 1995
+++ binutils-950901/binutils/objdump.c	Fri Sep  1 18:46:17 1995
@@ -222,6 +222,7 @@
   if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
     {
       printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
+      symcount = 0;
       return NULL;
     }
 
@@ -258,6 +259,7 @@
 	{
 	  fprintf (stderr, "%s: %s: not a dynamic object\n",
 		   program_name, bfd_get_filename (abfd));
+	  dynsymcount = 0;
 	  return NULL;
 	}
 
@@ -923,6 +925,7 @@
       if (relbuf != NULL)
 	free (relbuf);
     }
+  free (sorted_syms);
 }
 
 
@@ -1219,6 +1222,16 @@
     dump_data (abfd);
   if (disassemble)
     disassemble_data (abfd);
+  if (syms)
+    {
+      free (syms);
+      syms = NULL;
+    }
+  if (dynsyms)
+    {
+      free (dynsyms);
+      dynsyms = NULL;
+    }
 }
 
 static void
@@ -1405,12 +1418,12 @@
       else if ((a->flags & SEC_RELOC) == 0)
 	continue;
 
-      printf ("RELOCATION RECORDS FOR [%s]:", a->name);
-
       relsize = bfd_get_reloc_upper_bound (abfd, a);
       if (relsize < 0)
 	bfd_fatal (bfd_get_filename (abfd));
 
+      printf ("RELOCATION RECORDS FOR [%s]:", a->name);
+
       if (relsize == 0)
 	{
 	  printf (" (none)\n\n");
@@ -1444,11 +1457,11 @@
   arelent **relpp;
   long relcount;
 
-  printf ("DYNAMIC RELOCATION RECORDS");
-
   relsize = bfd_get_dynamic_reloc_upper_bound (abfd);
   if (relsize < 0)
     bfd_fatal (bfd_get_filename (abfd));
+
+  printf ("DYNAMIC RELOCATION RECORDS");
 
   if (relsize == 0)
     {
diff -urPX exclude binutils-950901-orig/binutils/size.1 binutils-950901/binutils/size.1
--- binutils-950901-orig/binutils/size.1	Thu Jan  6 20:48:32 1994
+++ binutils-950901/binutils/size.1	Wed Jul 12 20:53:26 1995
@@ -47,8 +47,7 @@
 .TP
 .B \-B
 .TP
-.BI "\-\-format " "compatibility"\c
-\&
+.BI "\-\-format " "compatibility"
 Using one of these options, you can choose whether the output from GNU
 \c
 .B size\c
@@ -80,8 +79,7 @@
 .TP
 .B \-x
 .TP
-.BI "\-\-radix " "number"\c
-\&
+.BI "\-\-radix " "number"
 Using one of these options, you can control whether the size of each
 section is given in decimal (`\|\c
 .B \-d\c
@@ -113,8 +111,7 @@
 \|'.
 
 .TP
-.BI "\-\-target " "bfdname"\c
-\&
+.BI "\-\-target " "bfdname"
 You can specify a particular object-code format for \c
 .I objfile\c
 \& as
@@ -140,7 +137,7 @@
 .RB "`\|" binutils "\|'" 
 entry in 
 .BR info ;
-.IR The GNU Binary Utilities ,
+.IR "The GNU Binary Utilities" ,
  Roland H. Pesch (October 1991); 
 .BR ar "(" 1 "),"
 .BR objdump ( 1 ).
diff -urPX exclude binutils-950901-orig/binutils/strings.1 binutils-950901/binutils/strings.1
--- binutils-950901-orig/binutils/strings.1	Fri Aug  4 19:43:51 1995
+++ binutils-950901/binutils/strings.1	Fri Aug  4 20:15:20 1995
@@ -87,6 +87,7 @@
 
 .TP
 .B "\-n \fImin\-len\fP"
+.TP
 .B "\-\fImin\-len\fP"
 .TP
 .B "\-bytes=\fImin\-len\fP"
@@ -103,8 +104,7 @@
 hexadecimal, or decimal.
 
 .TP
-.BI "\-\-target=" "bfdname"\c
-\&
+.BI "\-\-target=" "bfdname"
 Specify an object code format other than your system's default format.
 See 
 .BR objdump ( 1 ),
diff -urPX exclude binutils-950901-orig/binutils/strip.1 binutils-950901/binutils/strip.1
--- binutils-950901-orig/binutils/strip.1	Tue Jul  4 20:52:27 1995
+++ binutils-950901/binutils/strip.1	Wed Jul 12 20:54:18 1995
@@ -89,7 +89,7 @@
 .TP
 .B \-S
 .TP
-.B -g
+.B \-g
 .TP
 .B \-\-strip\-debug
 Remove debugging symbols only.
@@ -113,7 +113,9 @@
 Remove non-global symbols.
 
 .TP
-.B "\-X \-\-discard\-locals"
+.B \-X
+.TP
+.B \-\-discard\-locals
 Remove compiler-generated local symbols.
 (These usually start with ``L'' or ``.''.)
 
@@ -147,7 +149,7 @@
 .RB "`\|" binutils "\|'" 
 entry in 
 .BR info ;
-.IR "The GNU Binary Utilities ,
+.IR "The GNU Binary Utilities" ,
 Roland H. Pesch (October 1991).
 
 .SH COPYING
diff -urPX exclude binutils-950901-orig/config/mh-m68kpic binutils-950901/config/mh-m68kpic
--- binutils-950901-orig/config/mh-m68kpic	Thu Jan  1 01:00:00 1970
+++ binutils-950901/config/mh-m68kpic	Wed Jul 12 22:44:25 1995
@@ -0,0 +1 @@
+PICFLAG=-fpic
diff -urPX exclude binutils-950901-orig/config/mt-m68kpic binutils-950901/config/mt-m68kpic
--- binutils-950901-orig/config/mt-m68kpic	Thu Jan  1 01:00:00 1970
+++ binutils-950901/config/mt-m68kpic	Wed Jul 12 22:44:32 1995
@@ -0,0 +1 @@
+PICFLAG_FOR_TARGET=-fpic
diff -urPX exclude binutils-950901-orig/config.guess binutils-950901/config.guess
--- binutils-950901-orig/config.guess	Wed Aug 16 21:53:43 1995
+++ binutils-950901/config.guess	Wed Aug 16 22:30:10 1995
@@ -325,6 +325,10 @@
 	  echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
 	elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
 	  echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
+	elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
+	  echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
+	elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
+	  echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
 	elif test "${UNAME_MACHINE}" = "alpha" ; then
 	  echo alpha-unknown-linux ; exit 0
 	else
diff -urPX exclude binutils-950901-orig/configure.in binutils-950901/configure.in
--- binutils-950901-orig/configure.in	Fri Sep  1 18:05:18 1995
+++ binutils-950901/configure.in	Fri Sep  1 18:46:55 1995
@@ -94,6 +94,7 @@
   m68k-hp-hpux*)	  host_makefile_frag=config/mh-hp300 ;;
   m68k-apollo-sysv*)      host_makefile_frag=config/mh-apollo68 ;;
   m68k-apollo-bsd*)       host_makefile_frag=config/mh-a68bsd ;;
+  m68k-*-linux*)	  host_makefile_frag=config/mh-linux ;;
   m88k-dg-dgux*)	  host_makefile_frag=config/mh-dgux ;;
   m88k-harris-cxux*)	  host_makefile_frag=config/mh-cxux ;;
   m88k-motorola-sysv*)    host_makefile_frag=config/mh-delta88;;
diff -urPX exclude binutils-950901-orig/gas/Makefile.in binutils-950901/gas/Makefile.in
--- binutils-950901-orig/gas/Makefile.in	Fri Sep  1 18:16:02 1995
+++ binutils-950901/gas/Makefile.in	Fri Sep  1 18:47:38 1995
@@ -57,10 +57,10 @@
 SHELL = /bin/sh
 
 INSTALL = $${srcroot}/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
 INSTALL_XFORM = $(INSTALL) -t='-e $(program_transform_name)'
-INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
+INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 -m 644
 
 DISTSTUFF= make-gas.com m68k-parse.c
 
@@ -72,7 +72,7 @@
 TEXI2DVI = texi2dvi
 RANLIB = ranlib
 CC = @CC@
-CFLAGS = -g
+CFLAGS = @CFLAGS@
 
 MAKEOVERRIDES=
 
@@ -228,6 +228,7 @@
 # and the system's installed libraries.
 
 LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
+LIBS_DEP = @OPCODES_LIB_DEP@ @BFDLIB_DEP@ ../libiberty/libiberty.a
 
 # Specify the directories to be searched for header files.
 # Both . and srcdir are used, in that order,
@@ -248,7 +249,7 @@
 
 $(OBJS): @ALL_OBJ_DEPS@
 
-as.new: $(OBJS) $(LIBS)
+as.new: $(OBJS) $(LIBS_DEP)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
 
 $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
@@ -508,6 +509,6 @@
 
 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
 		$(srcdir)/configure.in config.status conf.in
-	$(SHELL) ./config.status
+	CONFIG_FILES=$@ $(SHELL) ./config.status
 .gdbinit: $(srcdir)/gdbinit.in config.status
-	$(SHELL) ./config.status
+	CONFIG_FILES=$@:gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status
diff -urPX exclude binutils-950901-orig/gas/config/m68k-parse.h binutils-950901/gas/config/m68k-parse.h
--- binutils-950901-orig/gas/config/m68k-parse.h	Mon Aug 14 20:23:38 1995
+++ binutils-950901/gas/config/m68k-parse.h	Mon Aug 14 21:27:00 1995
@@ -194,12 +194,30 @@
   int scale;
 };
 
+#ifdef OBJ_ELF
+/* The type of a PIC expression.  */
+
+enum pic_relocation
+{
+  pic_none,			/* not pic */
+  pic_plt_pcrel,		/* @PLTPC */
+  pic_got_pcrel,		/* @GOTPC */
+  pic_plt_off,			/* @PLT */
+  pic_got_off			/* @GOT */
+};
+#endif
+
 /* The structure used to hold information about an expression.  */
 
 struct m68k_exp
 {
   /* The size to use.  */
   enum m68k_size size;
+
+#ifdef OBJ_ELF
+  /* The type of pic relocation if any.  */
+  enum pic_relocation pic_reloc;
+#endif
 
   /* The expression itself.  */
   expressionS exp;
diff -urPX exclude binutils-950901-orig/gas/config/m68k-parse.y binutils-950901/gas/config/m68k-parse.y
--- binutils-950901-orig/gas/config/m68k-parse.y	Mon Aug 14 20:23:39 1995
+++ binutils-950901/gas/config/m68k-parse.y	Sat Aug 19 16:44:49 1995
@@ -75,10 +75,6 @@
 #define yytable	 m68k_yytable
 #define yycheck	 m68k_yycheck
 
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
 /* Internal functions.  */
 
 static enum m68k_register m68k_reg_parse PARAMS ((char **));
@@ -200,6 +196,16 @@
 		  else
 		    op->mode = DISP;
 		}
+	| '(' zapc ',' EXPR ')'
+		{
+		  op->reg = $2;
+		  op->disp = $4;
+		  if (($2 >= ZADDR0 && $2 <= ZADDR7)
+		      || $2 == ZPC)
+		    op->mode = BASE;
+		  else
+		    op->mode = DISP;
+		}
 	| EXPR '(' zapc ')'
 		{
 		  op->reg = $3;
@@ -690,6 +696,7 @@
   char *s;
   int parens;
   int c = 0;
+  int tail = 0;
   char *hold;
 
   if (*str == ' ')
@@ -888,7 +895,7 @@
   yylval.exp.size = SIZE_UNSPEC;
   if (s <= str + 2
       || (s[-2] != '.' && s[-2] != ':'))
-    s = NULL;
+    tail = 0;
   else
     {
       switch (s[-1])
@@ -908,14 +915,52 @@
 	  yylval.exp.size = SIZE_LONG;
 	  break;
 	default:
-	  s = NULL;
 	  break;
 	}
       if (yylval.exp.size != SIZE_UNSPEC)
-	{
-	  c = s[-2];
-	  s[-2] = '\0';
-	}
+	tail = 2;
+    }
+
+#ifdef OBJ_ELF
+  {
+    /* Look for @PLTPC, etc.  */
+    char *cp;
+
+    yylval.exp.pic_reloc = pic_none;
+    cp = s - tail;
+    if (cp - 6 > str && cp[-6] == '@')
+      {
+	if (strncmp (cp - 6, "@PLTPC", 6) == 0)
+	  {
+	    yylval.exp.pic_reloc = pic_plt_pcrel;
+	    tail += 6;
+	  }
+	else if (strncmp (cp - 6, "@GOTPC", 6) == 0)
+	  {
+	    yylval.exp.pic_reloc = pic_got_pcrel;
+	    tail += 6;
+	  }
+      }
+    else if (cp - 4 > str && cp[-4] == '@')
+      {
+	if (strncmp (cp - 4, "@PLT", 4) == 0)
+	  {
+	    yylval.exp.pic_reloc = pic_plt_off;
+	    tail += 4;
+	  }
+	else if (strncmp (cp - 4, "@GOT", 4) == 0)
+	  {
+	    yylval.exp.pic_reloc = pic_got_off;
+	    tail += 4;
+	  }
+      }
+  }
+#endif
+
+  if (tail != 0)
+    {
+      c = s[-tail];
+      s[-tail] = 0;
     }
 
   hold = input_line_pointer;
@@ -924,9 +969,9 @@
   str = input_line_pointer;
   input_line_pointer = hold;
 
-  if (s != NULL)
+  if (tail != 0)
     {
-      s[-2] = c;
+      s[-tail] = c;
       str = s;
     }
 
diff -urPX exclude binutils-950901-orig/gas/config/obj-aout.h binutils-950901/gas/config/obj-aout.h
--- binutils-950901-orig/gas/config/obj-aout.h	Thu Jul  6 23:11:37 1995
+++ binutils-950901/gas/config/obj-aout.h	Wed Jul 12 21:02:00 1995
@@ -89,7 +89,7 @@
 #define S_IS_EXTERNAL(s)	((s)->sy_symbol.n_type & N_EXT)
 
 /* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */
-#define S_IS_DEFINED(s)		((S_GET_TYPE(s) != N_UNDF) || (S_GET_OTHER(s) != 0) || (S_GET_DESC(s) != 0))
+#define S_IS_DEFINED(s)		(((S_GET_TYPE(s) & N_TYPE) != N_UNDF) || (S_GET_OTHER(s) != 0) || (S_GET_DESC(s) != 0))
 
 #define S_IS_REGISTER(s)	((s)->sy_symbol.n_type == N_REGISTER)
 
@@ -113,9 +113,9 @@
 /* The pointer to the string table */
 #define S_GET_OFFSET(s)		((s)->sy_symbol.n_un.n_strx)
 /* The type of the symbol */
-#define S_GET_TYPE(s)		((s)->sy_symbol.n_type & N_TYPE)
+#define S_GET_TYPE(s)		((s)->sy_symbol.n_type)
 /* The numeric value of the segment */
-#define S_GET_SEGMENT(s)	(N_TYPE_seg[S_GET_TYPE(s)])
+#define S_GET_SEGMENT(s)	(N_TYPE_seg[S_GET_TYPE(s) & N_TYPE])
 /* The n_other expression value */
 #define S_GET_OTHER(s)		((s)->sy_symbol.n_other)
 /* The n_desc expression value */
diff -urPX exclude binutils-950901-orig/gas/config/obj-elf.c binutils-950901/gas/config/obj-elf.c
--- binutils-950901-orig/gas/config/obj-elf.c	Mon Aug 14 20:23:45 1995
+++ binutils-950901/gas/config/obj-elf.c	Mon Aug 14 21:28:40 1995
@@ -280,7 +280,19 @@
 	/* allocate_bss: */
 	  old_sec = now_seg;
 	  old_subsec = now_subseg;
-	  align = temp;
+	  if (temp)
+	    {
+	      /* convert to a power of 2 alignment */
+	      for (align = 0; (temp & 1) == 0; temp >>= 1, ++align);
+	      if (temp != 1)
+		{
+		  as_bad ("Common alignment not a power of 2");
+		  ignore_rest_of_line ();
+		  return;
+		}
+	    }
+	  else
+	    align = 0;
 	  record_alignment (bss_section, align);
 	  subseg_set (bss_section, 0);
 	  if (align)
@@ -291,6 +303,7 @@
 	  pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size,
 			    (char *) 0);
 	  *pfrag = 0;
+	  S_SET_SIZE (symbolP, size);
 	  S_SET_SEGMENT (symbolP, bss_section);
 	  S_CLEAR_EXTERNAL (symbolP);
 	  subseg_set (old_sec, old_subsec);
diff -urPX exclude binutils-950901-orig/gas/config/tc-m68k.c binutils-950901/gas/config/tc-m68k.c
--- binutils-950901-orig/gas/config/tc-m68k.c	Fri Sep  1 18:16:10 1995
+++ binutils-950901/gas/config/tc-m68k.c	Fri Sep  1 18:48:36 1995
@@ -19,7 +19,6 @@
    02111-1307, USA.  */
 
 #include <ctype.h>
-#define  NO_RELOC 0
 #include "as.h"
 #include "obstack.h"
 #include "subsegs.h"
@@ -29,7 +28,7 @@
 
 /* This array holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful */
-#if defined (OBJ_ELF) || defined (TE_DELTA)
+#if (defined (OBJ_ELF) && !defined (TE_LINUX)) || defined (TE_DELTA)
 CONST char comment_chars[] = "|#";
 #else
 CONST char comment_chars[] = "|";
@@ -199,6 +198,9 @@
 	 significance of some values (in the branch instruction, for
 	 example).  */
       int pcrel_fix;
+#ifdef OBJ_ELF
+      enum pic_relocation pic_reloc;
+#endif
     }
   reloc[5];			/* Five is enough??? */
 };
@@ -252,6 +254,9 @@
   the_ins.reloc[the_ins.nrel].exp = exp->exp;
   the_ins.reloc[the_ins.nrel].wid = width;
   the_ins.reloc[the_ins.nrel].pcrel_fix = pc_fix;
+#ifdef OBJ_ELF
+  the_ins.reloc[the_ins.nrel].pic_reloc = exp->pic_reloc;
+#endif
   the_ins.reloc[the_ins.nrel++].pcrel = pc_rel;
 }
 
@@ -427,7 +432,7 @@
   {"even", s_even, 0},
   {"skip", s_space, 0},
   {"proc", s_proc, 0},
-#ifdef TE_SUN3
+#if defined (TE_SUN3) || defined (OBJ_ELF)
   {"align", s_align_bytes, 0},
 #endif
 #ifdef OBJ_ELF
@@ -497,7 +502,11 @@
   {"dsb", s_space, 1},
 
   {"xdef", s_globl, 0},
+#ifdef OBJ_ELF
+  {"align", s_align_bytes, 0},
+#else
   {"align", s_align_ptwo, 0},
+#endif
 #ifdef M68KCOFF
   {"sect", obj_coff_section, 0},
   {"section", obj_coff_section, 0},
@@ -516,6 +525,8 @@
 
 extern char *input_line_pointer;
 
+static symbolS *GOT_symbol;	/* Pre-defined "_GLOBAL_OFFSET_TABLE_" */
+
 static char mklower_table[256];
 #define mklower(c) (mklower_table[(unsigned char)(c)])
 static char notend_table[256];
@@ -580,6 +591,130 @@
 
 #endif
 
+#ifdef OBJ_ELF
+
+static bfd_reloc_code_real_type
+reloc (size, pcrel, pic)
+     int size;
+     int pcrel;
+     enum pic_relocation pic;
+{
+  switch (pic)
+    {
+    case pic_got_pcrel:
+      switch (size)
+	{
+	case 1:
+	  return BFD_RELOC_8_GOT_PCREL;
+	case 2:
+	  return BFD_RELOC_16_GOT_PCREL;
+	case 4:
+	  return BFD_RELOC_32_GOT_PCREL;
+	}
+      break;
+
+    case pic_got_off:
+      switch (size)
+	{
+	case 1:
+	  return BFD_RELOC_8_GOTOFF;
+	case 2:
+	  return BFD_RELOC_16_GOTOFF;
+	case 4:
+	  return BFD_RELOC_32_GOTOFF;
+	}
+      break;
+
+    case pic_plt_pcrel:
+      switch (size)
+	{
+	case 1:
+	  return BFD_RELOC_8_PLT_PCREL;
+	case 2:
+	  return BFD_RELOC_16_PLT_PCREL;
+	case 4:
+	  return BFD_RELOC_32_PLT_PCREL;
+	}
+      break;
+
+    case pic_plt_off:
+      switch (size)
+	{
+	case 1:
+	  return BFD_RELOC_8_PLTOFF;
+	case 2:
+	  return BFD_RELOC_16_PLTOFF;
+	case 4:
+	  return BFD_RELOC_32_PLTOFF;
+	}
+      break;
+
+    case pic_none:
+      if (pcrel)
+	{
+	  switch (size)
+	    {
+	    case 1:
+	      return BFD_RELOC_8_PCREL;
+	    case 2:
+	      return BFD_RELOC_16_PCREL;
+	    case 4:
+	      return BFD_RELOC_32_PCREL;
+	    }
+	}
+      else
+	{
+	  switch (size)
+	    {
+	    case 1:
+	      return BFD_RELOC_8;
+	    case 2:
+	      return BFD_RELOC_16;
+	    case 4:
+	      return BFD_RELOC_32;
+	    }
+	}
+    }
+
+  as_bad ("Can not do %d byte %s%srelocation", size,
+	  pcrel ? "pc-relative " : "",
+	  pic == pic_none ? "" : "pic ");
+  return BFD_RELOC_NONE;
+}
+
+/* Here we decide which fixups can be adjusted to make them relative
+   to the beginning of the section instead of the symbol.  Basically
+   we need to make sure that the dynamic relocations are done
+   correctly, so in some cases we force the original symbol to be
+   used.  */
+int
+tc_m68k_fix_adjustable (fixP)
+     fixS *fixP;
+{
+  /* Prevent all adjustments to global symbols. */
+  if (S_IS_EXTERNAL (fixP->fx_addsy))
+    return 0;
+
+  /* adjust_reloc_syms doesn't know about the GOT */
+  switch (fixP->fx_r_type)
+    {
+    case BFD_RELOC_8_GOTOFF:
+    case BFD_RELOC_16_GOTOFF:
+    case BFD_RELOC_32_GOTOFF:
+    case BFD_RELOC_8_PLT_PCREL:
+    case BFD_RELOC_16_PLT_PCREL:
+    case BFD_RELOC_32_PLT_PCREL:
+      return 0;
+    }
+  return 1;
+}
+
+#else /* !OBJ_ELF */
+
+#define reloc(SIZE,PCREL,OTHER) NO_RELOC
+
+#endif /* OBJ_ELF */
+
 #ifdef BFD_ASSEMBLER
 
 arelent *
@@ -590,28 +725,50 @@
   arelent *reloc;
   bfd_reloc_code_real_type code;
 
-#define F(SZ,PCREL)		(((SZ) << 1) + (PCREL))
-  switch (F (fixp->fx_size, fixp->fx_pcrel))
+  if (fixp->fx_r_type != BFD_RELOC_NONE)
+    code = fixp->fx_r_type;
+  else
     {
+#define F(SZ,PCREL)		(((SZ) << 1) + (PCREL))
+      switch (F (fixp->fx_size, fixp->fx_pcrel))
+	{
 #define MAP(SZ,PCREL,TYPE)	case F(SZ,PCREL): code = (TYPE); break
-      MAP (1, 0, BFD_RELOC_8);
-      MAP (2, 0, BFD_RELOC_16);
-      MAP (4, 0, BFD_RELOC_32);
-      MAP (1, 1, BFD_RELOC_8_PCREL);
-      MAP (2, 1, BFD_RELOC_16_PCREL);
-      MAP (4, 1, BFD_RELOC_32_PCREL);
-    default:
-      abort ();
+	  MAP (1, 0, BFD_RELOC_8);
+	  MAP (2, 0, BFD_RELOC_16);
+	  MAP (4, 0, BFD_RELOC_32);
+	  MAP (1, 1, BFD_RELOC_8_PCREL);
+	  MAP (2, 1, BFD_RELOC_16_PCREL);
+	  MAP (4, 1, BFD_RELOC_32_PCREL);
+	default:
+	  abort ();
+	}
     }
+#undef F
+#undef MAP
 
   reloc = (arelent *) bfd_alloc_by_size_t (stdoutput, sizeof (arelent));
   assert (reloc != 0);
   reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
   reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+#ifndef OBJ_ELF
   if (fixp->fx_pcrel)
     reloc->addend = fixp->fx_addnumber;
   else
     reloc->addend = 0;
+#else
+  if (!fixp->fx_pcrel)
+    reloc->addend = fixp->fx_addnumber;
+  else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0)
+    reloc->addend = (section->vma
+		     + (fixp->fx_pcrel_adjust == 64
+			? -1 : fixp->fx_pcrel_adjust)
+		     + fixp->fx_addnumber
+		     + md_pcrel_from (fixp));
+  else
+    reloc->addend = (fixp->fx_offset
+		     + (fixp->fx_pcrel_adjust == 64
+			? -1 : fixp->fx_pcrel_adjust));
+#endif
 
   reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
   assert (reloc->howto != 0);
@@ -2883,7 +3040,8 @@
 			      n,
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
-			      NO_RELOC);
+			      reloc (n, the_ins.reloc[m].pcrel,
+				     the_ins.reloc[m].pic_reloc));
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	}
       return;
@@ -2927,7 +3085,8 @@
 			      wid,
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
-			      NO_RELOC);
+			      reloc (wid, the_ins.reloc[m].pcrel,
+				     the_ins.reloc[m].pic_reloc));
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	}
       (void) frag_var (rs_machine_dependent, 10, 0,
@@ -2963,7 +3122,8 @@
 			  wid,
 			  &the_ins.reloc[m].exp,
 			  the_ins.reloc[m].pcrel,
-			  NO_RELOC);
+			  reloc (wid, the_ins.reloc[m].pcrel,
+				 the_ins.reloc[m].pic_reloc));
       fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
     }
 }
@@ -3130,6 +3290,15 @@
 #endif
 
   init_regtable ();
+
+#ifdef OBJ_ELF
+  record_alignment (text_section, 2);
+  record_alignment (data_section, 2);
+  record_alignment (bss_section, 2);
+#endif
+
+  if (flag_want_pic)
+    GOT_symbol = symbol_find_or_make (GLOBAL_OFFSET_TABLE_NAME);
 }
 
 void
@@ -3316,6 +3485,17 @@
   else
     val &= 0x7fffffff;
 
+#ifdef OBJ_ELF
+  if (fixP->fx_addsy)
+    {
+      int i;
+      for (i = 0; i < fixP->fx_size; i++)
+	*buf++ = 0;
+      fixP->fx_addnumber = val;	/* Remember value for emit_reloc */
+      return;
+    }
+#endif
+
   switch (fixP->fx_size)
     {
       /* The cast to offsetT below are necessary to make code correct for
@@ -3441,7 +3621,6 @@
 	    {
 	      fragP->fr_opcode[0] = 0x4E;
 	      fragP->fr_opcode[1] = (char) 0xB9; /* JBSR with ABSL LONG offset */
-	      subseg_change (text_section, 0); /* @@ */
 
 	      fix_new (fragP,
 		       fragP->fr_fix,
@@ -3459,7 +3638,6 @@
 	    {
 	      fragP->fr_opcode[0] = 0x4E;
 	      fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
-	      subseg_change (text_section, 0); /* @@ */
 	      fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
 		       fragP->fr_offset, 0, NO_RELOC);
 	      fragP->fr_fix += 4;
@@ -3488,7 +3666,6 @@
       *buffer_address++ = 0x4e;	/* put in jmp long (0x4ef9) */
       *buffer_address++ = (char) 0xf9;
       fragP->fr_fix += 2;	/* account for jmp instruction */
-      subseg_change (text_section, 0);
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
 	       fragP->fr_offset, 0, NO_RELOC);
       fragP->fr_fix += 4;
@@ -3506,7 +3683,6 @@
       *buffer_address++ = (char) 0xf9;
 
       fragP->fr_fix += 6;	/* account for bra/jmp instructions */
-      subseg_change (text_section, 0);
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
 	       fragP->fr_offset, 0, NO_RELOC);
       fragP->fr_fix += 4;
@@ -3527,7 +3703,6 @@
       /* The thing to do here is force it to ABSOLUTE LONG, since
 	PCREL is really trying to shorten an ABSOLUTE address anyway */
       /* JF FOO This code has not been tested */
-      subseg_change (text_section, 0);
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
 	       0, NO_RELOC);
       if ((fragP->fr_opcode[1] & 0x3F) != 0x3A)
@@ -3540,7 +3715,6 @@
       ext = 0;
       break;
     case TAB (PCLEA, SHORT):
-      subseg_change (text_section, 0);
       fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
 	       fragP->fr_offset, 1, NO_RELOC);
       fragP->fr_opcode[1] &= ~0x3F;
@@ -3548,9 +3722,17 @@
       ext = 2;
       break;
     case TAB (PCLEA, LONG):
-      subseg_change (text_section, 0);
       fixP = fix_new (fragP, (int) (fragP->fr_fix) + 2, 4, fragP->fr_symbol,
-		      fragP->fr_offset, 1, NO_RELOC);
+		      fragP->fr_offset, 1,
+#ifdef OBJ_ELF
+		      ((flag_want_pic && fragP->fr_symbol
+			&& fragP->fr_symbol == GOT_symbol)
+		       ? BFD_RELOC_32_GOT_PCREL
+		       : BFD_RELOC_32_PCREL)
+#else
+		      NO_RELOC
+#endif
+		      );
       fixP->fx_pcrel_adjust = 2;
       /* Already set to mode 7.3; this indicates: PC indirect with
 	 suppressed index, 32-bit displacement.  */
@@ -3573,7 +3755,6 @@
       ext = 0;
       break;
     case TAB (PCINDEX, SHORT):
-      subseg_change (text_section, 0);
       disp += 2;
       assert (issword (disp));
       assert (fragP->fr_fix >= 2);
@@ -3586,7 +3767,6 @@
       ext = 2;
       break;
     case TAB (PCINDEX, LONG):
-      subseg_change (text_section, 0);
       disp += 2;
       fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
 		      fragP->fr_offset, (fragP->fr_opcode[1] & 077) == 073,
@@ -3662,7 +3842,6 @@
 	      {
 		fragP->fr_opcode[0] = 0x4E;
 		fragP->fr_opcode[1] = (char) 0xB9; /* JBSR with ABSL LONG offset */
-		subseg_change (text_section, 0);
 		fix_new (fragP, fragP->fr_fix, 4,
 			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
 		fragP->fr_fix += 4;
@@ -3672,7 +3851,6 @@
 	      {
 		fragP->fr_opcode[0] = 0x4E;
 		fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
-		subseg_change (text_section, 0);
 		fix_new (fragP, fragP->fr_fix, 4,
 			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
 		fragP->fr_fix += 4;
@@ -3749,7 +3927,6 @@
 	    buffer_address[0] = 0x4e;	/* put in jmp long (0x4ef9) */
 	    buffer_address[1] = (char) 0xf8;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
-	    subseg_change (text_section, 0);
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
 		     fragP->fr_offset, 0, NO_RELOC);
 	    fragP->fr_fix += 2;
@@ -3761,7 +3938,6 @@
 	    buffer_address[0] = 0x4e;	/* put in jmp long (0x4ef9) */
 	    buffer_address[1] = (char) 0xf9;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
-	    subseg_change (text_section, 0);
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
 		     fragP->fr_offset, 0, NO_RELOC);
 	    fragP->fr_fix += 4;
@@ -3792,7 +3968,6 @@
 	    buffer_address[4] = 0x4e;	/* Put in Jump Word */
 	    buffer_address[5] = (char) 0xf8;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
-	    subseg_change (text_section, 0);
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
 		     fragP->fr_offset, 0, NO_RELOC);
 	    fragP->fr_fix += 2;
@@ -3804,7 +3979,6 @@
 	    buffer_address[4] = 0x4e;	/* put in jmp long (0x4ef9) */
 	    buffer_address[5] = (char) 0xf9;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
-	    subseg_change (text_section, 0);
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
 		     fragP->fr_offset, 0, NO_RELOC);
 	    fragP->fr_fix += 4;
diff -urPX exclude binutils-950901-orig/gas/config/tc-m68k.h binutils-950901/gas/config/tc-m68k.h
--- binutils-950901-orig/gas/config/tc-m68k.h	Tue Aug 29 19:02:58 1995
+++ binutils-950901/gas/config/tc-m68k.h	Tue Aug 29 19:15:43 1995
@@ -25,12 +25,15 @@
 #ifdef OBJ_AOUT
 #ifdef TE_SUN3
 #define TARGET_FORMAT "a.out-sunos-big"
-#else
+#endif
 #ifdef TE_NetBSD
 #define TARGET_FORMAT "a.out-m68k-netbsd"
-#else
-#define TARGET_FORMAT "a.out-zero-big"
 #endif
+#ifdef TE_LINUX
+#define TARGET_FORMAT "a.out-m68k-linux"
+#endif
+#ifndef TARGET_FORMAT
+#define TARGET_FORMAT "a.out-zero-big"
 #endif
 #endif
 
@@ -113,11 +116,42 @@
 #endif
 
 #ifdef BFD_ASSEMBLER
+
 #define tc_frob_symbol(sym,punt) \
     if (S_GET_SEGMENT (sym) == reg_section) punt = 1
+
+#define NO_RELOC BFD_RELOC_NONE
+
+#ifdef OBJ_ELF
+
+/* This expression evaluates to false if the relocation is for a local object
+   for which we still want to do the relocation at runtime.  True if we
+   are willing to perform this relocation while building the .o file.  */
+
+#define TC_RELOC_RTSYM_LOC_FIXUP(FIX)			\
+	((FIX)->fx_r_type != BFD_RELOC_8_PLT_PCREL	\
+	 && (FIX)->fx_r_type != BFD_RELOC_16_PLT_PCREL	\
+	 && (FIX)->fx_r_type != BFD_RELOC_32_PLT_PCREL	\
+	 && (FIX)->fx_r_type != BFD_RELOC_8_GOT_PCREL	\
+	 && (FIX)->fx_r_type != BFD_RELOC_16_GOT_PCREL	\
+	 && (FIX)->fx_r_type != BFD_RELOC_32_GOT_PCREL)
+
+#define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X)
+#endif
+
+#else
+#define NO_RELOC 0
 #endif
 
 #define DIFF_EXPR_OK
+
+#ifndef GLOBAL_OFFSET_TABLE_NAME
+#ifdef OBJ_ELF
+#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
+#else
+#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_"
+#endif
+#endif
 
 extern void m68k_init_after_args PARAMS ((void));
 #define tc_init_after_args m68k_init_after_args
diff -urPX exclude binutils-950901-orig/gas/config/te-linux.h binutils-950901/gas/config/te-linux.h
--- binutils-950901-orig/gas/config/te-linux.h	Wed May  5 14:40:57 1993
+++ binutils-950901/gas/config/te-linux.h	Wed Jul 12 21:18:11 1995
@@ -1,2 +1,4 @@
 #define TE_LINUX
+#define LOCAL_LABELS_FB 1
+
 #include "obj-format.h"
diff -urPX exclude binutils-950901-orig/gas/configure.in binutils-950901/gas/configure.in
--- binutils-950901-orig/gas/configure.in	Mon Aug 14 20:24:10 1995
+++ binutils-950901/gas/configure.in	Mon Aug 14 21:30:46 1995
@@ -9,14 +9,14 @@
 dnl
 user_bfd_gas=
 AC_ARG_ENABLE(bfd-assembler,
-[    bfd-assembler	use BFD back end for writing object files],
+[  --enable-bfd-assembler  use BFD back end for writing object files],
 [case "${enableval}" in
   yes) need_bfd=yes user_bfd_gas=yes ;;
   no)  user_bfd_gas=no ;;
   *)   AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
 esac])dnl
 AC_ARG_ENABLE(targets,
-[    targets            alternative target configurations besides the primary],
+[  --enable-targets        alternative target configurations besides the primary],
 [case "${enableval}" in
   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
 	    ;;
@@ -64,10 +64,12 @@
   alpha | vax)
     ;;
   *)
-    OPCODES_LIB="../opcodes/libopcodes.a"
+    OPCODES_LIB="-L../opcodes -lopcodes"
+    OPCODES_LIB_DEP="../opcodes/libopcodes.a"
     ;;
 esac
 AC_SUBST(OPCODES_LIB)
+AC_SUBST(OPCODES_LIB_DEP)
 
 gas_target=${cpu_type}
 this_target=${generic_target}
@@ -195,6 +197,8 @@
 			    fmt=coff targ=m68kcoff ;;
       m68k-*-elf)           fmt=elf ;;
       m68k-*-hpux*)         fmt=hp300 em=hp300 ;;
+      m68k-*-linux*aout*)   fmt=aout em=linux ;;
+      m68k-*-linux)	    fmt=elf em=linux ;;
       m68k-*-lynxos*)       fmt=coff targ=m68kcoff
 			     em=lynx ;;
       m68k-*-netbsd*)       fmt=aout em=nbsd bfd_gas=yes ;;
@@ -493,11 +497,13 @@
 esac
 
 case "${need_bfd}" in
-  yes)	BFDLIB=../bfd/libbfd.a
+  yes)	BFDLIB="-L../bfd -lbfd"
+	BFDLIB_DEP=../bfd/libbfd.a
 	ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
 	;;
 esac
 AC_SUBST(BFDLIB)
+AC_SUBST(BFDLIB_DEP)
 AC_SUBST(ALL_OBJ_DEPS)
 
 AC_DEFINE_UNQUOTED(TARGET_ALIAS,	"${target_alias}")
diff -urPX exclude binutils-950901-orig/gas/doc/Makefile.in binutils-950901/gas/doc/Makefile.in
--- binutils-950901-orig/gas/doc/Makefile.in	Mon Jul 10 22:54:22 1995
+++ binutils-950901/gas/doc/Makefile.in	Wed Aug  2 22:47:02 1995
@@ -170,5 +170,6 @@
 
 force:
 
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
-	(cd .. ; $(SHELL) ./config.status)
+Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
+	../config.status
+	(cd .. ; CONFIG_FILES=doc/$@ CONFIG_HEADERS= $(SHELL) ./config.status)
diff -urPX exclude binutils-950901-orig/gas/expr.c binutils-950901/gas/expr.c
--- binutils-950901-orig/gas/expr.c	Sat Aug 19 01:00:40 1995
+++ binutils-950901/gas/expr.c	Sat Aug 19 01:29:46 1995
@@ -591,6 +591,7 @@
 	    {
 	      switch (input_line_pointer[1])
 		{
+#if 0 /* This fails for expressions like 0b+10 or 0b-foo */
 		case '+':
 		case '-':
 		  /* If unambiguously a difference expression, treat
@@ -604,6 +605,7 @@
 		      goto is_0b_label;
 		  }
 		  goto is_0b_binary;
+#endif
 		case '0':    case '1':
 		  /* Some of our code elsewhere does permit digits
 		     greater than the expected base; for consistency,
diff -urPX exclude binutils-950901-orig/gas/flonum-konst.c binutils-950901/gas/flonum-konst.c
--- binutils-950901-orig/gas/flonum-konst.c	Thu Jul  6 23:09:14 1995
+++ binutils-950901/gas/flonum-konst.c	Wed Jul 12 21:31:55 1995
@@ -44,7 +44,7 @@
 /* JF:  If this equals 6553/(2^16)+39321/(2^32)+...  it approaches .1 */
 static const LITTLENUM_TYPE minus_1[] =
 {
-  39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321,
+  39322, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321,
   39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 39321, 6553};
 static const LITTLENUM_TYPE plus_1[] =
 {10};
@@ -52,7 +52,7 @@
 /* JF:  If this equals 655/(2^16) + 23592/(2^32) + ... it approaches .01 */
 static const LITTLENUM_TYPE minus_2[] =
 {
-  10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807,
+  10486, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 49807,
   10485, 36700, 62914, 23592, 49807, 10485, 36700, 62914, 23592, 655};
 static const LITTLENUM_TYPE plus_2[] =
 {100};
@@ -60,7 +60,7 @@
 /* This approaches .0001 */
 static const LITTLENUM_TYPE minus_3[] =
 {
-  52533, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503,
+  52534, 20027, 37329, 65116, 64067, 60397, 14784, 18979, 33659, 19503,
   2726, 9542, 629, 2202, 40475, 10590, 4299, 47815, 36280, 6};
 static const LITTLENUM_TYPE plus_3[] =
 {10000};
@@ -68,7 +68,7 @@
 /* JF: this approaches 1e-8 */
 static const LITTLENUM_TYPE minus_4[] =
 {
-  22516, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327,
+  22517, 49501, 54293, 19424, 60699, 6716, 24348, 22618, 23904, 21327,
   3919, 44703, 19149, 28803, 48959, 6259, 50273, 62237, 42};
 /* This equals 1525 * 2^16 + 57600 */
 static const LITTLENUM_TYPE plus_4[] =
@@ -98,45 +98,45 @@
 
 static const LITTLENUM_TYPE minus_8[] =
 {
-  45849, 19069, 18068, 36324, 37948, 48745, 10873, 64360, 15961, 20566,
+  27579, 64807, 12543, 794, 13907, 61297, 12013, 64360, 15961, 20566,
   24178, 15922, 59427, 110};
 static const LITTLENUM_TYPE plus_8[] =
 {
-  15873, 11925, 39177, 991, 14589, 19735, 25347, 65086, 53853, 938,
-  37209, 47086, 33626, 23253, 32586, 42547, 9731, 59679, 590};
+  15873, 11925, 39177, 991, 14589, 3861, 58415, 9076, 62956, 54223,
+  56328, 50180, 45274, 48333, 32537, 42547, 9731, 59679, 590};
 
 static const LITTLENUM_TYPE minus_9[] =
 {
-  63601, 55221, 43562, 33661, 29067, 28203, 65417, 64352, 22462, 41110,
-  12570, 28635, 23199, 50572, 28471, 27074, 46375, 64028, 13106, 63700,
-  32698, 17493, 32420, 34382, 22750, 20681, 12300};
+  11042, 8464, 58971, 63429, 6022, 63485, 5500, 53464, 47545, 50068,
+  56988, 22819, 49708, 54493, 9920, 47667, 40409, 35764, 10383, 54466,
+  32702, 17493, 32420, 34382, 22750, 20681, 12300};
 static const LITTLENUM_TYPE plus_9[] =
 {
-  63564, 61556, 29377, 54467, 18621, 28141, 36415, 61241, 47119, 30026,
-  19740, 46002, 13541, 61413, 30480, 38664, 32205, 50593, 51112, 48904,
-  48263, 43814, 286, 30826, 52813, 62575, 61390, 24540, 21495, 5};
+  20678, 27614, 28272, 53066, 55311, 54677, 29038, 9906, 26288, 44486,
+  13860, 7445, 54106, 15426, 21518, 25599, 29632, 52309, 61207, 26105,
+  10482, 21948, 51191, 32988, 60892, 62574, 61390, 24540, 21495, 5};
 
 static const LITTLENUM_TYPE minus_10[] =
 {
-  50313, 34681, 1464, 25889, 19575, 41125, 17635, 4598, 49708, 13427,
-  17287, 56115, 53783, 38255, 32415, 17778, 31596, 7557, 20951, 18477,
-  40353, 1178, 44405, 11837, 11571, 50963, 15649, 11698, 40675, 2308,};
+  6214, 48771, 23471, 30163, 31763, 38013, 57001, 11770, 18263, 36366,
+  20742, 45086, 56969, 53231, 37856, 55814, 38057, 15692, 46761, 8713,
+  6102, 20083, 8269, 11839, 11571, 50963, 15649, 11698, 40675, 2308};
 static const LITTLENUM_TYPE plus_10[] =
 {
-  18520, 53764, 54535, 61910, 61962, 59843, 46270, 58053, 12473, 63785,
-  2449, 43230, 50044, 47595, 10403, 35766, 32607, 1124, 24966, 35044,
-  25524, 23631, 18826, 14518, 58448, 14562, 49618, 5588, 25396, 28};
+  63839, 36576, 45712, 44516, 37803, 29482, 4966, 30556, 37961, 23310,
+  27070, 44972, 29507, 48257, 45209, 7494, 17831, 38728, 41577, 29443,
+  36016, 7955, 35339, 35479, 36011, 14553, 49618, 5588, 25396, 28};
 
 static const LITTLENUM_TYPE minus_11[] =
 {
-  6223, 59909, 62437, 59960, 14652, 45336, 48800, 7647, 51962, 37982,
-  60436, 58176, 26767, 8440, 9831, 48556, 20994, 14148, 6757, 17221,
-  60624, 46129, 53210, 44085, 54016, 24259, 11232, 21229, 21313, 81,};
+  16663, 56882, 61983, 7804, 36555, 32060, 34502, 1000, 14356, 21681,
+  6605, 34767, 51411, 59048, 53614, 39850, 30079, 6496, 6846, 26841,
+  40778, 19578, 59899, 44085, 54016, 24259, 11232, 21229, 21313, 81};
 static const LITTLENUM_TYPE plus_11[] =
 {
-  36159, 2055, 33615, 61362, 23581, 62454, 9748, 15275, 39284, 58636,
-  16269, 42793, 47240, 45774, 50861, 48400, 9413, 40281, 4030, 9572,
-  7984, 33038, 59522, 19450, 40593, 24486, 54320, 6661, 55766, 805,};
+  92, 9054, 62707, 17993, 7821, 56838, 13992, 21321, 29637, 48426,
+  42982, 38668, 49574, 28820, 18200, 18927, 53979, 16219, 37484, 2516,
+  44642, 14665, 11587, 41926, 13556, 23956, 54320, 6661, 55766, 805};
 
 /* Shut up complaints about differing pointer types.  They only differ
    in the const attribute, but there isn't any easy way to do this
diff -urPX exclude binutils-950901-orig/gas/read.c binutils-950901/gas/read.c
--- binutils-950901-orig/gas/read.c	Thu Aug 31 19:49:09 1995
+++ binutils-950901/gas/read.c	Thu Aug 31 20:06:02 1995
@@ -114,9 +114,9 @@
 char is_end_of_line[256] =
 {
 #ifdef CR_EOL
-  _, _, _, _, _, _, _, _, _, _, 99, _, _, 99, _, _,	/* @abcdefghijklmno */
+  99, _, _, _, _, _, _, _, _, _, 99, _, _, 99, _, _,	/* @abcdefghijklmno */
 #else
-  _, _, _, _, _, _, _, _, _, _, 99, _, _, _, _, _,	/* @abcdefghijklmno */
+  99, _, _, _, _, _, _, _, _, _, 99, _, _, _, _, _,	/* @abcdefghijklmno */
 #endif
   _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,	/* */
 #ifdef TC_HPPA
diff -urPX exclude binutils-950901-orig/gas/write.c binutils-950901/gas/write.c
--- binutils-950901-orig/gas/write.c	Fri Sep  1 18:16:13 1995
+++ binutils-950901/gas/write.c	Fri Sep  1 18:49:22 1995
@@ -2318,6 +2318,7 @@
 		  reloc_callj (fixP);
 #endif /* TC_I960 */
 		  add_number += S_GET_VALUE (add_symbolP);
+		  pcrel = 0;
 
 		  /* Let the target machine make the final determination
 		     as to whether or not a relocation will be needed to
@@ -2325,6 +2326,7 @@
 		  
 		  if (TC_FORCE_RELOCATION (fixP))
 		    {
+		      fixP->fx_pcrel = 0;
 		      fixP->fx_addsy = NULL;
 		      add_symbolP = NULL;
 		    }
@@ -2362,8 +2364,10 @@
 	      else
 		{
 		  seg_reloc_count++;
+#if !(defined (TC_M68K) && defined (OBJ_ELF))
 #if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF))
 		  add_number += S_GET_VALUE (add_symbolP);
+#endif
 #endif
 		}
 	    }
diff -urPX exclude binutils-950901-orig/gprof/Makefile.in binutils-950901/gprof/Makefile.in
--- binutils-950901-orig/gprof/Makefile.in	Wed Aug 23 18:19:19 1995
+++ binutils-950901/gprof/Makefile.in	Wed Aug 23 18:37:46 1995
@@ -6,7 +6,7 @@
 srcdir = @srcdir@
 prefix = @prefix@
 
-exec_prefix 	= $(prefix)
+exec_prefix 	= @exec_prefix@
 program_transform_name = @program_transform_name@
 
 bindir 	= $(exec_prefix)/bin
@@ -22,9 +22,9 @@
 
 INSTALL = `cd $(srcdir); pwd`/../install.sh -c
 INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
-INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
+INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 -m 644
 MAKEINFO	= makeinfo
 TEX		= tex
 TEXINDEX	= texindex
@@ -40,7 +40,8 @@
 	gmon_io.c gprof.c hertz.c hist.c source.c search_list.c symtab.c \
 	sym_ids.c utils.c
 
-LIBS = ../bfd/libbfd.a ../libiberty/libiberty.a
+LIBS = -L../bfd -lbfd ../libiberty/libiberty.a
+LIBS_DEP = ../bfd/libbfd.a ../libiberty/libiberty.a
 
 OBJS=	$(MY_TARGET).o basic_blocks.o bsd_callg_bl.o call_graph.o \
 	cg_arcs.o cg_dfn.o cg_print.o core.o flat_bl.o fsf_callg_bl.o \
@@ -50,8 +51,8 @@
 # Files that can be generated, but should be included in distribution.
 DISTSTUFF = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
 
-CFLAGS=-g -DDEBUG
-LDFLAGS=
+CFLAGS=@CFLAGS@ -DDEBUG
+LDFLAGS=@LDFLAGS@
 .c.o:
 	$(CC) -c $(CFLAGS) -I. -I$(srcdir) -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd -DMACHINE_H=\"$(MY_TARGET).h\" $(TCFLAGS) $(HCFLAGS) $<
 
@@ -101,7 +102,7 @@
 	   || $(INSTALL_PROGRAM) gprof $(tooldir)/bin/gprof; 
 
 
-gprof:	$(OBJS) $(LIBS)
+gprof:	$(OBJS) $(LIBS_DEP)
 	$(CC) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
 
 mostlyclean:
diff -urPX exclude binutils-950901-orig/gprof/cg_print.c binutils-950901/gprof/cg_print.c
--- binutils-950901-orig/gprof/cg_print.c	Tue Mar 14 03:57:43 1995
+++ binutils-950901/gprof/cg_print.c	Sun Aug 20 11:05:42 1995
@@ -82,7 +82,9 @@
   char buf[BUFSIZ];
 
   sprintf (buf, "[%d]", cyc->cg.index);
-  printf ("%-6.6s %5.1f %7.2f %11.2f %7d", buf,
+  printf (bsd_style_output
+	  ? "%-6.6s %5.1f %7.2f %11.2f %7d"
+	  : "%-6.6s %5.1f %7.2f %7.2f %7d", buf,
 	  100 * (cyc->cg.prop.self + cyc->cg.prop.child) / print_time,
 	  cyc->cg.prop.self / hz, cyc->cg.prop.child / hz, cyc->ncalls);
   if (cyc->cg.self_calls != 0)
@@ -93,7 +95,7 @@
     {
       printf (" %7.7s", "");
     }
-  printf (" <cycle %d as a whole>\t[%d]\n", cyc->cg.cyc.num, cyc->cg.index);
+  printf (" <cycle %d as a whole> [%d]\n", cyc->cg.cyc.num, cyc->cg.index);
 }
 
 
@@ -170,7 +172,9 @@
   sort_members (cyc);
   for (member = cyc->cg.cyc.next; member; member = member->cg.cyc.next)
     {
-      printf ("%6.6s %5.5s %7.2f %11.2f %7d",
+      printf (bsd_style_output
+	      ? "%6.6s %5.5s %7.2f %11.2f %7d"
+	      : "%6.6s %5.5s %7.2f %7.2f %7d",
 	      "", "", member->cg.prop.self / hz, member->cg.prop.child / hz,
 	      member->ncalls);
       if (member->cg.self_calls != 0)
@@ -627,9 +631,22 @@
 	    }
 	  else
 	    {
-	      printf ("%6.6s ", buf);
-	      sprintf (buf, "<cycle %d>", sym->cg.cyc.num);
-	      printf ("%-19.19s", buf);
+	      if (bsd_style_output)
+		{
+		  printf ("%6.6s ", buf);
+		  sprintf (buf, "<cycle %d>", sym->cg.cyc.num);
+		  printf ("%-19.19s", buf);
+		}
+	      else
+		{
+		  col += strlen (buf);
+		  for (; col < starting_col + 5; ++col)
+		    putchar (' ');
+		  printf (" %s ", buf);
+		  sprintf (buf, "<cycle %d>", sym->cg.cyc.num);
+		  printf ("%s", buf);
+		  col += strlen (buf);
+		}
 	    }
 	  starting_col += column_width;
 	}
diff -urPX exclude binutils-950901-orig/include/libiberty.h binutils-950901/include/libiberty.h
--- binutils-950901-orig/include/libiberty.h	Wed Aug 23 17:37:05 1995
+++ binutils-950901/include/libiberty.h	Wed Aug 23 18:38:44 1995
@@ -90,8 +90,7 @@
 #ifndef __GNUC__
 extern void xexit PARAMS ((int status));
 #else
-typedef void libiberty_voidfn PARAMS ((int status));
-__volatile__ libiberty_voidfn xexit;
+void xexit PARAMS ((int status)) __attribute__ ((__noreturn__));
 #endif
 
 /* Set the program name used by xmalloc.  */
diff -urPX exclude binutils-950901-orig/ld/Makefile.in binutils-950901/ld/Makefile.in
--- binutils-950901-orig/ld/Makefile.in	Sat Aug 19 01:14:14 1995
+++ binutils-950901/ld/Makefile.in	Sat Aug 19 01:31:19 1995
@@ -51,9 +51,9 @@
 
 INSTALL = `cd $(srcdir); pwd`/../install.sh -c
 INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
-INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
+INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 -m 644
 
 AR = ar
 AR_FLAGS = qv
@@ -68,7 +68,7 @@
 
 # Seach path to override the default search path for -lfoo libraries.
 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
-# (The default is usually /lib:usr/lib:/usr/local/lib, unless building
+# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
 # a cross-linker, in which case the default is empty.  See genscripts.sh.)
 # Otherwise, they are replaced with the ones given in LIB_PATH,
 # which may have the form: LIB_PATH=/lib:/usr/local/lib
@@ -190,7 +190,8 @@
 	$(CC) -c $(ALL_CFLAGS) $<
 
 # for self hosting
-BFDLIB = ../bfd/libbfd.a
+BFDLIB = -L../bfd -lbfd
+BFDLIB_DEP = ../bfd/libbfd.a
 LIBIBERTY = ../libiberty/libiberty.a
 
 
@@ -442,6 +443,9 @@
 em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} m68kaout
+em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
+  $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} m68klinux
 ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386linux
@@ -492,7 +496,7 @@
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} z8002
 
-$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
+$(LD_PROG): $(OFILES) $(BFDLIB_DEP) $(LIBIBERTY)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
 
 # The generated emulation files mostly have the same dependencies.
diff -urPX exclude binutils-950901-orig/ld/config/m68k-laout.mt binutils-950901/ld/config/m68k-laout.mt
--- binutils-950901-orig/ld/config/m68k-laout.mt	Thu Jan  1 01:00:00 1970
+++ binutils-950901/ld/config/m68k-laout.mt	Wed May 10 22:29:21 1995
@@ -0,0 +1,2 @@
+EMUL=m68klinux
+EMUL_EXTRA1=elf_m68k
diff -urPX exclude binutils-950901-orig/ld/config/m68k-linux.mt binutils-950901/ld/config/m68k-linux.mt
--- binutils-950901-orig/ld/config/m68k-linux.mt	Thu Jan  1 01:00:00 1970
+++ binutils-950901/ld/config/m68k-linux.mt	Sun Jun 11 21:45:47 1995
@@ -0,0 +1,2 @@
+EMUL=m68kelf
+EMUL_EXTRA1=m68klinux
diff -urPX exclude binutils-950901-orig/ld/configure.in binutils-950901/ld/configure.in
--- binutils-950901-orig/ld/configure.in	Wed Aug  2 21:06:32 1995
+++ binutils-950901/ld/configure.in	Wed Aug  2 21:44:36 1995
@@ -104,6 +104,8 @@
   m68*-*-coff)		ld_target=m68k-coff ;;
   m68*-*-elf)		ld_target=m68k-elf ;;
   m68*-*-hpux*)		ld_target=hp300hpux ;;
+  m68*-*-linuxaout*)	ld_target=m68k-laout ;;
+  m68*-*-linux*)	ld_target=m68k-linux ;;
   m68*-*-lynxos*)	ld_target=m68k-lynx ;;
   m68*-*-netbsd*)	ld_target=m68k-nbsd ;;
   m68*-*-*)
diff -urPX exclude binutils-950901-orig/ld/emulparams/m68klinux.sh binutils-950901/ld/emulparams/m68klinux.sh
--- binutils-950901-orig/ld/emulparams/m68klinux.sh	Thu Jan  1 01:00:00 1970
+++ binutils-950901/ld/emulparams/m68klinux.sh	Tue Oct 18 19:47:36 1994
@@ -0,0 +1,7 @@
+SCRIPT_NAME=aout
+OUTPUT_FORMAT="a.out-m68k-linux"
+PAGE_SIZE=0x1000
+TEXT_START_ADDR=0x1020
+NONPAGED_TEXT_START_ADDR=0
+ARCH=m68k
+TEMPLATE_NAME=linux
diff -urPX exclude binutils-950901-orig/ld/emultempl/elf32.em binutils-950901/ld/emultempl/elf32.em
--- binutils-950901-orig/ld/emultempl/elf32.em	Thu Jul 20 19:09:17 1995
+++ binutils-950901/ld/emultempl/elf32.em	Thu Jul 20 20:48:25 1995
@@ -43,6 +43,12 @@
 #include "ldlang.h"
 #include "ldgram.h"
 
+/* FIXME: On some hosts we will need to include a different file.
+   This is correct for ELF/SVR4, which is the only place this file will
+   typically be compiled.  However, if somebody configures the linker
+   for all targets, they will run into trouble here.  */
+#include <dirent.h>
+
 static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
 static boolean gld${EMULATION_NAME}_open_dynamic_archive
   PARAMS ((const char *, search_dirs_type *, lang_input_statement_type *));
@@ -61,6 +67,8 @@
 static void gld${EMULATION_NAME}_place_section
   PARAMS ((lang_statement_union_type *));
 static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static boolean gld${EMULATION_NAME}_find_so
+  PARAMS ((lang_input_statement_type *entry, search_dirs_type *search));
 
 static void
 gld${EMULATION_NAME}_before_parse()
@@ -69,6 +77,106 @@
   config.dynamic_link = ${DYNAMIC_LINK-true};
 }
 
+/* figure out which library is greater */
+static int
+libcmp (p1, p2)
+     char *p1, *p2;
+{
+  while (*p1)
+    {
+      if (isdigit (*p1) && isdigit (*p2))
+	{
+	  /* must compare this numerically */
+	  int v1, v2;
+	  v1 = strtoul (p1, &p1, 10);
+	  v2 = strtoul (p2, &p2, 10);
+	  if (v1 != v2)
+	    return v1 - v2;
+	}
+      else if (*p1 != *p2)
+	return *p1 - *p2;
+      else
+	p1++, p2++;
+    }
+
+  return *p1 - *p2;
+}
+
+/* Search for and open the .so file specified by ENTRY until
+   a match .so or .a file is found. H.J. */
+static boolean
+gld${EMULATION_NAME}_find_so (entry, search)
+     lang_input_statement_type *entry;
+     search_dirs_type *search;
+{
+  char *filename;
+  unsigned int len;
+  char *found;
+  DIR *dir;
+  struct dirent *ent;
+
+  found = NULL;
+  filename = (char *) entry->filename;
+  len = strlen (filename);
+  /* We try this directory. */
+  dir = opendir (search->name);
+  if (dir == NULL)
+    return false;
+
+  while ((ent = readdir (dir)) != NULL)
+    {
+      /* We are looking for libxxxx.*. */
+      if (ent->d_name [len + 3] != '.'
+	  || strncmp (ent->d_name, "lib", 3) != 0
+	  || strncmp (ent->d_name + 3, filename, len) != 0
+	  || strncmp (ent->d_name + 3 + len, ".so", 3) != 0)
+	continue;
+
+      /* We've found a lib*.so.x.x.x file. We compare it with the
+	 one we have found if there is one. */
+      if (found == NULL)
+	{
+	  found = (char *) xmalloc (strlen (ent->d_name) + 1);
+	  strcpy (found, ent->d_name);
+	}
+      else
+	{
+	  if (libcmp (&ent->d_name [len + 6], &found [len + 6]) > 0)
+	    {
+	      free (found);
+	      found = (char *) xmalloc (strlen (ent->d_name) + 1);
+	      strcpy (found, ent->d_name);
+	    }
+	}
+    }
+
+  closedir (dir);
+
+  if (found == NULL)
+    {
+      /* We did not find a matching .so file.  */
+      return false;
+    }
+
+  filename = (char *) xmalloc (strlen (search->name)
+			       + strlen (found) + 2);
+  sprintf (filename, "%s/%s", search->name, found);
+
+  free (found);
+
+  /* Give it a try */
+  if (ldfile_try_open_bfd (filename, entry)) 
+    {
+      entry->filename = filename;
+      return true;
+    }
+  else
+    {
+      free (filename);
+      return false;
+    }
+}
+
 /* Try to open a dynamic archive.  This is where we know that ELF
    dynamic libraries have an extension of .so.  */
 
@@ -78,29 +186,16 @@
      search_dirs_type *search;
      lang_input_statement_type *entry;
 {
-  const char *filename;
   char *string;
 
   if (! entry->is_archive)
     return false;
 
-  filename = entry->filename;
-
-  string = (char *) xmalloc (strlen (search->name)
-			     + strlen (filename)
-			     + strlen (arch)
-			     + sizeof "/lib.so");
-
-  sprintf (string, "%s/lib%s%s.so", search->name, filename, arch);
-
-  if (! ldfile_try_open_bfd (string, entry))
+  if (! gld${EMULATION_NAME}_find_so (entry, search))
     {
-      free (string);
       return false;
     }
 
-  entry->filename = string;
-
   /* We have found a dynamic object to include in the link.  The ELF
      backend linker will create a DT_NEEDED entry in the .dynamic
      section naming this file.  If this file includes a DT_SONAME
@@ -118,12 +213,18 @@
       && (entry->the_bfd->flags & DYNAMIC) != 0)
     {
       char *needed_name;
+      const char *filename;
 
       ASSERT (entry->is_archive && entry->search_dirs_flag);
-      needed_name = (char *) xmalloc (strlen (filename)
-				      + strlen (arch)
-				      + sizeof "lib.so");
-      sprintf (needed_name, "lib%s%s.so", filename, arch);
+
+      /* Strip directory part.  */
+      filename = strrchr (entry->filename, '/');
+      if (filename == NULL)
+	filename = entry->filename;
+      else
+	filename++;
+      needed_name = xmalloc (strlen (filename) + 1);
+      strcpy (needed_name, filename);
       bfd_elf_set_dt_needed_name (entry->the_bfd, needed_name);
     }
 
diff -urPX exclude binutils-950901-orig/ld/emultempl/linux.em binutils-950901/ld/emultempl/linux.em
--- binutils-950901-orig/ld/emultempl/linux.em	Thu Jul 20 19:09:17 1995
+++ binutils-950901/ld/emultempl/linux.em	Thu Jul 20 20:35:29 1995
@@ -126,7 +126,7 @@
 
   /* Let the backend work out the sizes of any sections required by
      dynamic linking.  */
-  if (! bfd_linux_size_dynamic_sections (output_bfd, &link_info))
+  if (! bfd_${EMULATION_NAME}_size_dynamic_sections (output_bfd, &link_info))
     einfo ("%P%F: failed to set dynamic section sizes: %E\n");
 }
 
diff -urPX exclude binutils-950901-orig/ld/ld.1 binutils-950901/ld/ld.1
--- binutils-950901-orig/ld/ld.1	Tue Jul 11 00:16:12 1995
+++ binutils-950901/ld/ld.1	Thu Aug 31 23:55:16 1995
@@ -53,7 +53,7 @@
 .I input-format\c
 \&\|] 
 .RB "[\|" \-g "\|]" 
-.RB "[\|" \-G\c
+.RB "[\|" \-G
 .I size\c
 \&\|]
 .RB "[\|" \-\-help "\|]"
@@ -65,10 +65,10 @@
 .I searchdir\c
 \&\|] 
 .RB "[\|" \-M "\|]" 
-.RB "[\|" \-Map\c
+.RB "[\|" \-Map
 .I mapfile\c
 \&\|] 
-.RB "[\|" \-m\c
+.RB "[\|" \-m
 .I emulation\c
 \&\|] 
 .RB "[\|" \-n | \-N "\|]" 
@@ -86,7 +86,7 @@
 .RB "[\|" \-s "\|]" 
 .RB "[\|" \-shared "\|]" 
 .RB "[\|" \-sort\-common "\|]" 
-.RB "[\|" \-split\-by\-reloc\ "\c
+.RB "[\|" "\-split\-by\-reloc\ "\c
 .I count\c
 \&\|]
 .RB "[\|" \-split\-by\-file "\|]" 
@@ -257,8 +257,7 @@
 option that requires them.
 
 .TP
-.BI "-A" "architecture"\c
-\&
+.BI "-A" "architecture"
 In the current release of \c
 .B ld\c
 \&, this option is useful only for the
@@ -314,13 +313,11 @@
 \& more than once on a command line, if
 an architecture family allows combination of target architectures; each
 use will add another pair of name variants to search for when \c
-.B \-l\c
-\&
+.B \-l
 specifies a library.
 
 .TP
-.BI "\-b " "input-format"\c
-\&
+.BI "\-b " "input-format"
 Specify the binary format for input object files that follow this option
 on the command line.  You don't usually need to specify this, as
 \c
@@ -376,8 +373,7 @@
 on ELF platforms which support shared libraries.
 
 .TP
-.BI "\-c " "commandfile"\c
-\&
+.BI "\-c " "commandfile"
 Directs \c
 .B ld\c
 \& to read link commands from the file
@@ -407,8 +403,7 @@
 .B \-dp
 These three options are equivalent; multiple forms are supported for
 compatibility with other linkers.  Use any of them to make \c
-.B ld\c
-\&
+.B ld
 assign space to common symbols even if a relocatable output file is
 specified (\c
 .B \-r\c
@@ -418,10 +413,7 @@
 \& has the same effect.
 
 .TP
-.BI "-defsym " "symbol"\c
-\& = \c
-.I expression\c
-\&
+.BI "-defsym " "symbol" "\fR = \fP" expression
 Create a global symbol in the output file, containing the absolute
 address given by \c
 .I expression\c
@@ -462,8 +454,7 @@
 .TP
 .B \-F
 .TP
-.BI "-F" "format"\c
-\&
+.BI "-F" "format"
 Some older linkers used this option throughout a compilation toolchain
 for specifying object-file format for both input and output object
 files.  \c
@@ -485,8 +476,7 @@
 with scripts written to call the old linker.
 
 .TP
-.BI "\-format " "input\-format"\c
-\&
+.BI "\-format " "input\-format"
 Synonym for \c
 .B \-b\c
 \& \c
@@ -533,13 +523,11 @@
 .I ar\c
 \&.a\c
 \& for every \c
-.I ar\c
-\&
+.I ar
 specified.
 
 .TP
-.BI "\-L" "searchdir"\c
-\& 
+.BI "\-L" "searchdir"
 This command adds path \c
 .I searchdir\c
 \& to the list of paths that
@@ -556,8 +544,7 @@
 \& is using, and in
 some cases also on how it was configured.    The
 paths can also be specified in a link script with the \c
-.B SEARCH_DIR\c
-\&
+.B SEARCH_DIR
 command.
 
 .TP
@@ -629,11 +616,7 @@
 memory space while linking a large executable.
 
 .TP
-.BI "\-o " "output"\c
-\&
-.I output\c
-\&
-\c
+.BI "\-o " "output"
 .I output\c
 \& is a name for the program produced by \c
 .B ld\c
@@ -646,8 +629,7 @@
 \& can also specify the output file name.
 
 .TP
-.BI "\-oformat " "output\-format"\c
-\&
+.BI "\-oformat " "output\-format"
 Specify the binary format for the output object file.
 You don't usually need to specify this, as
 \c
@@ -662,10 +644,7 @@
 can also specify the output format, but this option overrides it.
 
 .TP
-.BI "\-R " "filename"\c
-\&
-.I file\c
-\&
+.BI "\-R " "filename"
 Read symbol names and their addresses from \c
 .I filename\c
 \&, but do not
@@ -778,10 +757,7 @@
 \& must be a hexadecimal integer.
 
 .TP
-.BI "\-T " "commandfile"\c
-\&
-.TP
-.BI "\-T" "commandfile"\c
+.BI "\-T " "commandfile"
 Equivalent to \c
 .B \-c \c
 .I commandfile\c
@@ -815,9 +791,7 @@
 turn serve as input to \c
 .B ld\c
 \&.  When linking C++ programs, \c
-.B \-Ur\c
-\&
-\c
+.B \-Ur
 .I will\c
 \& resolve references to constructors, unlike \c
 .B \-r\c
diff -urPX exclude binutils-950901-orig/ld/ld.texinfo binutils-950901/ld/ld.texinfo
--- binutils-950901-orig/ld/ld.texinfo	Tue Jul 11 00:16:17 1995
+++ binutils-950901/ld/ld.texinfo	Wed Jul 12 21:48:06 1995
@@ -215,7 +215,7 @@
 The exceptions---which may meaningfully be used more than once---are
 @samp{-A}, @samp{-b} (or its synonym @samp{-format}), @samp{-defsym},
 @samp{-L}, @samp{-l}, @samp{-R}, @samp{-u}, and @samp{-(} (or its
-synonym @samp{--start-group})..
+synonym @samp{--start-group}).
 @end ifclear
 @ifset SingleFormat
 The exceptions---which may meaningfully be used more than once---are
@@ -1047,7 +1047,7 @@
 
 @cindex negative integers
 To write a negative integer, use
-the prefix operator @samp{-}; @pxref{Operators}.
+the prefix operator @samp{-} (@pxref{Operators}).
 @example
 _as_neg = -57005;
 @end example
@@ -1166,7 +1166,7 @@
 @end example
 Notes:
 (1) Prefix operators 
-(2) @xref{Assignment}
+(2) @xref{Assignment}.
 @c TEXI2ROFF-KILL
 @end ifinfo
 @tex
@@ -1555,7 +1555,7 @@
 
 You can also use the first two operations---defining the entry point and
 defining symbols---outside the @code{SECTIONS} command: @pxref{Entry
-Point}, and @pxref{Assignment}.  They are permitted here as well for
+Point}, and @ref{Assignment}.  They are permitted here as well for
 your convenience in reading the script, so that symbols and the entry
 point can be defined at meaningful points in your output-file layout.
 
@@ -1611,7 +1611,7 @@
 contents.  This is for convenience when referring to input sections that
 may or may not exist.  For example,
 @example
-.foo @{ *(.foo @}
+.foo @{ *(.foo) @}
 @end example
 will only create a @samp{.foo} section in the output file if there is a
 @samp{.foo} section in at least one input file.
@@ -1761,7 +1761,7 @@
 The foregoing statements arrange, in your output file, data originating
 from your input files.  You can also place data directly in an output
 section from the link command script.  Most of these additional
-statements involve expressions; @pxref{Expressions}.  Although these
+statements involve expressions (@pxref{Expressions}).  Although these
 statements are shown separately here for ease of presentation, no such
 segregation is needed within a section definition in the @code{SECTIONS}
 command; you can intermix them freely with any of the statements we've
@@ -1903,7 +1903,7 @@
 @end smallexample
 
 @var{secname} and @var{contents} are required.  @xref{Section
-Definition}, and @pxref{Section Placement} for details on
+Definition}, and @ref{Section Placement}, for details on
 @var{contents}.  The remaining elements---@var{start},
 @code{BLOCK(@var{align)}}, @code{(NOLOAD)}, @code{AT ( @var{ldadr} )},
 @code{>@var{region}}, and @code{=@var{fill}}---are all optional.
diff -urPX exclude binutils-950901-orig/ld/ldgram.y binutils-950901/ld/ldgram.y
--- binutils-950901-orig/ld/ldgram.y	Sat Aug 19 01:01:12 1995
+++ binutils-950901/ld/ldgram.y	Sat Aug 19 01:32:04 1995
@@ -39,10 +39,6 @@
 #include "mri.h"
 #include "ldlex.h"
 
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
 static int typebits;
 
 lang_memory_region_type *region;
diff -urPX exclude binutils-950901-orig/libiberty/Makefile.in binutils-950901/libiberty/Makefile.in
--- binutils-950901-orig/libiberty/Makefile.in	Wed Aug 23 17:37:14 1995
+++ binutils-950901/libiberty/Makefile.in	Wed Aug 23 18:39:34 1995
@@ -154,10 +154,10 @@
 	 vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c \
 	 xatexit.c xexit.c xmalloc.c xstrerror.c
 # These are always included in the library.
-REQUIRED_OFILES = argv.o basename.o concat.o cplus-dem.o fdmatch.o \
+REQUIRED_OFILES = argv.o concat.o cplus-dem.o fdmatch.o \
   getopt.o getopt1.o getruntime.o hex.o \
   floatformat.o obstack.o spaces.o strerror.o strsignal.o \
-  vasprintf.o xatexit.o xexit.o xmalloc.o xstrerror.o
+  xatexit.o xexit.o xmalloc.o xstrerror.o
 
 # Do we want/need any config overrides?
 #	 
diff -urPX exclude binutils-950901-orig/libiberty/functions.def binutils-950901/libiberty/functions.def
--- binutils-950901-orig/libiberty/functions.def	Fri Mar 24 04:11:35 1995
+++ binutils-950901/libiberty/functions.def	Wed Jul 12 21:50:20 1995
@@ -62,4 +62,6 @@
 
 DEFFUNC(strerror, char*, (), NOTHING)
 DEFFUNC(psignal, void, (signo, message), unsigned signo AND char *message)
-DEFFUNC(basename, char *, (name), CONST char *name)
+DEFFUNC(basename, char*, (name), char *name)
+DEFFUNC(strsignal, char*, (), NOTHING)
+DEFFUNC(vasprintf, int, (), NOTHING)
diff -urPX exclude binutils-950901-orig/libiberty/getopt.c binutils-950901/libiberty/getopt.c
--- binutils-950901-orig/libiberty/getopt.c	Sat Jul  8 00:48:36 1995
+++ binutils-950901/libiberty/getopt.c	Wed Jul 12 22:23:37 1995
@@ -61,11 +61,8 @@
    (especially if it is a shared library).  Rather than having every GNU
    program understand `configure --with-gnu-libc' and omit the object files,
    it is simpler to just do this in the source for each such file.  */
-/* Many versions of the Linux C library include older, broken versions
-   of these routines, which will break the linker's command-line
-   parsing.  */
 
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__)
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
 
 
 /* This needs to come after some library #include
diff -urPX exclude binutils-950901-orig/libiberty/getopt1.c binutils-950901/libiberty/getopt1.c
--- binutils-950901-orig/libiberty/getopt1.c	Sat Jul  8 00:48:37 1995
+++ binutils-950901/libiberty/getopt1.c	Wed Jul 12 22:23:33 1995
@@ -46,11 +46,8 @@
    (especially if it is a shared library).  Rather than having every GNU
    program understand `configure --with-gnu-libc' and omit the object files,
    it is simpler to just do this in the source for each such file.  */
-/* Many versions of the Linux C library include older, broken versions
-   of these routines, which will break the linker's command-line
-   parsing.  */
 
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__)
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
 
 
 /* This needs to come after some library #include
diff -urPX exclude binutils-950901-orig/libiberty/getruntime.c binutils-950901/libiberty/getruntime.c
--- binutils-950901-orig/libiberty/getruntime.c	Sat Jul  8 00:48:39 1995
+++ binutils-950901/libiberty/getruntime.c	Wed Jul 12 21:51:57 1995
@@ -32,6 +32,10 @@
 #define HAVE_GETRUSAGE
 #endif
 
+#if defined (__linux__)
+#define HAVE_TIMES
+#endif
+
 #ifdef HAVE_SYSCONF
 #define HAVE_TIMES
 #endif
diff -urPX exclude binutils-950901-orig/libiberty/obstack.c binutils-950901/libiberty/obstack.c
--- binutils-950901-orig/libiberty/obstack.c	Sat Jul  8 00:48:45 1995
+++ binutils-950901/libiberty/obstack.c	Wed Jul 12 21:52:22 1995
@@ -34,9 +34,8 @@
    nobody is using the old obstack.c code, force the use of this code.
    This issue will arise anytime a change is made which is not binary
    compatible.
-#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
 */
-#if 1
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
 
 
 #ifdef __STDC__
@@ -62,11 +61,6 @@
 #ifndef COPYING_UNIT
 #define COPYING_UNIT int
 #endif
-
-/* The non-GNU-C macros copy the obstack into this global variable
-   to avoid multiple evaluation.  */
-
-struct obstack *_obstack;
 
 /* Define a macro that either calls functions with the traditional malloc/free
    calling interface, or calls functions with the mmalloc/mfree interface
diff -urPX exclude binutils-950901-orig/libiberty/strsignal.c binutils-950901/libiberty/strsignal.c
--- binutils-950901-orig/libiberty/strsignal.c	Tue May 16 22:33:11 1995
+++ binutils-950901/libiberty/strsignal.c	Wed Jul 12 21:52:53 1995
@@ -400,6 +400,8 @@
 
 */
 
+#ifdef NEED_strsignal
+
 const char *
 strsignal (signo)
   int signo;
@@ -435,6 +437,8 @@
   
   return (msg);
 }
+
+#endif /* NEED_strsignal */
 
 
 /*
diff -urPX exclude binutils-950901-orig/opcodes/Makefile.in binutils-950901/opcodes/Makefile.in
--- binutils-950901-orig/opcodes/Makefile.in	Tue Aug  8 17:24:43 1995
+++ binutils-950901/opcodes/Makefile.in	Wed Aug  9 22:54:06 1995
@@ -43,13 +43,14 @@
 
 SHELL = /bin/sh
 
-INSTALL = `cd $(srcdir)/..; pwd`/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
 
 AR = ar
 AR_FLAGS = qc
-CFLAGS = -g
+CFLAGS = @CFLAGS@
+PICFLAG =
 BISON = bison
 MAKEINFO = makeinfo
 RANLIB = @RANLIB@
@@ -61,6 +62,11 @@
 
 
 TARGETLIB = libopcodes.a
+SHLIB = libopcodes.so
+SHFLAGS =
+SHDEPS =
+
+BUILD_LIBS = $(TARGETLIB)
 
 # To circumvent a Sun make VPATH bug, each file listed here
 # should also have a foo.o: foo.c line further along in this file.
@@ -75,6 +81,7 @@
 
 #### host dependent Makefile fragments come in here.
 # @host_makefile_frag@
+# @host_extra_frag@
 ###
 
 FLAGS_TO_PASS = \
@@ -91,15 +98,15 @@
 	"BISON=$(BISON)"
 
 .c.o:
-	$(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
+	$(CC) -c $(CFLAGS) $(PICFLAG) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
 
 
 # C source files that correspond to .o's.
 CFILES = i386-dis.c z8k-dis.c m68k-dis.c mips-dis.c ns32k-dis.c ppc-dis.c
 
-STAGESTUFF = $(TARGETLIB) $(OFILES)
+STAGESTUFF = $(BUILD_LIBS) $(OFILES)
 
-all: $(TARGETLIB) 
+all: $(BUILD_LIBS) 
 
 
 .NOEXPORT:
@@ -119,8 +126,11 @@
 	 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES)
 	 $(RANLIB) $(TARGETLIB)
 
+$(SHLIB): $(OFILES)
+	$(CC) $(SHFLAGS) -shared -o $(SHLIB) $(OFILES) $(SHDEPS)
+
 disassemble.o: disassemble.c $(INCDIR)/dis-asm.h
-	$(CC) -c $(CFLAGS) @archdefs@ $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
+	$(CC) -c $(CFLAGS) $(PICFLAG) @archdefs@ $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
 
 a29k-dis.o: a29k-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/a29k.h
 dis-buf.o: dis-buf.c $(INCDIR)/dis-asm.h
@@ -187,10 +197,10 @@
 	$(INSTALL_DATA) $(TARGETLIB) $(libdir)/libopcodes.a
 	$(RANLIB) $(libdir)/libopcodes.a
 
-Makefile: $(srcdir)/Makefile.in config.status
+Makefile: $(srcdir)/Makefile.in config.status @frags@
 	$(SHELL) config.status
 
-config.status : configure @frags@ \
+config.status : configure \
 	$(srcdir)/../bfd/configure.host $(srcdir)/../bfd/config.bfd
 	$(SHELL) config.status --recheck
 
diff -urPX exclude binutils-950901-orig/opcodes/config/linux.ml binutils-950901/opcodes/config/linux.ml
--- binutils-950901-orig/opcodes/config/linux.ml	Thu Jan  1 01:00:00 1970
+++ binutils-950901/opcodes/config/linux.ml	Tue Aug 29 19:05:44 1995
@@ -0,0 +1,3 @@
+BUILD_LIBS = $(TARGETLIB) $(SHLIB)
+SHLIB = libopcodes.so.2.5.2.7
+SHFLAGS = -Wl,-soname,$(SHLIB)
diff -urPX exclude binutils-950901-orig/opcodes/configure.in binutils-950901/opcodes/configure.in
--- binutils-950901-orig/opcodes/configure.in	Fri Aug  4 19:45:44 1995
+++ binutils-950901/opcodes/configure.in	Wed Aug  9 22:52:58 1995
@@ -26,11 +26,14 @@
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac])dnl
+AC_ARG_ENABLE(shared,
+[  --enable-shared         enable shared libraries])dnl
 
 # host-specific stuff:
 
 AC_PROG_CC
 AC_PROG_RANLIB
+AC_PROG_INSTALL
 AC_CHECK_HEADERS(string.h strings.h)
 
 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
@@ -53,6 +56,16 @@
 	frags=
 fi
 AC_SUBST_FILE(host_makefile_frag)
+host_extra_frag=/dev/null
+if test "${enable_shared}" = yes; then
+    case "${host}" in
+    *-*-linux*)		host_extra_frag=${srcdir}/config/linux.ml ;;
+    esac
+fi
+if test $host_extra_frag != /dev/null; then
+    frags="$frags $host_extra_frag"
+fi
+AC_SUBST_FILE(host_extra_frag)
 
 # target-specific stuff:
 
diff -urPX exclude binutils-950901-orig/opcodes/m68k-dis.c binutils-950901/opcodes/m68k-dis.c
--- binutils-950901-orig/opcodes/m68k-dis.c	Wed Aug  9 17:33:30 1995
+++ binutils-950901/opcodes/m68k-dis.c	Sat Aug 19 20:15:52 1995
@@ -273,9 +273,10 @@
 	  break;
 	}
     }
-  /* pflusha is an exception; it takes no arguments but is two words long.  */
-  if (buffer[0] == 0xf0 && buffer[1] == 0 && buffer[2] == 0x24 &&
-      buffer[3] == 0)
+  /* Some opcodes like pflusha and lpstop are exceptions; they take no
+     arguments but are two words long.  Recognize them by looking at
+     the lower 16 bits of the mask.  */
+  if (p - buffer < 4 && best->match & 0xFFFF)
     p = buffer + 4;
   
   FETCH_DATA (info, p);
@@ -359,7 +360,7 @@
     {
     case 'c':		/* cache identifier */
       {
-        static char *const cacheFieldName[] = { "NOP", "dc", "ic", "bc" };
+        static char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
         val = fetch_arg (buffer, place, 2, info);
         (*info->fprintf_func) (info->stream, cacheFieldName[val]);
         break;
@@ -377,21 +378,20 @@
     case '_':		/* 32-bit absolute address for move16. */
       {
         val = NEXTLONG (p);
-        (*info->fprintf_func) (info->stream, "@#");
 	(*info->print_address_func) (val, info);
         break;
       }
 
     case 'C':
-      (*info->fprintf_func) (info->stream, "ccr");
+      (*info->fprintf_func) (info->stream, "%%ccr");
       break;
 
     case 'S':
-      (*info->fprintf_func) (info->stream, "sr");
+      (*info->fprintf_func) (info->stream, "%%sr");
       break;
 
     case 'U':
-      (*info->fprintf_func) (info->stream, "usp");
+      (*info->fprintf_func) (info->stream, "%%usp");
       break;
 
     case 'J':
@@ -412,7 +412,7 @@
 	for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
 	  if (names[regno].value == val)
 	    {
-	      (*info->fprintf_func) (info->stream, names[regno].name);
+	      (*info->fprintf_func) (info->stream, "%s", names[regno].name);
 	      break;
 	    }
 	if (regno < 0)
@@ -536,7 +536,7 @@
 	val = COERCE_SIGNED_CHAR(buffer[1]);
       else if (place == 'w' || place == 'W')
 	val = NEXTWORD (p);
-      else if (place == 'l' || place == 'L')
+      else if (place == 'l' || place == 'L' || place == 'C')
 	val = NEXTLONG (p);
       else if (place == 'g')
 	{
@@ -777,12 +777,12 @@
 		  if (doneany)
 		    (*info->fprintf_func) (info->stream, "/");
 		  doneany = 1;
-		  (*info->fprintf_func) (info->stream, "fp%d", regno);
+		  (*info->fprintf_func) (info->stream, "%%fp%d", regno);
 		  first_regno = regno;
 		  while (val & (1 << (regno + 1)))
 		    ++regno;
 		  if (regno > first_regno)
-		    (*info->fprintf_func) (info->stream, "-fp%d", regno);
+		    (*info->fprintf_func) (info->stream, "-%%fp%d", regno);
 		}
 	  }
 	else
@@ -801,24 +801,24 @@
 	char *name = 0;
 	switch (val)
 	  {
-	  case 2: name = "tt0"; break;
-	  case 3: name = "tt1"; break;
-	  case 0x10: name = "tc"; break;
-	  case 0x11: name = "drp"; break;
-	  case 0x12: name = "srp"; break;
-	  case 0x13: name = "crp"; break;
-	  case 0x14: name = "cal"; break;
-	  case 0x15: name = "val"; break;
-	  case 0x16: name = "scc"; break;
-	  case 0x17: name = "ac"; break;
- 	  case 0x18: name = "psr"; break;
-	  case 0x19: name = "pcsr"; break;
+	  case 2: name = "%tt0"; break;
+	  case 3: name = "%tt1"; break;
+	  case 0x10: name = "%tc"; break;
+	  case 0x11: name = "%drp"; break;
+	  case 0x12: name = "%srp"; break;
+	  case 0x13: name = "%crp"; break;
+	  case 0x14: name = "%cal"; break;
+	  case 0x15: name = "%val"; break;
+	  case 0x16: name = "%scc"; break;
+	  case 0x17: name = "%ac"; break;
+ 	  case 0x18: name = "%psr"; break;
+	  case 0x19: name = "%pcsr"; break;
 	  case 0x1c:
 	  case 0x1d:
 	    {
 	      int break_reg = ((buffer[3] >> 2) & 7);
 	      (*info->fprintf_func)
-		(info->stream, val == 0x1c ? "bad%d" : "bac%d",
+		(info->stream, val == 0x1c ? "%%bad%d" : "%%bac%d",
 		 break_reg);
 	    }
 	    break;
@@ -826,7 +826,7 @@
 	    (*info->fprintf_func) (info->stream, "<mmu register %d>", val);
 	  }
 	if (name)
-	  (*info->fprintf_func) (info->stream, name);
+	  (*info->fprintf_func) (info->stream, "%s", name);
       }
       break;
 
@@ -834,16 +834,16 @@
       {
 	int fc = fetch_arg (buffer, place, 5, info);
 	if (fc == 1)
-	  (*info->fprintf_func) (info->stream, "dfc");
+	  (*info->fprintf_func) (info->stream, "%%dfc");
 	else if (fc == 0)
-	  (*info->fprintf_func) (info->stream, "sfc");
+	  (*info->fprintf_func) (info->stream, "%%sfc");
 	else
 	  (*info->fprintf_func) (info->stream, "<function code %d>", fc);
       }
       break;
 
     case 'V':
-      (*info->fprintf_func) (info->stream, "val");
+      (*info->fprintf_func) (info->stream, "%%val");
       break;
 
     case 't':
