--- binutils-2.9.1.orig/debian/changelog
+++ binutils-2.9.1/debian/changelog
@@ -0,0 +1,5 @@
+ppc-morphos-binutils (2.9.1-amixdev.1) stable; urgency=low
+
+  * First release with .deb support.
+
+ -- Staf Verhaegen <staf@stafverhaegen.be>  Wed, 24 Dec 2014 10:00:00 +0100
--- binutils-2.9.1.orig/debian/control
+++ binutils-2.9.1/debian/control
@@ -0,0 +1,24 @@
+Source: ppc-morphos-binutils
+Section: devel
+Priority: optional
+Maintainer: Staf Verhaegen <staf@stafverhaegen.be>
+Build-Depends: debhelper (>= 4.1.16), flex, bison, texinfo
+
+Package: ppc-morphos-binutils
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: A GNU collection of binary utilities for ppc-morphos
+ Binutils is a collection of binary utilities, including ar (for creating,
+ modifying and extracting from archives), nm (for listing symbols from
+ object files), objcopy (for copying and translating object files),
+ objdump (for displaying information from object files), ranlib (for
+ generating an index for the contents of an archive), size (for listing
+ the section sizes of an object or archive file), strings (for listing
+ printable strings from files), strip (for discarding symbols), c++filt
+ (a filter for demangling encoded C++ symbols), addr2line (for converting
+ addresses to file and line), and nlmconv (for converting object code into
+ an NLM). 
+ Install binutils if you need to perform any of these types of actions on
+ binary files.  Most programmers will want to install binutils.
+ This package is for PowerPC MorphOS development. It is based on the source
+ code released in sdk-source-20140413 tarball.
--- binutils-2.9.1.orig/debian/rules
+++ binutils-2.9.1/debian/rules
@@ -0,0 +1,97 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=4
+
+CFLAGS = -g
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+CFLAGS += -O0
+else
+CFLAGS += -O2
+endif
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+
+	# Add here commands to compile the package.
+	./configure --target=ppc-morphos --program-prefix=ppc-morphos- --prefix=/usr
+	make all
+	# --- end custom part for compiling
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	# Add here commands to clean up after the build process.
+	make clean || true
+	# --- end custom part for cleaning up
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package
+	# The DESTDIR Has To Be Exactly  /usr/src/packages/BUILD/debian/<nameOfPackage>
+	make prefix=/usr/src/packages/BUILD/debian/ppc-morphos-binutils/usr install
+	cd /usr/src/packages/BUILD/debian/ppc-morphos-binutils/usr/ppc-morphos/bin
+	rm -f ar; ln -s /usr/bin/ppc-morphos-ar ar
+	rm -f as; ln -s /usr/bin/ppc-morphos-as as
+	rm -f ld; ln -s /usr/bin/ppc-morphos-ld ld
+	rm -f nm; ln -s /usr/bin/ppc-morphos-nm nm
+	rm -f ranlib; ln -s /usr/bin/ppc-morphos-ranlib ranlib
+	rm -f strip; ln -s /usr/bin/ppc-morphos-strip strip
+
+	rm -fr /usr/src/packages/BUILD/debian/ppc-morphos-binutils/usr/lib \
+		/usr/src/packages/BUILD/debian/ppc-morphos-binutils/usr/include \
+		/usr/src/packages/BUILD/debian/ppc-morphos-binutils/usr/info
+	# --- end custom part for installing
+
+# Build architecture-independent files here.
+binary-indep: build install
+	# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+#	dh_installdebconf
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+	dh_installcron
+	dh_installman
+	dh_installinfo
+#	dh_undocumented
+	dh_installchangelogs
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..968228e
--- /dev/null
+++ binutils-2.9.1/ChangeLog
@@ -0,0 +1,34 @@
+Tue May 11 13:39:56 1999  Fred Fish  <fnf@ninemoons.com>
+
+	* ltconfig (finish_eval): Backslash quote some double quotes
+	so that the generated file has the right amount of quotation.
+
+Thu Apr 30 17:05:00 1998 Fred Fish  <fnf@ninemoons.com>
+
+	* ltconfig: Use ARFLAGS instead of hardwired "cru".
+
+Sat Nov 15 09:12:45 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (*-*-amigaos): Fixup formatting.
+	* configure (enable_gdbtk): Set to "no" for BeOS.
+
+Fri Sep 26 15:32:41 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* Makefile.in ($(DO_X)): Add missing \ in continuation line.
+	This bug is fixed in the next FSF release.	
+
+Mon Aug 25 16:32:00 1997  Steffen Opel  <opel@rumms.uni-mannheim.de>
+
+	* Makefile.in: Build, install and clean AmigaGuide documentation.
+
+Sat Dec 28 12:22:20 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* BeOS.diffs: Update file.
+
+Sun Dec 22 10:45:58 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* config.sub: Add support for BeOS target.
+
+Tue Jul 23 16:29:55 1996  Daniel Verite <daniel@brainstorm.eu.org>
+
+	* update from version 2.6 to version 2.7
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..613747e
--- /dev/null
+++ binutils-2.9.1/Makefile
@@ -0,0 +1,44 @@
+ROOTPATH 	= ../../../
+include $(ROOTPATH)SDK.global
+
+.PHONY: all make-stmp dist archive
+
+all: build make-stmp
+
+build:
+	./configall
+
+make-stmp: build
+	(cd build; make)
+	touch make-stmp
+
+dist-stmp: make-stmp
+	./mkdist
+	touch dist-stmp
+
+install-stmp: dist-stmp
+	(cd dist; ixrun Install)
+	touch install-stmp
+
+archive-stmp: dist-stmp
+	(cd dist; tar czf /ram/binutils-`date +"%Y%m%d"`.tgz *)
+	touch archive-stmp
+
+dist: dist-stmp
+
+install: install-stmp
+
+archive: archive-stmp
+
+sdk: dist
+	mkdir -p $(SDKPATH)$(SDKROOT)$(SDKGG)/bin
+	mkdir -p $(SDKPATH)$(SDKROOT)$(SDKGG)/ppc-morphos
+	(cd dist/bin && cp * $(SDKPATH)$(SDKROOT)$(SDKGG)/bin)
+	(cd dist/ppc-morphos && cp -a * $(SDKPATH)$(SDKROOT)$(SDKGG)/ppc-morphos)
+
+sdksource:
+	mkdir -p $(SRCPATH)/binutils
+	cp -a * $(SRCPATH)/binutils
+	-find $(SRCPATH)/binutils -iname CVS -exec rm -rf {} \;
+	-rm -rf $(SRCPATH)/binutils/build
+	-rm -rf $(SRCPATH)/binutils/dist
diff --git a/Makefile.in b/Makefile.in
index e0d5ba3..3e56ebf 100644
--- binutils-2.9.1.orig/Makefile.in
+++ binutils-2.9.1/Makefile.in
@@ -20,7 +20,7 @@
 
 srcdir = .
 
-prefix = /usr/local
+prefix = @prefix@
 exec_prefix = $(prefix)
 
 bindir=${exec_prefix}/bin
@@ -49,6 +49,9 @@ man6dir = $(mandir)/man6
 man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
+infodir = $(prefix)/info
+guidedir =$(prefix)/guide
+includedir = $(prefix)/include
 GDB_NLM_DEPS = 
 
 SHELL = /bin/sh
@@ -66,8 +69,8 @@ INSTALL_DOSREL = install-dosrel-fake
 
 AS = as
 AR = ar
-AR_FLAGS = rc
-CC = cc
+ARFLAGS = rc
+CC = @CC@
 
 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
 # here so that they can be overridden by Makefile fragments.
@@ -318,7 +321,7 @@ NM_FOR_TARGET = ` \
 # Flags to pass down to all sub-makes.
 # Please keep these in alphabetical order.
 BASE_FLAGS_TO_PASS = \
-	"AR_FLAGS=$(AR_FLAGS)" \
+	"ARFLAGS=$(ARFLAGS)" \
 	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
 	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
 	"BISON=$(BISON)" \
@@ -854,7 +857,9 @@ DO_X = \
 	do-distclean \
 	do-dvi \
 	do-info \
+	do-guide \
 	do-install-info \
+	do-install-guide \
 	do-installcheck \
 	do-mostlyclean \
 	do-maintainer-clean \
@@ -879,9 +884,9 @@ $(DO_X):
 	      done; \
 	      ;; \
 	    esac ; \
-	    export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
+	    export AR ARFLAGS AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
 	    if (cd ./$$i; \
-	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "ARFLAGS=$${ARFLAGS}" "AS=$${AS}" \
 			"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 			"RANLIB=$${RANLIB}" \
 			"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
@@ -898,9 +903,9 @@ $(DO_X):
 	    for flag in $(EXTRA_TARGET_FLAGS); do \
 		eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
 	    done; \
-	    export AR AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
+	    export AR ARFLAGS AS CC CXX LD NM RANLIB DLLTOOL WINDRES; \
 	    if (cd $(TARGET_SUBDIR)/$$i; \
-	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "ARFLAGS=$${ARFLAGS}" "AS=$${AS}" \
 			"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 			"RANLIB=$${RANLIB}" \
 			"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
@@ -911,10 +916,11 @@ $(DO_X):
 
 # Here are the targets which correspond to the do-X targets.
 
-.PHONY: info installcheck dvi install-info
+.PHONY: info guide installcheck dvi install-info install-guide
 .PHONY: clean distclean mostlyclean maintainer-clean realclean
 .PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
+guide: do-guide
 installcheck: do-installcheck
 dvi: do-dvi
 
@@ -927,6 +933,12 @@ install-info: do-install-info dir.info
 	  $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
 	else true ; fi
 
+install-guide: do-install-guide dir.guide
+	srcroot=`cd $(srcdir); pwd`; export srcroot; \
+	if [ -f dir.guide ] ; then \
+	  $(INSTALL_DATA) dir.guide $(guidedir)/dir.guide ; \
+	else true ; fi
+
 local-clean:
 	-rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
 
@@ -1350,7 +1362,7 @@ install-gcc:
 # This rule is used to install the modules which use FLAGS_TO_PASS.
 # To build a target install-X means to cd to X and make install.
 .PHONY: install-dosrel
-install-dosrel: installdirs info
+install-dosrel: installdirs info guide
 	@dir=`echo $@ | sed -e 's/install-//'`; \
 	if [ -f ./$${dir}/Makefile ] ; then \
 	  r=`pwd`; export r; \
@@ -1478,6 +1490,13 @@ dir.info: do-install-info
 	else true ; \
 	fi
 
+dir.guide: do-install-guide
+	if [ -f $(srcdir)/texinfo/gen-guide-dir ] ; then \
+	  $(srcdir)/texinfo/gen-guide-dir $(guidedir) $(srcdir)/texinfo/dir.guide-template > dir.guide.new ; \
+	  mv -f dir.guide.new dir.guide ; \
+	else true ; \
+	fi
+
 dist:
 	@echo "Building a full distribution of this tree isn't done"
 	@echo "via 'make dist'.  Check out the etc/ subdirectory" 
@@ -1513,7 +1532,7 @@ DEVO_SUPPORT= README Makefile.in configure configure.in \
 # ChangeLog omitted because it may refer to files which are not in this
 # distribution (perhaps it would be better to include it anyway).
 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
-	make-stds.texi standards.info*
+	make-stds.texi standards.info* standards.guide*
 
 # When you use `make setup-dirs' or `make taz' you should always redefine
 # this macro.
diff --git a/Product-Info b/Product-Info
new file mode 100644
index 0000000..3eb37f9
--- /dev/null
+++ binutils-2.9.1/Product-Info
@@ -0,0 +1,18 @@
+.name
+binutils
+.fullname
+GNU binutils
+.type
+Programmer Tools
+.short
+GNU binary utilities, Amiga source
+.description
+The GNU binary utilities.
+.version
+2.9.1
+.requirements
+Amiga binaries require the ixemul.library.
+.distribution
+GNU Public License
+.described-by
+Fred Fish (fnf@ninemoons.com)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 557679d..6b4185a 100644
--- binutils-2.9.1.orig/bfd/ChangeLog
+++ binutils-2.9.1/bfd/ChangeLog
@@ -1,3 +1,87 @@
+Thu Jun 18 09:50:39 1998  Mumit Khan  <khan@dhaka.xraylith.wisc.edu>
+
+	pei-i386 changes from Mikey <jeffdb@goodnet.com>.
+
+	* Makefile.in (coffgen.lo): Supply explicit build rule that
+	provides target macro.
+
+	* coffgen.c (ctype.h): Include.
+	(coff_renumber_symbsol): Sort symbols according to MS spec.
+
+	* bfd-in.h (pei_get_comdat_info): Declare.
+
+	* archures.c (pei_get_comdat_info): Provide stub for non pe-i386
+	targets. 
+
+	* section.c (struct comdat_info): New structure to hold associated
+	section/comdat symbol info for each SEC_LINK_ONCE section.
+	(struct sec): New member pe_comdat_info (struct comdat_info *).
+	(STD_SECTION): Initialize pe_comdat_info in SEC (struct sec).
+
+	* pei-i386.c (ctype.h): Include.
+	(pei_get_comdat_info): New function to get comdat symbol/associated 
+	section for each SEC_LINK_ONCE sec, and set asection->pe_comdat_info 
+	properly.
+
+	* peicode.h (coff_swap_sym_in): Rename incoming C_SECTION syms to
+	guarantee that these will be undefined/unique during later 
+	processing.
+	(pe_print_idata): Define IMPORTED_BY_ORDINAL instead of hard-coded
+	value.
+
+	* cofflink.c (coff_get_first_section_of_archive): New function
+	to find correct address/resolv relocs for each .lib file.
+	(_bfd_coff_generic_relocate_section): Resolve references to
+	undefined C_SECTION symbols.
+
+	* bfd-in2.h: Regenerate.
+
+Fri Jun  5 13:43:10 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* archive.c (do_slurp_coff_armap): Redo the hack so that it should
+	work no matter how large the archive is.
+
+Fri Jun  5 00:54:09 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* archive.c (do_slurp_coff_armap): Tweak hack that detects wrong
+	endian file offsets to allow up to ~16Mb archives before it always
+	triggers a reread in little endian order.
+
+Mon Jun  1 16:41:53 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* archive.c (do_slurp_coff_armap): Work around bug in Metrowerks
+	linkers that did not follow PE spec with regards to storing file
+	offset in big endian order.
+	* coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_LNK_COMDAT
+	flag in section flags for now.  This is a hack to work around
+	the Metrowerks linker hijacking this bit for it's own purposes.
+
+	Integrate PE changes from jeffdb@goodnet.com:
+	* section.c (_comdat_info): Add struct.  Holds associated
+ 	section/comdat symbol info for each SEC_LINK_ONCE section.
+	(pe_comdat_info): Add pointer to comdat info.
+	(bfd_map_over_sections): Call pei_get_comdat_info for sections that
+	have the SEC_LINK_ONCE flag set, to get associated section/comdat
+ 	info before returning asection info to user program.
+	* bfd-in2.h: Regenerated.
+	* cofflink.c (coff_get_first_section_of_archive): New function
+	and prototype.  Used to find the correct address/resolve the
+	relocs pointing to first .idata$4 and .idata$5 in the .idata$2
+	for each LIB file.
+	(_bfd_coff_generic_relocate_section): Add code to resolve references
+ 	to undefined C_SECTION symbols.
+	* pei-i386.c (ctype.h): Include.
+	(pei_get_comdat_info):  Find the associated section/comdat info for
+ 	each SEC_LINK_ONCE section found in the input, and set
+	asection->pe_comdat_info appropriately.  FIXME link.exe expects the
+ 	symbol table to be sorted in address ascending order, to use .o's with
+	sections marked SEC_LINK_ONCE with link.exe you must strip local symbols.
+	* peicode.h (coff_swap_sym_in): Rename incoming C_SECTION symbols to
+ 	guarantee they will be undefined/unique for later processing.
+	(pe_print_idata):  Add code to read/print .idata sections linked against
+ 	libraries produced with NONAME/import by ordinal functions, wsock32.lib
+ 	comctl32.lib and probably others.
+
 Mon Apr 27 11:49:55 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.in: Set version number to 2.9.1.
@@ -654,6 +738,11 @@ Mon Jan 19 12:49:52 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* cpu-sh.c (arch_info_struct): Correct next field of sh3e.
 
+Sun Jan 18 10:39:52 1998  Daniel Verite <daniel@brainstorm.fr>
+
+	* amigaos.c (CAN_WRITE_OUTSYM): New macro.
+	(amiga_write_object_contents): Use CAN_WRITE_OUTSYM
+
 Wed Jan 14 17:23:27 1998  Nick Clifton  <nickc@cygnus.com>
 
 	* elf32-m32r.c: Add macros to handle NOP insertion.
@@ -721,6 +810,13 @@ Mon Dec 22 13:04:33 1997  Joel Sherrill  <joel@oarcorp.com>
         * config.bfd (i[3456]86*-go32-rtems*): Fix to be the same as
 	i[3456]86-go32.
 
+Fri Dec 19 14:25:58 1997  Daniel Verite  <daniel@brainstorm.fr>
+
+	* amigaos.c (amiga_bfd_copy_private_section_data): Add return
+ 	value. 
+ 	* amigaoslink.c (amiga_final_link): Update linker_mark fields for
+ 	input sections involved in the output.
+
 Thu Dec 18 16:01:25 1997  Doug Evans  <devans@canuck.cygnus.com>
 
 	* configure: Regenerate to get @SHELL@ substituted.
@@ -943,6 +1039,10 @@ Sat Nov 15 15:36:07 1997  Fred Fish  <fnf@cygnus.com>
 	* peicode.h (coff_swap_aouthdr_in): Cast second arg of
 	bfd_h_get_* calls to "bfd_byte *".
 
+Sat Nov 15 09:13:39 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* config.bfd (i[3456]86-*-beos*): Add config for x86 BeOS.
+
 Tue Nov 11 10:37:23 1997  Jeffrey A Law  (law@cygnus.com)
 
 	* elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field
@@ -1055,6 +1155,11 @@ Mon Oct 20 15:01:27 1997  Klaus K"ampf  <kkaempf@progis.de>
 
 	* evax-egsd.c: Make section flags dec c compatible.
 
+Mon Oct 20 11:05:36 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (AC_ARFLAGS): Add.
+	* configure: Regenerate.
+
 Mon Oct 20 09:38:31 1997  Jeffrey A Law  (law@cygnus.com)
 
 	* som.c (normalize): Delete function.
@@ -1260,6 +1365,16 @@ Tue Sep 23 19:03:13 1997  Ian Lance Taylor  <ian@cygnus.com>
 	(assign_file_positions_for_segments): Increment the file offset
 	for a section with contents, even if it is not loadable.
 
+Tue Sep 23 09:46:10 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* amigaos.c (alloca): Only declare if not defined as macro.
+
+Mon Sep 22 10:15:30 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* amigaos.c (sysdep.h): Relocate include to provided needed
+	<sys/types.h> file.
+	* amigaoslink.c (sysdep.h): Ditto, and remove <sys/types.h>.
+
 Thu Sep 18 15:04:57 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* elf32-v850.c (v850_elf_check_relocs): Improve error message.
@@ -1392,6 +1507,12 @@ Tue Aug 26 17:26:51 1997  Ian Lance Taylor  <ian@cygnus.com>
 	* doc/Makefile.am (MKDOC): Use EXEEXT_FOR_BUILD, not EXEEXT.
 	* aclocal.m4, configure, Makefile.in, doc/Makefile.in: Rebuild.
 
+Mon Aug 25 16:32:00 1997  Steffen Opel  <opel@rumms.uni-mannheim.de>
+
+	* Makefile.in (guide, install-guide, clean-guide, bfd.guide): 
+	New targets for AmigaGuide documentation.
+	(install): Add install-info and install-guide.
+
 Mon Aug 25 16:14:34 1997  Christopher Provenzano  <proven@cygnus.com>
 
 	* configure: Rebuild with latest devo autoconf for NT support
@@ -3300,6 +3421,12 @@ Thu Dec 26 18:36:54 1996  Ian Lance Taylor  <ian@cygnus.com>
 	* Makefile.in (install): Move subdir_do out of conditional. From
 	Fred Fish <fnf@cygnus.com>.
 
+Sun Dec 22 10:45:58 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* config.bfd: Add BeOS target support.
+	* configure.in: Add BeOS target support.
+	* configure: Regenerate.
+
 Wed Dec 18 10:04:30 1996  Jeffrey A Law  (law@cygnus.com)
 
 	* elf32-mn10200.c (enum reloc_type): Enable basic 8, 16, and
@@ -4175,6 +4302,12 @@ Fri Aug 30 11:49:19 1996  Ian Lance Taylor  <ian@cygnus.com>
 	(ihex_write_object_contents): Remove extbase; always use segbase
 	instead.
 
+Thu Aug 29 17:53:51 1996  Daniel Verite <daniel@brainstorm.eu.org>
+
+	* amigaos.c (amiga_get_section_contents): Handle sections that
+	are larger than their disksize.
+	(amiga_make_unique_section): Remove infinite loop.
+
 Thu Aug 29 16:52:17 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
 
 	* configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
@@ -4400,6 +4533,13 @@ Mon Aug  5 13:42:41 1996  Ian Lance Taylor  <ian@cygnus.com>
 	check dynsec when deciding whether to start a new segment for a
 	writeable section; -N will now handle this.
 
+Sun Aug  4 22:15:56 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* amigaoslink.c (sys/types.h): Include before genlink.h to get
+	definition for size_t which is used in genlink.h.  This was not
+	getting defined during a cross compilation on alpha-dec-osf2.0 for
+	some reason.
+
 Thu Aug  1 22:43:08 1996  Jeffrey A Law  (law@cygnus.com)
 
 	* libhppa.h: Remove "esel" changes.  Not the right approach.
@@ -4496,6 +4636,11 @@ Fri Jul 19 18:15:51 1996  Ian Lance Taylor  <ian@cygnus.com>
 	* configure.in: Fix test for whether a compiler has a 64 bit
 	type.  From Jim Wilson <wilson@cygnus.com>.
 
+Thu Jul 18 16:58:11 1996  Daniel Verite <daniel@brainstorm.eu.org>
+
+	* amigaoslink.c (aout_perform_reloc): Fix baserel 16 bits relocs.
+	(my_add_to): Fix sign bug in extraction of 16 bits values.
+
 Thu Jul 18 15:39:10 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.host (mips-sgi-irix6*): New host.
@@ -4625,6 +4770,11 @@ Mon Jul  8 16:18:03 1996  Ian Lance Taylor  <ian@cygnus.com>
 	(mips_relocate_section): Permit an arbitrary number of REFHI or
 	RELHI relocs before the associated REFLO or RELLO reloc.
 
+Sun Jul  7 12:15:39 1996  Kamil Iskra <iskra@student.uci.agh.edu.pl>
+
+	* amigaos.c (amiga_write_symbols): Fix Daniel's workaround for
+	outputting long symbol names.
+
 Fri Jul  5 19:27:49 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* aout-target.h (MY(callback)): Set reloc_count fields.
@@ -4704,6 +4854,11 @@ Fri Jun 28 11:17:00 1996  Richard Henderson  <rth@tamu.edu>
 	(elf64_alpha_adjust_dynamic_symbol): If a symbol has its address
 	taken, we cannot generate a .plt entry for the symbol.
 
+Thu Jun 27 17:35:32 1996 Daniel Verite <daniel@brainstorm.eu.org>
+
+	* amigaos.c (amiga_write_object_contents): Don't output symbols
+	which are not attached to any section, such as indirect symbols.
+
 Thu Jun 27 11:24:29 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.in: Add AC_ISC_POSIX, and check for setitimer and
@@ -4933,6 +5088,19 @@ Tue Jun 11 15:24:48 1996  Ian Lance Taylor  <ian@cygnus.com>
 	common symbol defined by the linker.  Don't export function code
 	even if export_defineds is set.
 
+Tue Jun 11 12:52:10 1996 Daniel Verite <daniel@brainstorm.eu.org>
+
+	* amigaoslink.c (mygeta4): Function removed.
+	(amiga_final_link): Search for ___a4_init symbol in the global hash
+	table and cache its value in the backend data.
+
+	* amigaos.c (write_longs): Return a boolean instead of the
+	number of longs written.
+	(write_section_contents): Split reloc hunks at 0xffff entries.
+	(amiga_write_symbols): Cut the names in hunk symbols at 124 characters
+	(workaround for an amigaos bug).
+	(amiga_handle_rest): Added a sanity check in reloc hunks parsing.
+
 Mon Jun 10 11:57:27 1996  Jeffrey A Law  (law@cygnus.com)
 
 	* coff-h8300.c (howto_table): Add new entries for R_BCC_INV
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index b8e5544..3665b31 100644
--- binutils-2.9.1.orig/bfd/Makefile.am
+++ binutils-2.9.1/bfd/Makefile.am
@@ -98,7 +98,10 @@ ALL_MACHINES_CFILES = \
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
 BFD32_BACKENDS = \
+	amigaos.lo \
+	amigaoslink.lo \
 	aout-adobe.lo \
+	aout-amiga.lo \
 	aout-arm.lo \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
@@ -150,6 +153,7 @@ BFD32_BACKENDS = \
 	elf32-mips.lo \
 	elf-m10200.lo \
 	elf-m10300.lo \
+	elf32-morphos.lo \
 	elf32-ppc.lo \
 	elf32-sh.lo \
 	elf32-sparc.lo \
@@ -203,7 +207,10 @@ BFD32_BACKENDS = \
 	xcofflink.lo
 
 BFD32_BACKENDS_CFILES = \
+	amigaos.c \
+	amigaoslink.c \
 	aout-adobe.c \
+	aout-amiga.c \
 	aout-arm.c \
 	aout-ns32k.c \
 	aout-sparcle.c \
@@ -255,6 +262,7 @@ BFD32_BACKENDS_CFILES = \
 	elf32-mips.c \
 	elf-m10200.c \
 	elf-m10300.c \
+	elf32-morphos.c \
 	elf32-ppc.c \
 	elf32-sh.c \
 	elf32-sparc.c \
@@ -382,7 +390,7 @@ CFILES = \
 HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
 	ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
-	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libamiga.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
 	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
 	targmatch.h
@@ -637,6 +645,9 @@ cpu-vax.lo: cpu-vax.c
 cpu-we32k.lo: cpu-we32k.c
 cpu-w65.lo: cpu-w65.c
 cpu-z8k.lo: cpu-z8k.c
+amigaos.lo: amigaos.c libamiga.h bfd.h
+amigaoslink.lo: bfd.h libamiga.h amigaoslink.c
+aout-amiga.lo: aout-amiga.c aoutf1.h bfd.h
 aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
   $(INCDIR)/bfdlink.h
@@ -787,6 +798,9 @@ elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
 elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
+elf32-morphos.lo: elf32-morphos.c $(INCDIR)/bfdlink.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/elf/ppc.h elf32-target.h
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/ppc.h elf32-target.h
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index d8249a4..b9db357 100644
--- binutils-2.9.1.orig/bfd/Makefile.in
+++ binutils-2.9.1/bfd/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -187,7 +193,10 @@ ALL_MACHINES_CFILES = \
 # The .o files needed by all of the 32 bit vectors that are configured into
 # target_vector in targets.c if configured with --enable-targets=all.
 BFD32_BACKENDS = \
+	amigaos.lo \
+	amigaoslink.lo \
 	aout-adobe.lo \
+	aout-amiga.lo \
 	aout-arm.lo \
 	aout-ns32k.lo \
 	aout-sparcle.lo \
@@ -239,6 +248,7 @@ BFD32_BACKENDS = \
 	elf32-mips.lo \
 	elf-m10200.lo \
 	elf-m10300.lo \
+	elf32-morphos.lo \
 	elf32-ppc.lo \
 	elf32-sh.lo \
 	elf32-sparc.lo \
@@ -292,7 +302,10 @@ BFD32_BACKENDS = \
 	xcofflink.lo
 
 BFD32_BACKENDS_CFILES = \
+	amigaos.c \
+	amigaoslink.c \
 	aout-adobe.c \
+	aout-amiga.c \
 	aout-arm.c \
 	aout-ns32k.c \
 	aout-sparcle.c \
@@ -344,6 +357,7 @@ BFD32_BACKENDS_CFILES = \
 	elf32-mips.c \
 	elf-m10200.c \
 	elf-m10300.c \
+	elf32-morphos.c \
 	elf32-ppc.c \
 	elf32-sh.c \
 	elf32-sparc.c \
@@ -471,7 +485,7 @@ CFILES = \
 HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h \
 	ecoffswap.h elf32-hppa.h elf32-target.h elf64-target.h \
-	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libaout.h \
+	elfcode.h evax.h genlink.h go32stub.h hppa_stubs.h libamiga.h libaout.h \
 	libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
 	libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h ns32k.h som.h \
 	targmatch.h
@@ -521,6 +535,7 @@ LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
 libbfd_a_LIBADD = 
 libbfd_a_OBJECTS = 
+ARFLAGS = @ARFLAGS@
 LTLIBRARIES =  $(lib_LTLIBRARIES)
 
 libbfd_la_OBJECTS =  archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
@@ -536,21 +551,21 @@ acconfig.h acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
 configure.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
 OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
 
-default: all
+all: all-recursive-am all-am
 
 .SUFFIXES:
 .SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -643,18 +658,18 @@ maintainer-clean-libLTLIBRARIES:
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
 
 uninstall-libLTLIBRARIES:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  $(LIBTOOL)  --mode=uninstall rm -f $(libdir)/$$p; \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
 	done
 
 libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
@@ -671,7 +686,8 @@ libbfd.la: $(libbfd_la_OBJECTS) $(libbfd_la_DEPENDENCIES)
 
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+check-recursive installcheck-recursive info-recursive dvi-recursive \
+guide-recursive ps-recursive html-recursive:
 	@set fnord $(MAKEFLAGS); amf=$$2; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  target=`echo $@ | sed s/-recursive//`; \
@@ -776,6 +792,9 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	done
 info: info-recursive
+guide: guide-recursive
+html: html-recursive
+ps: ps-recursive
 dvi: dvi-recursive
 check:
 	$(MAKE) check-recursive
@@ -803,12 +822,10 @@ install: install-recursive install-exec-am install-data-am
 
 uninstall: uninstall-recursive uninstall-am
 
-all: all-recursive-am all-am
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs: installdirs-recursive
-	$(mkinstalldirs)  $(libdir)
+	$(mkinstalldirs)  $(DATADIR)$(libdir)
 
 
 mostlyclean-generic:
@@ -857,26 +874,26 @@ maintainer-clean:  maintainer-clean-recursive maintainer-clean-am
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
-distclean-noinstLIBRARIES clean-noinstLIBRARIES \
-maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck install-info all-recursive-am all-am install-exec-am \
-install-data-am uninstall-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-libLTLIBRARIES \
+distclean-libLTLIBRARIES clean-libLTLIBRARIES \
+maintainer-clean-libLTLIBRARIES uninstall-libLTLIBRARIES \
+install-libLTLIBRARIES install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive guide-recursive html-recursive \
+ps-recursive dvi-recursive mostlyclean-recursive distclean-recursive \
+clean-recursive maintainer-clean-recursive tags tags-recursive \
+mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
+distdir info guide html ps dvi installcheck install-info \
+all-recursive-am all-am install-exec-am install-data-am uninstall-am \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 diststuff: info
@@ -922,6 +939,9 @@ targets.lo: targets.c config.status
 archures.lo: archures.c config.status
 	$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c
 
+coffgen.lo: coffgen.c config.status
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/coffgen.c
+
 elf32-target.h : elfxx-target.h
 	rm -f elf32-target.h
 	sed -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
@@ -1094,6 +1114,9 @@ cpu-vax.lo: cpu-vax.c
 cpu-we32k.lo: cpu-we32k.c
 cpu-w65.lo: cpu-w65.c
 cpu-z8k.lo: cpu-z8k.c
+amigaos.lo: amigaos.c libamiga.h bfd.h
+amigaoslink.lo: bfd.h libamiga.h amigaoslink.c
+aout-amiga.lo: aout-amiga.c aoutf1.h bfd.h
 aout-adobe.lo: aout-adobe.c $(INCDIR)/aout/adobe.h \
   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \
   $(INCDIR)/bfdlink.h
@@ -1244,6 +1267,9 @@ elf-m10200.lo: elf-m10200.c elf-bfd.h $(INCDIR)/elf/common.h \
 elf-m10300.lo: elf-m10300.c elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
   elf32-target.h
+elf32-morphos.lo: elf32-morphos.c $(INCDIR)/bfdlink.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/elf/ppc.h elf32-target.h
 elf32-ppc.lo: elf32-ppc.c $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/elf/ppc.h elf32-target.h
diff --git a/bfd/amigaos.c b/bfd/amigaos.c
new file mode 100644
index 0000000..7d3a3cf
--- /dev/null
+++ binutils-2.9.1/bfd/amigaos.c
@@ -0,0 +1,3309 @@
+/* BFD back-end for Commodore-Amiga AmigaOS binaries.
+   Copyright (C) 1990-1994 Free Software Foundation, Inc.
+   Contributed by Leonard Norrgard.  Partially based on the bout
+   and ieee BFD backends and Markus Wild's tool hunk2gcc.
+   Revised and updated by Stephan Thesing 
+
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/*
+SECTION
+	amiga back end
+
+This section describes the overall structure of the Amiga BFD back end.
+The linker stuff can be found in @xref{amigalink}.
+@menu
+@* implementation::
+@* amigalink::
+@end menu
+
+INODE
+implementation, amigalink, amiga, amiga
+
+
+SECTION
+	implementation
+
+
+The need for a port of the bfd library for Amiga style object (hunk) files
+arose by the desire to port the GNU debugger gdb to the Amiga.
+Also, the linker ld should be updated to the current version (2.5.2).
+@@*
+This port bases on the work done by Leonard Norrgard, who started porting
+gdb. Raphael Luebbert, who supports the ixemul.library, has also worked on
+implementing the needed @code{ptrace()} system call and gas2.5.
+
+@menu
+@* not supported::
+@* Does it work ?::
+@* TODO::
+@end menu
+
+INODE
+not supported, Does it work ?,implementation,implementation
+SUBSECTION
+	not supported
+
+Currently, the implementation does not support Amiga link library files, like
+e.g. amiga.lib. This may be added in a later version, if anyone starts work
+on it, or I find some time for it.
+
+The handling of the symbols in hunk files is a little bit broken:
+	  o The symbols in a load file are totally ignored at the moment, so gdb and gprof
+            do not work.
+	  o The symbols of a object module (Hunk file, starting with HUNK_UNIT) are read in
+            correctly, but HUNK_SYMBOL hunks are also ignored.
+
+The reason for this is the following:
+Amiga symbol hunks do not allow for much information. Only a name and a value are allowed.
+On the other hand, a.out format carries along much more information (see, e.g. the
+entry on set symbols in the ld manual). The old linker copied this information into
+a HUNK_DEBUG hunk. Now there is the choice:
+	o ignoring the debug hunk, read in only HUNK_SYMBOL definitions => extra info is lost.
+	o read in the debug hunk and use the information therein => How can clashs between the
+          information in the debug hunk and HUNK_SYMBOL or HUNK_EXT hunks be avoided ?
+I haven't decided yet, what to do about this.
+
+
+Although bfd allows to link together object modules of different flavours, 
+producing a.out style executables does not work on Amiga :-)
+It should, however, be possible to create a.out files with the -r option of ld
+(incremental link).
+
+INODE 
+Does it work ?,TODO ,not supported , implementation
+SUBSECTION
+	Does it work ?
+
+Currently, the following utilities work:
+	o objdump
+	o objcopy
+	o strip
+	o nm
+	o ar
+	o gas
+
+	
+INODE
+TODO, , Does it work ?, implementation
+SUBSECTION
+	TODO
+
+	o fix fixme:s
+
+@*
+BFD:
+	o add flag to say if the format allows multiple sections with the
+          same name.  Fix bfd_get_section_by_name() and bfd_make_section()
+          accordingly.
+       
+	o dumpobj.c: the disassembler: use relocation record data to find symbolic
+           names of addresses, when available.  Needs new routine where one can
+          specify the source section of the symbol to be printed as well as some
+          rewrite of the disassemble functions.
+       
+*/
+
+#include "bfd.h"
+#include "bfdlink.h"
+#include "sysdep.h"
+#include "genlink.h"
+#include "libbfd.h"
+#include "libamiga.h"
+
+#ifndef alloca
+extern PTR alloca ();
+#endif
+
+typedef struct aout_symbol {
+  asymbol symbol;
+  short desc;
+  char other;
+  unsigned char type;
+} aout_symbol_type;
+
+#include "aout/aout64.h"
+
+typedef struct amiga_ardata_struct {
+  /* generic stuff */
+  struct artdata generic;
+  /* amiga-specific stuff */
+  unsigned long filesize;
+  struct arch_syms *defsyms;
+  unsigned long defsym_count;
+} amiga_ardata_type;
+
+#define amiga_ardata(abfd) (*(struct amiga_ardata_struct **)&(abfd)->tdata.aout_ar_data)
+
+#define GL(x) bfd_get_32 (abfd, (bfd_byte *) (x))
+#define GW(x) bfd_get_16 (abfd, (bfd_byte *) (x))
+#define LONGSIZE(l) (((l)+3) >> 2)
+
+#define DEBUG_AMIGA 10000
+
+static long determine_datadata_relocs PARAMS ((bfd *, asection *));
+static boolean amiga_write_section_contents PARAMS ((bfd *, asection *,
+						     asection *, long, long*));
+static boolean amiga_write_symbols PARAMS ((bfd *, asection *));
+static boolean amiga_digest_file ();
+static boolean amiga_mkobject ();
+static boolean amiga_mkarchive ();
+static boolean amiga_read_unit PARAMS ((bfd *, unsigned long));
+static boolean amiga_read_load PARAMS ((bfd *));
+static boolean amiga_handle_cdb_hunk PARAMS ((bfd *, unsigned long,
+					     unsigned long, int,
+					     unsigned long));
+static boolean amiga_handle_rest PARAMS ((bfd *,asection *,boolean));
+static boolean write_name PARAMS ((bfd*, const char*, long));
+
+/* AmigaOS doesn't like symbols names longer than 124 characters */
+#define MAX_NAME_SIZE 124
+
+extern int amiga_pOS_flg;
+
+#if DEBUG_AMIGA
+#include <stdarg.h>
+static void
+error_print(const char *fmt,...)
+{
+  va_list args;
+
+  va_start (args, fmt);
+  vfprintf (stderr, fmt, args);
+  va_end (args);
+}
+
+#define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
+#else
+#define DPRINT(L,x) 
+#endif
+
+reloc_howto_type howto_hunk_reloc8 =
+{
+  HUNK_RELOC8, /* type */
+  0,           /* rightshift */
+  0,           /* size */
+  8,           /* bitsize */
+  true,        /* pc_relative */
+  0,           /* bitpos */
+  complain_overflow_bitfield,  /* complain_on_overflow */
+  0,           /* special_function */
+  "reloc8",    /* textual name */
+  false,       /* partial_inplace? */
+  0x000000ff,  /* src_mask */
+  0x000000ff,  /* dst_mask */
+  true         /* pcrel_offset */
+};
+
+reloc_howto_type howto_hunk_reloc16 =
+{HUNK_RELOC16,0,1,16,true,0,complain_overflow_bitfield,0,"reloc16",false,0x0000ffff,0x0000ffff,true};
+
+reloc_howto_type howto_hunk_reloc32 =
+{HUNK_RELOC32,0,2,32,true,0,complain_overflow_bitfield,0,"reloc32",false,0xffffffff,0xffffffff,true};
+
+reloc_howto_type howto_hunk_drel8 =
+{HUNK_DREL8,0,0,8,false,0,complain_overflow_bitfield,0,"drel8",false,0x000000ff,0x000000ff,false};
+
+reloc_howto_type howto_hunk_drel16 =
+{HUNK_DREL16,0,1,16,false,0,complain_overflow_bitfield,0,"drel16",false,0x0000ffff,0x0000ffff,false};
+
+reloc_howto_type howto_hunk_drel32 =
+{HUNK_DREL32,0,2,32,false,0,complain_overflow_bitfield,0,"drel32",false,0xffffffff,0xffffffff,false};
+
+reloc_howto_type *amiga_howto_array[2][3] =
+{
+  { &howto_hunk_reloc8, &howto_hunk_reloc16, &howto_hunk_reloc32 },
+  { &howto_hunk_drel8, &howto_hunk_drel16, &howto_hunk_drel32 }
+};
+
+/* The following are gross hacks that need to be fixed.  The problem is
+   that the linker unconditionally references these values without
+   going through any of bfd's standard interface.  Thus they need to
+   be defined in a bfd module that is included in *all* configurations,
+   and are currently in bfd.c, otherwise linking the linker will fail
+   on non-Amiga target configurations. */
+/* This one is used by the linker and tells us, if a debug hunk should be
+   written out*/
+extern int write_debug_hunk;
+/* This is also used by the linker to set the attribute of sections */
+extern int amiga_attribute;
+
+static boolean
+get_long (abfd, n)
+    bfd *abfd;
+    unsigned long *n;
+{
+  if (bfd_read ((PTR)n, 1, sizeof (*n), abfd) != sizeof (*n))
+    return false;
+  *n = GL (n);
+  return true;
+}
+
+static const struct bfd_target *
+amiga_object_p (abfd)
+     bfd *abfd;
+{
+  char buf[8];
+  unsigned int x;
+  struct stat stat_buffer;
+
+  /* An Amiga object file must be at least 8 bytes long.  */
+  if (bfd_read ((PTR) buf, 1, 8, abfd) != 8)
+    {
+      bfd_set_error(bfd_error_wrong_format);
+      return 0;
+    }
+
+  bfd_seek (abfd, 0, SEEK_SET);
+
+  /* Does it look like an Amiga object file?  */
+  x = GL(buf);
+  if ((x != HUNK_UNIT) && (x != HUNK_HEADER) && (x != HUNK_HEADER_POS))
+    {
+      /* Not an Amiga file.  */
+      bfd_set_error(bfd_error_wrong_format);
+      return 0;
+    }
+
+  /* Can't fail and return (but must be declared boolean to suit
+     other bfd requirements).  */
+  (void) amiga_mkobject (abfd);
+
+  AMIGA_DATA(abfd)->IsLoadFile = (x == HUNK_HEADER || x == HUNK_HEADER_POS);
+
+  if (!amiga_digest_file (abfd))
+    {
+      /* Something went wrong.  */
+      DPRINT (20,("bfd parser stopped at offset 0x%lx\n", bfd_tell (abfd)));
+      return (const struct bfd_target *) 0;
+    }
+
+  /* Set default architecture to m68k:68000.  */
+  /* So we can link on 68000 AMIGAs..... */
+  abfd->arch_info = bfd_scan_arch ("m68k:68000");
+
+  return (abfd->xvec);
+}
+
+/* Skip over the hunk length longword + the number of longwords given there.  */
+#define next_hunk(abfd) \
+  { AMIGA_DATA(abfd)->file_pointer += 1 + GL(AMIGA_DATA(abfd)->file_pointer); }
+
+static asection *
+amiga_get_section_by_hunk_number (abfd, hunk_number)
+     bfd *abfd;
+      long hunk_number;
+{
+  /* A cache, so we don't have to search the entire list every time.  */
+  static asection *last_reference;
+  static bfd *last_bfd;
+  asection *p;
+
+  switch(hunk_number)
+    {
+    case -1:
+      return bfd_abs_section_ptr;
+      break;
+    case -2:
+      return bfd_und_section_ptr;
+      break;
+    case -3: 
+      return bfd_com_section_ptr;
+      break;
+    default:
+      if (last_reference)
+	if (last_bfd == abfd && last_reference->target_index == hunk_number)
+	  return last_reference;
+      for (p = abfd->sections; p != NULL; p = p->next)
+	if (p->target_index == hunk_number)
+	  {
+	    last_reference = p;
+	    last_bfd = abfd;
+	    return p;
+	  }
+      BFD_FAIL();
+      break;
+    }
+  return (asection *) 0;
+}
+
+static boolean
+amiga_add_reloc (abfd, section, offset, symbol, howto, target_hunk)
+     bfd *abfd;
+     asection *section;
+     bfd_size_type offset;
+     amiga_symbol_type * symbol;
+     reloc_howto_type *howto;
+     long target_hunk;
+{
+  amiga_reloc_type *reloc;
+  static int count;
+  asection *target_sec;
+
+  reloc = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
+  reloc->next = 0;
+
+  if (!reloc)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return(false);
+    }
+
+  abfd -> flags |= HAS_RELOC;
+  section -> flags |= SEC_RELOC;
+
+  if (amiga_per_section(section)->reloc_tail)
+    amiga_per_section(section)->reloc_tail->next = reloc;
+  else
+    section->relocation = (struct reloc_cache_entry *) reloc;
+  amiga_per_section(section)->reloc_tail = reloc;
+  reloc->next = NULL;
+  reloc->relent.address = offset;
+  reloc->relent.addend = 0;
+  reloc->relent.howto = howto;
+
+  if (symbol==NULL) {		/* relative to section */
+    target_sec = amiga_get_section_by_hunk_number (abfd, target_hunk);
+     if (target_sec)
+       reloc->symbol = (amiga_symbol_type *)target_sec->symbol;
+     else
+       return false;
+  }
+  else
+    reloc->symbol = symbol;
+  reloc->relent.sym_ptr_ptr=(asymbol **)(&(reloc->symbol));
+  reloc->target_hunk = target_hunk;
+
+  return true;
+}
+
+/* BFD doesn't currently allow multiple sections with the same
+   name, so we try a little harder to get a unique name.  */
+asection *
+amiga_make_unique_section (abfd, name)
+     bfd *abfd;
+     CONST char *name;
+{
+  asection *section;
+
+  bfd_set_error (bfd_error_no_error);
+  section = bfd_make_section (abfd, name);
+  if (!section && (bfd_get_error() == bfd_error_no_error))
+    {
+#if 0
+      int i = 1;
+      char *new_name;
+
+      new_name = bfd_alloc (abfd, strlen(name) + 4);
+
+      /* We try to come up with an original name (since BFD
+	 currently requires all sections to have different names).  */
+      while (!section && (i<=99))
+	{
+	  sprintf (new_name, "%s_%u", name, i++);
+	  section = bfd_make_section (abfd, new_name);
+	}
+#else
+      section = bfd_make_section_anyway (abfd, name);
+#endif
+    }
+  return section;
+}
+
+
+
+#if DEBUG_AMIGA
+#define DPRINTHUNK(x)   fprintf (stderr,"Processing %s hunk (0x%x)...",\
+	  (x) == HUNK_UNIT ? "HUNK_UNIT" :\
+	  (x) == HUNK_NAME ? "HUNK_NAME" :\
+	  (x) == HUNK_DEBUG ? "HUNK_DEBUG" :\
+	  (x) == HUNK_OVERLAY ? "HUNK_OVERLAY" :\
+	  (x) == HUNK_BREAK ? "HUNK_BREAK" :\
+	  (x) == HUNK_HEADER ? "HUNK_HEADER" :\
+	  (x) == HUNK_HEADER_POS ? "HUNK_HEADER_POS" :\
+	  (x) == HUNK_CODE ? "HUNK_CODE" :\
+	  (x) == HUNK_DATA ? "HUNK_DATA" :\
+	  (x) == HUNK_BSS ? "HUNK_BSS" :\
+	  (x) == HUNK_RELOC8 ? "HUNK_RELOC8" :\
+	  (x) == HUNK_RELOC16 ? "HUNK_RELOC16" :\
+	  (x) == HUNK_RELOC32 ? "HUNK_RELOC32" :\
+	  (x) == HUNK_DREL8 ? "HUNK_DREL8" :\
+	  (x) == HUNK_DREL16 ? "HUNK_DREL16" :\
+	  (x) == HUNK_DREL32 ? "HUNK_DREL32" :\
+	  (x) == HUNK_SYMBOL ? "HUNK_SYMBOL" :\
+	  (x) == HUNK_EXT ? "HUNK_EXT" :\
+	  (x) == HUNK_END ? "HUNK_END" :\
+	  (x) == HUNK_LIB ? "HUNK_LIB" :\
+	  (x) == HUNK_INDEX ? "HUNK_INDEX" :\
+	  "*unknown*",(x))
+#define DPRINTHUNKEND fprintf(stderr,"...done\n")
+#else
+#define DPRINTHUNK(x) 
+#define DPRINTHUNKEND 
+#endif
+
+#define STRSZ_BLOCK 4096
+#define CARSYM_BLOCK 200
+
+static boolean
+parse_archive_units (abfd, n_units, filesize, one, syms, symcount)
+  bfd *abfd;
+  int *n_units;
+  unsigned long filesize;
+  boolean one;		       /* parse only the first unit ? */
+  struct arch_syms **syms;
+  symindex *symcount;
+{
+  unsigned long hunk_type,pos,no,hunk,len,n;
+  long section_idx=-1;
+  symindex defsymcount=0;
+  unsigned long str_size=0, str_tot_size=0;
+  char *strings = NULL;
+  unsigned long unit_offset, defsym_pos=0;
+  struct arch_syms *nsyms, *syms_tail=NULL;
+
+  *n_units = 0;
+  while (get_long (abfd, &hunk_type)) {
+    switch (hunk_type) {
+    case HUNK_UNIT:
+      unit_offset = bfd_tell (abfd)-4;
+      (*n_units)++;
+      if (one && *n_units>1) {
+	bfd_seek (abfd, -4, SEEK_CUR);
+	return true;
+      }
+      if (get_long (abfd, &len) && !bfd_seek (abfd, len<<2, SEEK_CUR)) {
+	section_idx = -1;
+      }
+      else
+	return false;
+      break;
+    case HUNK_DEBUG:
+    case HUNK_NAME:
+      if (!(get_long (abfd, &len) && !bfd_seek (abfd, len<<2, SEEK_CUR)))
+	return false;
+      break;
+    case HUNK_CODE:
+    case HUNK_DATA:
+      section_idx++;
+      if (!(get_long (abfd, &len) && !bfd_seek (abfd, (len&0x3fffffff)<<2,
+						SEEK_CUR)))
+	return false;
+      break;
+    case HUNK_BSS:
+      section_idx++;
+      if (!get_long (abfd, &len))
+	return false;
+      break;
+    case HUNK_RELOC8:
+    case HUNK_RELOC16:
+    case HUNK_RELOC32:
+      if (!get_long (abfd, &no))
+	return false;
+      while (no) {
+	/* destination hunk */
+	if (!get_long (abfd, &hunk))
+	  return false;
+	/* skip the offsets */
+	if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	  return false;
+	/* read the number of offsets to come */
+	if (!get_long (abfd, &no))
+	  return false;
+      }
+      break;
+    case HUNK_END:
+      break;
+    case HUNK_DREL8:
+    case HUNK_DREL16:
+    case HUNK_DREL32:
+      fprintf (stderr, "hunk_drelx not supported yet\n");
+      return false;
+    case HUNK_SYMBOL:
+      if (!get_long (abfd, &len))
+	return false;
+      while (len) {
+	if (bfd_seek (abfd, (len+1)<<2, SEEK_CUR))
+	  return false;
+	if (!get_long (abfd, &len))
+	  return false;
+      }
+      break;
+    case HUNK_EXT:
+      defsym_pos = 0;
+      if (!get_long (abfd, &n))
+	return false;
+      while (n != 0) {
+	unsigned long tmp, type;
+
+	len = n & 0xffffff;
+	type = (n>>24) & 0xff;
+	switch (type) {
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS:
+	  /* retain the positions of defined symbols for each object
+             in the archive. They'll be used later to build a
+             pseudo-armap, which _bfd_generic_link_add_archive_symbols
+             needs */
+	  if (defsym_pos==0)
+	    defsym_pos = bfd_tell (abfd)-4;
+	  /* skip name & value */
+	  if (bfd_seek (abfd, (len+1)<<2, SEEK_CUR))
+	    return false;
+	  defsymcount++;
+	  break;
+
+	case EXT_REF8:
+	case EXT_REF16:
+	case EXT_REF32:
+	case EXT_DEXT8:
+	case EXT_DEXT16:
+	case EXT_DEXT32:
+	  /* skip name */
+	  if (bfd_seek (abfd, len<<2, SEEK_CUR))
+	    return false;
+
+	  if (!get_long (abfd, &no))
+	    return false;
+	  if (no)
+	    if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	      return false;
+	  break;
+
+	case EXT_COMMON:
+	  /* skip name */
+	  if (bfd_seek (abfd, len<<2, SEEK_CUR))
+	    return false;
+	  /* size of common block */
+	  if (!get_long (abfd, &len))
+	    return false;
+	  /* number of references */
+	  if (!get_long (abfd, &no))
+	    return false;
+	  /* skip references */
+	  if (no)
+	    if (bfd_seek (abfd, no<<2, SEEK_CUR))
+	      return false;
+	  break;
+
+	default: /* error */
+	  fprintf (stderr, "unexpected type in hunk_ext at offset 0x%lx\n",
+		   bfd_tell (abfd));
+	  return false;
+	}
+
+	if (!get_long (abfd, &n))
+	  return false;
+      }
+      if (defsym_pos != 0 && syms) {
+	/* there are some defined symbols, keep enough information on
+           them to simulate an armap later on */
+	nsyms = (struct arch_syms*) bfd_alloc (abfd, sizeof (struct arch_syms));
+	nsyms->next = NULL;
+	if (syms_tail)
+	  syms_tail->next = nsyms;
+	else
+	  *syms = nsyms;
+	syms_tail = nsyms;
+	nsyms->offset = defsym_pos;
+	nsyms->size = bfd_tell (abfd) - defsym_pos;
+	nsyms->unit_offset = unit_offset;
+      }
+      break; /* of HUNK_EXT */
+
+    default:
+#if 0
+      fprintf (stderr, "unexpected hunk 0x%lx at offset 0x%lx\n",
+	       hunk_type, bfd_tell (abfd));
+#endif
+      return false;
+    }
+  }
+  if (syms && symcount)
+    *symcount = defsymcount;
+  return (bfd_tell (abfd) == filesize);
+}
+
+static boolean
+amiga_digest_file (abfd)
+     bfd *abfd;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type,pos;
+  struct stat stat_buffer;
+
+  if (bfd_read ((PTR) &hunk_type, 1, 4, abfd) != 4)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  if (bfd_stat (abfd, &stat_buffer) < 0)
+    return false;
+
+  hunk_type = HUNK_VALUE(GL(&hunk_type));
+
+  switch (hunk_type)
+    {
+    case HUNK_UNIT:
+      /* Read the unit(s) */
+/*
+      while ((pos=bfd_tell (abfd)) < stat_buffer.st_size)
+	{
+*/
+      if (!amiga_read_unit (abfd, stat_buffer.st_size - abfd->origin))
+	return false;
+      if (abfd->arelt_data)
+	arelt_size (abfd) = bfd_tell (abfd);
+/*	}*/
+      break;
+
+    case HUNK_HEADER:
+    case HUNK_HEADER_POS:
+      /* This is a load file */
+      if (!amiga_read_load (abfd))
+	return(false);
+      break;
+    }
+
+  return true;
+}/* of amiga_digest_file */
+
+
+/* Read in Unit file */
+/* file pointer is located after the HUNK_UNIT LW */
+static boolean
+amiga_read_unit (abfd, size)
+    bfd *abfd;
+    unsigned long size;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type, hunk_number=0;
+  unsigned long sz;
+  unsigned long buf[2];
+
+  /* read LW length of unit's name */
+  if (bfd_read (buf, sizeof (buf[0]), 1, abfd) != sizeof (buf[0]))
+    return false;
+
+  /* and skip it (FIXME maybe) */
+  if (bfd_seek (abfd, GL(buf)<<2, SEEK_CUR))
+    return false;
+
+  while (bfd_tell (abfd) < size)
+    {
+      if (!get_long (abfd, &hunk_type))
+	return false;
+
+      /* Now there may be CODE, DATA, BSS, SYMBOL, DEBUG, RELOC Hunks */
+      hunk_type = HUNK_VALUE (hunk_type);
+
+      switch(hunk_type)
+	{
+	case HUNK_UNIT:
+	  /* next unit, seek back and return */
+	  return (bfd_seek (abfd, -4, SEEK_CUR) == 0);
+
+	case HUNK_DEBUG:
+	  /* we don't parse hunk_debug at the moment */
+	  if (!get_long (abfd, &sz) || bfd_seek (abfd, sz<<2, SEEK_CUR))
+	    return false;
+	  break;
+
+	case HUNK_NAME:
+	case HUNK_CODE:
+	case HUNK_DATA:
+	case HUNK_BSS:
+	  /* Handle this hunk, including relocs, etc.
+	     The finishing HUNK_END is consumed by the routine
+	     */
+	  if (!amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number++,
+				      0, -1))
+	    return false;
+
+	  break;
+
+	default:
+	  /* Something very nasty happened:
+	     Illegal Hunk occured....
+	     */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch hunk_type */
+
+      /* Next hunk */
+    }
+  return true;
+}
+
+
+/* Read a load file */
+static boolean
+amiga_read_load (abfd)
+    bfd *abfd;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd); 
+  unsigned long *hunk_attributes, *hunk_sizes;
+  int hunk_number=0;
+  int hunk_type;
+  unsigned long max_hunk_number;
+  int i,n;
+  unsigned long buf[4];
+
+  /* Read hunk lengths (and memory attributes...) */
+  /* Read in each hunk */
+
+  if (bfd_read (buf, sizeof(*buf), 4, abfd) != 4 * sizeof (*buf))
+    return false;
+
+  /* If there are resident libs: abort (obsolete feature) */
+  if (GL(buf) != 0)
+    return false;
+
+  max_hunk_number = GL(buf+1);
+
+  /* Sanity */
+  if (max_hunk_number<1)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  amiga_data->nb_hunks = max_hunk_number;
+
+  /* Num of root hunk must be 0 */
+  if (GL(buf+2)!=0)
+    {
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  /* Num of last hunk must be mhn-1 */
+  if (GL(buf+3) != max_hunk_number-1)
+    {
+      fprintf (stderr, "Overlay loadfiles are not supported\n");
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  hunk_sizes = alloca (max_hunk_number * sizeof (unsigned long));
+  hunk_attributes = alloca (max_hunk_number * sizeof (unsigned long));
+
+  if (hunk_sizes == NULL || hunk_attributes == NULL)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      return false;
+    }
+
+  if (bfd_read (hunk_sizes, sizeof (unsigned long), max_hunk_number, abfd) !=
+      max_hunk_number * sizeof (unsigned long))
+    return false;
+
+  /* Now, read in sizes and memory attributes */
+  for (i=0; i<max_hunk_number; i++)
+    {
+      /* convert to host format */
+      hunk_sizes[i] = GL(hunk_sizes+i);
+      switch (HUNK_ATTRIBUTE (hunk_sizes[i]))
+	{
+	case HUNK_ATTR_CHIP:
+	  hunk_attributes[i] = MEMF_CHIP;
+	  break;
+	case HUNK_ATTR_FAST:
+	  hunk_attributes[i] = MEMF_FAST;
+	  break;
+	case HUNK_ATTR_FOLLOWS:
+	  if (!get_long (abfd, &hunk_attributes[i]))
+	    return false;
+	  break;
+	default:
+	  hunk_attributes[i] = 0;
+	  break;
+	}
+      hunk_sizes[i] = (HUNK_VALUE (hunk_sizes[i]))<<2;
+    }
+
+  for (hunk_number=0; hunk_number < max_hunk_number; hunk_number++)
+    {
+      if (bfd_read (buf, sizeof(*buf), 1, abfd) != sizeof(*buf))
+	return false;
+      hunk_type = HUNK_VALUE (GL(buf));
+
+      /* This may be HUNK_NAME, CODE, BSS, DEBUG, DATA */
+      switch(hunk_type)
+	{
+	case HUNK_NAME:
+	case HUNK_CODE:
+	case HUNK_DATA:
+	case HUNK_BSS:
+	case HUNK_DEBUG:
+	  if (!amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number,
+				      hunk_attributes[hunk_number],
+				      hunk_sizes[hunk_number]))
+	    {
+	      bfd_set_error (bfd_error_wrong_format);
+	      return false;
+	    }
+	  break;
+
+	default:
+	  /* illegal hunk */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch */
+    }
+
+  return true;
+}/* Of amiga_read_load */
+
+
+/* Handle NAME, CODE, DATA, BSS, DEBUG Hunks */
+static boolean 
+amiga_handle_cdb_hunk (abfd, hunk_type, hunk_number, hunk_attribute,
+		       hunk_size)
+     bfd *abfd;
+     unsigned long hunk_type;
+     unsigned long hunk_number;
+     int hunk_attribute;
+     unsigned long hunk_size;
+/* If hunk_size==-1, then we are digesting a HUNK_UNIT */
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  char *current_name=NULL;
+  unsigned long len;
+  asection *current_section=NULL;
+  int is_load = (hunk_size!=-1);
+  unsigned long buf[6];
+  int secflags;
+
+  if (hunk_type==HUNK_NAME) /* get name */
+    {
+      if (!get_long (abfd, &len))
+	return false;
+      len = (HUNK_VALUE (len)) << 2;
+      current_name = bfd_alloc (abfd, len+1);
+      if (!current_name)
+	return false;
+
+      if (bfd_read (current_name, 1, len, abfd) != len)
+	return false;
+
+      current_name [len] = '\0';
+
+      if (!get_long (abfd, &hunk_type))
+	return false;
+
+    }
+  else /* Set curent name to something appropriate */
+    current_name=(hunk_type==HUNK_CODE)?".text":
+                 (hunk_type==HUNK_BSS)?".bss":".data";
+
+  /* file_pointer is now after hunk_type */
+  secflags = 0;
+  switch (hunk_type)
+    {
+    case HUNK_CODE:
+      secflags = SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS;
+      goto do_section;
+
+    case HUNK_DATA:
+      secflags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS;
+      goto do_section;
+
+    case HUNK_BSS:
+      secflags = SEC_ALLOC;
+
+    do_section:
+      if (!get_long (abfd, &len))
+	return false;
+      len = HUNK_VALUE (len)<<2; /* Length of section */
+      if (!is_load)
+	{
+	  hunk_attribute = HUNK_ATTRIBUTE (len);
+	  hunk_attribute=(hunk_attribute==HUNK_ATTR_CHIP)?MEMF_CHIP:
+	             (hunk_attribute==HUNK_ATTR_FAST)?MEMF_FAST:0;
+	}
+
+      /* Make new section */
+      current_section = amiga_make_unique_section (abfd, current_name);
+      if (!current_section)
+	return false;
+
+      current_section->filepos = bfd_tell (abfd);
+      /* For a loadfile, the section size in memory comes from the
+         hunk header. The size on disk may be smaller. */
+      current_section->_cooked_size = current_section->_raw_size =
+	((hunk_size==-1) ? len : hunk_size);
+      current_section->target_index = hunk_number;
+      bfd_set_section_flags (abfd, current_section, secflags);
+
+      amiga_per_section(current_section)->disk_size = len; /* size on disk */
+      amiga_per_section(current_section)->attribute = hunk_attribute;
+
+      /* skip the contents */
+      if ((secflags & SEC_HAS_CONTENTS) && bfd_seek (abfd, len, SEEK_CUR))
+	return false;
+
+      if (!amiga_handle_rest (abfd, current_section, is_load))
+	return false;
+      break;
+
+      /* Currently, there is one debug hunk per executable, instead of
+         one per unit as it would with a "standard" amigaos
+         implementation. So the debug hunk is at the same level as
+         code/data/bss. This will change in the future */
+    case HUNK_DEBUG:
+      /* format of gnu debug hunk is:
+          HUNK_DEBUG
+              N
+            0413.L    Magic number
+	  symtabsize
+	  strtabsize
+	  symtabdata  [length=symtabsize]
+	  strtabdata  [length=strtabsize]
+          [pad bytes]
+	  */
+
+      /* read LW length */
+      if (bfd_read (buf, sizeof(*buf), 1, abfd) != sizeof (*buf))
+	return false;
+
+      len = GL (buf) << 2;
+      if (len > 5*sizeof(long))
+	{
+	  if (bfd_read (buf, sizeof(*buf), 6, abfd) != 6*sizeof(*buf))
+	    return false;
+
+	  if (GL(buf) == 0413) /* GNU DEBUG HUNK */
+	    {
+	      /*FIXME: we should add the symbols in the debug hunk to symtab... */
+	      amiga_data->symtab_size = GL(buf+1);
+	      amiga_data->stringtab_size = GL(buf+2);
+	      adata(abfd).sym_filepos = bfd_tell (abfd);
+	      adata(abfd).str_filepos = adata(abfd).sym_filepos +
+		amiga_data->symtab_size;
+	      len -= 5*sizeof(long);
+	    }
+	}
+      if (bfd_seek (abfd, len, SEEK_CUR))
+	return false;
+      break;
+
+    default:
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+      break;
+    } /* switch (hunk_type) */
+
+  return true;
+
+} /* Of amiga_handle_cdb_hunk */
+
+
+/* Handle rest of a hunk 
+   I.e.: Relocs, EXT, SYMBOLS... */
+static boolean
+amiga_handle_rest (abfd, current_section, isload)
+     bfd *abfd;
+     asection *current_section;
+     boolean isload;
+{
+  amiga_data_type *amiga_data = AMIGA_DATA(abfd);
+  unsigned long hunk_type, type, len, n;
+  long tmp;
+  unsigned long **p, no, *countptr;
+  struct amiga_raw_symbol *sp=NULL;
+  unsigned long buf[5];
+  file_ptr filepos;
+  amiga_per_section_type *asect = amiga_per_section (current_section);
+
+  while (1)
+    {
+      if (!get_long (abfd, &hunk_type))
+	return false;
+      switch (hunk_type)
+	{
+	case HUNK_END:
+	  return true;
+	  break;
+
+	case HUNK_RELOC8:
+	  asect->raw_relocs8 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs8;
+	  goto rel;
+	case HUNK_RELOC16:
+	  asect->raw_relocs16 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs16;
+	  goto rel;
+	case HUNK_RELOC32:
+	  asect->raw_relocs32 = bfd_tell (abfd)-4;
+	  countptr = &asect->num_raw_relocs32;
+	  goto rel;
+	case HUNK_DREL8:
+	  fprintf (stderr, "hunk_drel8 not supported yet\n");
+	  return false;
+	case HUNK_DREL16:
+	  fprintf (stderr, "hunk_drel16 not supported yet\n");
+	  return false;
+	case HUNK_DREL32:
+	  fprintf (stderr, "hunk_drel32 not supported yet\n");
+	  return false;
+	rel:
+	  current_section->flags |= SEC_RELOC;
+	  abfd->flags |= HAS_RELOC;
+
+	  /* read the first number of relocs */
+	  if (!get_long (abfd, &no))
+	    return false;
+
+	  /* count and skip them */
+	  while (no != 0)
+	    {
+	      current_section->reloc_count += no;
+	      (*countptr) += no;
+	      if (bfd_seek (abfd, (no+1)<<2, SEEK_CUR))
+		return false;
+	      if (!get_long (abfd, &no))
+		return false;
+	    }
+	  break;
+
+	case HUNK_SYMBOL:
+	  /* In a unit, we ignore these, since all symbol information
+	     comes with HUNK_EXT, in a load file, these are added */
+	  if (!isload)
+	    {
+	      amiga_per_section(current_section)->hunk_symbol_pos =
+		bfd_tell (abfd);
+	      /* size of first symbol */
+	      if (bfd_read (buf, sizeof(*buf), 1, abfd) != 1*sizeof (*buf))
+		return false;
+	      while (GL(buf) != 0) /* until size is 0 */
+		{
+		  /* skip the name */
+		  if (bfd_seek (abfd, (GL(buf)+1)<<2, SEEK_CUR))
+		    return false;
+		  /* read the size */
+		  if (bfd_read (buf, sizeof(*buf), 1, abfd) != 1*sizeof (*buf))
+		    return false;
+		}
+	      break;
+	    }
+	  /* We add these, by falling through... */
+
+	case HUNK_EXT:
+	  /* We leave these alone, until they are requested by the user */
+	  amiga_per_section(current_section)->hunk_ext_pos = bfd_tell (abfd);
+
+	  if (!get_long (abfd, &n))
+	    return false;
+	  while (n != 0)
+	    {
+	      /* read the symbol type and length */
+	      type = (n>>24) & 0xff;
+	      len = n & 0xffffff;
+
+	      /* skip the symbol name */
+	      if (bfd_seek (abfd, len<<2, SEEK_CUR))
+		return false;
+
+	      switch(type)
+		{
+		case EXT_SYMB: /* Symbol hunks are relative to hunk start... */
+		case EXT_DEF: /* def relative to hunk */
+		case EXT_ABS: /* def absolute */
+		  abfd->flags |= HAS_SYMS; /* We have symbols */
+		  abfd->symcount++;
+		  /* skip the value */
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  break;
+
+		case EXT_REF8: /* 8 bit ref */
+		case EXT_REF16: /* 16 bit ref */
+		case EXT_REF32: /* 32 bit ref */
+		case EXT_DEXT8: /* 8 bit base relative ref */
+		case EXT_DEXT16: /* 16 bit " "*/
+		case EXT_DEXT32: /* 32 bit " " */
+		  abfd->flags |= HAS_SYMS;
+		  abfd->symcount++;
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (tmp)
+		    {
+		      abfd->flags|=HAS_RELOC;
+		      current_section->flags|=SEC_RELOC;
+		      current_section->reloc_count += tmp;
+		      /* skip references */
+		      if (bfd_seek (abfd, tmp<<2, SEEK_CUR))
+			return false;
+		    }
+		  break;
+
+		case EXT_COMMON: /* Common ref/def */
+		  abfd->flags |= HAS_SYMS;
+		  abfd->symcount++;
+		  /* skip the size of common block: FIXME */
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (!get_long (abfd, &tmp))
+		    return false;
+		  if (tmp)
+		    {
+		      abfd->flags |= HAS_RELOC;
+		      current_section->flags |= SEC_RELOC;
+		      current_section->reloc_count += tmp;
+		      if (bfd_seek (abfd, tmp<<2, SEEK_CUR))
+			return false;
+		    }
+		  break;
+
+		default: /* error */
+		  bfd_set_error (bfd_error_wrong_format);
+		  return false;
+		  break;
+		}/* of switch type */
+
+	      if (!get_long (abfd, &n))
+		return false;
+	    }
+	  break;
+
+	  /* If a debug hunk is found at this position, the file has
+             been generated by a third party tool and the debug info
+             here are useless to us. Just skip the hunk, then. */
+	case HUNK_DEBUG:
+	  if (!get_long (abfd, &n) || bfd_seek (abfd, n<<2, SEEK_CUR))
+	    return false;
+	  break;
+	default: /* error */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}/* Of switch */
+    }/* of while */
+  return true;
+}/* of amiga_handle_rest*/
+
+static boolean
+amiga_mkobject (abfd)
+     bfd *abfd;
+{
+  struct amiga_data_struct *rawptr;
+
+  rawptr = (struct amiga_data_struct *)
+    bfd_zalloc (abfd, sizeof (struct amiga_data_struct));
+  abfd->tdata.amiga_data = rawptr;
+  return rawptr != NULL;
+}
+
+static boolean
+amiga_mkarchive (abfd)
+     bfd *abfd;
+{
+  amiga_ardata_type *ar;
+  ar = (amiga_ardata_type*) bfd_zalloc (abfd, sizeof (amiga_ardata_type));
+  amiga_ardata (abfd) = ar;
+  return (ar!=NULL);
+}
+
+/* used with base relative linking */
+extern int amiga_base_relative;
+
+/* used with -resident linking */
+extern int amiga_resident;
+
+/* write nb long words (possibly swapped out) to the output file */
+static boolean
+write_longs (in, nb, abfd)
+     unsigned long *in;
+     long nb;
+     bfd *abfd;
+{
+  unsigned long out [10];
+  int i;
+  
+  while (nb > 0)
+    {
+      for (i=0; i<nb && i<10; i++)
+	out[i] = GL (in++);
+      if (bfd_write ((PTR)out, sizeof (long), i, abfd) != sizeof(long)*i)
+	return false;
+      nb -= 10;
+    }
+  return true;
+}
+
+static long
+determine_datadata_relocs (abfd, section)
+     bfd *abfd;
+     asection *section;
+{
+  long relocs = 1, i;
+  struct reloc_cache_entry *r;
+  asection *insection;
+  asymbol *sym_p;
+  
+  for (i=0;i<section->reloc_count;i++)
+    {
+      r=section->orelocation[i];
+      if (r == NULL)
+        continue;
+      sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
+      insection=sym_p->section;
+
+      /* Is reloc relative to a special section ? */
+      if ((insection==bfd_abs_section_ptr)||(insection==bfd_com_section_ptr)||
+	  (insection==bfd_und_section_ptr)||(insection==bfd_ind_section_ptr))
+	continue; /* Nothing to do, since this translates to HUNK_EXT */
+      if (insection->output_section == section)
+        relocs++;
+    }
+  return relocs;
+}
+
+/* Adjust the indices map when we decide not to output the section <sec> */
+static void
+remove_section_index (sec, index_map)
+    asection *sec;
+    long *index_map;
+{
+  int i = sec->index;
+  sec = sec->next;
+  index_map[i++] = -1;
+  while (sec!=NULL) {
+    (index_map[i++])--;
+    sec=sec->next;
+  }
+}
+
+/* Write out the contents of a bfd */
+static boolean
+amiga_write_object_contents (abfd)
+     bfd *abfd;
+{
+  struct amiga_data_struct *amiga_data=AMIGA_DATA(abfd);
+  sec_ptr p;
+  unsigned long n[5];
+  long i;
+  static const char zero[3]={0,0,0};
+  long datadata_relocs, bss_size = 0;
+  long *index_map;
+  asection *data_sec;
+
+  /* Distinguish UNITS, LOAD Files
+    Write out hunks+relocs+HUNK_EXT+HUNK_DEBUG (GNU format)*/
+  DPRINT(5,("Entering write_object_conts\n"));
+
+  abfd->output_has_begun=true; /* Output has begun */
+
+  index_map = bfd_alloc (abfd, abfd->section_count * sizeof (long));
+  if (!index_map)
+    return false;
+
+  for (i=0, p=abfd->sections; p!=NULL; p=p->next)
+    index_map[i++] = p->index;
+
+  /* Distinguish Load files and Unit files */
+  if (amiga_data->IsLoadFile)
+    {
+      DPRINT(5,("Writing Load file\n"));
+
+      /* Write out load file header */
+      if (amiga_pOS_flg)
+	n[0] = HUNK_HEADER_POS;
+      else
+	n[0] = HUNK_HEADER;
+      n[1] = n[2] = 0;
+      for (p=abfd->sections; p!=NULL; p=p->next) {
+	/* For baserel linking, don't remove the empty sections, since
+           they may get some contents later on */
+	if ((amiga_base_relative || p->_raw_size!=0 || p->_cooked_size!=0) &&
+	    !(amiga_base_relative && !strcmp (p->name, ".bss")))
+	  n[2]++;
+	else
+	  remove_section_index (p, index_map);
+      }
+
+      if (amiga_base_relative)
+	BFD_ASSERT(abfd->section_count==3);
+
+      n[3]=0;
+      n[4]=n[2]-1;
+      if (!write_longs (n, 5, abfd))
+	return false;
+
+      /* Write out sizes and memory specifiers... */
+      /* We have to traverse the section list again, bad but no other way... */
+      if (amiga_base_relative) {
+        for (p=abfd->sections; p!=NULL; p=p->next)
+	  {
+	    if (amiga_resident && strcmp(p->name,".data")==0)
+	      {
+	        datadata_relocs = determine_datadata_relocs (abfd, p);
+	        data_sec = p;
+	      }
+	    else if (strcmp(p->name,".bss")==0)
+	      {
+	        /* Get size for header*/
+	          bss_size = p->_raw_size;
+	      }
+	  }
+      }
+
+      for (p=abfd->sections; p!=NULL; p=p->next)
+	{
+          long extra = 0;
+
+	  if (index_map[p->index] < 0)
+	    continue;
+	  if (amiga_resident && (strcmp(p->name,".text")==0))
+	    extra = datadata_relocs*4;
+	  else {
+	    if (amiga_base_relative && !strcmp (p->name, ".data"))
+	      extra = bss_size;
+	  }
+
+	  if (amiga_per_section(p)->disk_size == 0)
+	    amiga_per_section(p)->disk_size = p->_raw_size;
+
+	  /* convert to a size in long words */
+	  n[0] = LONGSIZE (p->_raw_size+extra);
+
+	  i=amiga_per_section(p)->attribute;
+	  switch (i)
+	    {
+	    case MEMF_CHIP:
+	      n[0]|=0x40000000;
+	      i=1;
+	      break;
+	    case MEMF_FAST:
+	      n[0]|=0x80000000;
+	      i=1;
+	      break;
+	    case 0: /* nothing*/
+	      i=1;
+	      break;
+	    default: /* Special one */
+	      n[0]|=0xc0000000;
+	      n[1]=i;
+	      i=2;
+	      break;
+	    }/* Of switch */
+
+	  if (!write_longs (n, i, abfd))
+            return false;
+	}/* Of for */
+    }
+  else
+    {/* Unit , no base-relative linking here.... */
+      int len = strlen (abfd->filename);
+      /* Write out unit header */
+      DPRINT(5,("Writing Unit\n"));
+
+      n[0]=HUNK_UNIT;
+      if (!write_longs (n, 1, abfd))
+	return false;
+
+      i = LONGSIZE (len);
+      if (!write_name (abfd, abfd->filename, 0))
+	return false;
+    }
+
+  /* Write out every section */
+  for (p=abfd->sections; p!=NULL; p=p->next)
+    {
+      if (index_map[p->index] < 0)
+	continue;
+      if (amiga_per_section(p)->disk_size == 0)
+	amiga_per_section(p)->disk_size = p->_raw_size;
+
+      if (amiga_resident && (strcmp(p->name,".text")==0))
+        {
+          if (!amiga_write_section_contents (abfd,p,data_sec,datadata_relocs,
+					    index_map))
+	    return false;
+        }
+      else if (amiga_base_relative && (strcmp(p->name,".data")==0))
+        {
+          if (!amiga_write_section_contents (abfd,p,0,0,index_map))
+	    return false;
+        }
+      else
+        { 
+          if (!amiga_write_section_contents (abfd,p,0,0,index_map))
+	    return false;
+        }
+
+      if (!amiga_write_symbols(abfd,p)) /* Write out symbols, incl HUNK_END */
+	return false;
+
+    }/* of for sections */
+
+  /* Write out debug hunk, if requested */
+  if (amiga_data->IsLoadFile /*&& write_debug_hunk*/)
+    {
+      extern boolean
+	translate_to_native_sym_flags (bfd*, asymbol*, struct external_nlist*);
+
+      /* We have to convert all the symbols in abfd to a.out style.... */
+      struct external_nlist data;
+      int str_size, offset = 4;
+      int symbols = 0;
+      asymbol *sym;
+      asection *s;
+
+      if (abfd->symcount)
+	{
+	  /* Now, set the .text, .data and .bss fields in the tdata
+	     struct (because translate_to_native_sym_flags needs
+	     them... */
+	  for (i=0,s=abfd->sections;s!=NULL;s=s->next)
+	    if (strcmp(s->name,".text")==0)
+	      {
+		i|=1;
+		adata(abfd).textsec=s;
+	      }
+	    else if (strcmp(s->name,".data")==0)
+	      {
+	        i|=2;
+	        adata(abfd).datasec=s;
+	      }
+	    else if (strcmp(s->name,".bss")==0)
+	      {
+	        i|=4;
+	        adata(abfd).bsssec=s;
+	      }
+
+	  if (i!=7) /* One section missing... */
+	    {
+	      fprintf(stderr,"Missing section, hunk not written\n");
+	      return true;
+	    }
+
+	  str_size=4; /* the first 4 bytes will be replaced with the length */
+
+#define CAN_WRITE_OUTSYM(sym) (sym!=NULL && sym->section && \
+				((sym->section->owner && \
+				 bfd_get_flavour (sym->section->owner) == \
+				 bfd_target_aout_flavour) || \
+				 bfd_asymbol_flavour(sym) == \
+				 bfd_target_aout_flavour))
+
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+	        {
+		  str_size += strlen(sym->name) + 1;
+		  symbols++;
+		}
+	    }
+
+	  /* Write out HUNK_DEBUG, size, 0413.... */
+	  n[0] = HUNK_DEBUG;
+	  n[1] = 3 + ((symbols * sizeof(struct internal_nlist) + str_size + 3) >> 2);
+	  n[2] = 0413L; /* Magic number */
+	  n[3] = symbols * sizeof(struct internal_nlist);
+	  n[4] = str_size;
+	  if (!write_longs ((PTR)(n), 5, abfd))
+	    return false;
+
+	  /* Write out symbols */
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+		{
+	            {
+                      aout_symbol_type *t = (aout_symbol_type *)
+			&(sym)->the_bfd;
+
+	              bfd_h_put_16(abfd, t->desc, data.e_desc);
+	              bfd_h_put_8(abfd, t->other, data.e_other);
+	              bfd_h_put_8(abfd, t->type, data.e_type);
+		    }
+		    if (!translate_to_native_sym_flags(abfd,sym,&data))
+		      {
+			fprintf (stderr, "Cannot translate flags for %s\n",
+				 sym->name);
+		      }
+		  PUT_WORD(abfd, offset, &(data.e_strx[0])); /* Store index */
+		  offset += strlen(sym->name) + 1;
+	          if (bfd_write ((unsigned long *)&data,sizeof(long),3,abfd)
+		      != sizeof(long)*3)
+	            return false;
+	      }
+	    }
+
+	  /* Write out strings */
+	  if (!write_longs ((unsigned long *)&str_size, 1, abfd))
+	    return false;
+	  
+	  for (i = 0; i < abfd->symcount; i++) /* Translate every symbol */
+	    {
+	      sym = abfd->outsymbols[i];
+	      /* NULL entries have been written already.... */
+	      if (CAN_WRITE_OUTSYM (sym))
+		{
+		  int len = strlen(sym->name) + 1;
+
+	          /* Write string tab */
+	          if (bfd_write((PTR)(sym->name),sizeof(char),len,abfd)!=len)
+	            return false;
+		}
+	    }
+
+          i = ((str_size + 3) & (~3)) - str_size;
+          str_size = 0;
+	  /* Write padding */
+	  if (i && bfd_write((PTR)(&str_size),sizeof(char),i,abfd)!=i)
+	    return false;
+
+	  /* write a HUNK_END here to finish the loadfile, or amigaos
+	     will refuse to load it */
+	  n[0]=HUNK_END;
+	  if (!write_longs (n, 1, abfd))
+	    return false;
+	}/* Of if abfd->symcount */
+    }/* Of write out debug hunk */
+
+  bfd_release (abfd, index_map);
+  return true;
+}
+
+/* Write a string padded to 4 bytes and preceded by it's length in
+   long words ORed with <value> */
+static boolean
+write_name (abfd, name, value)
+     bfd *abfd;
+     const char *name;
+     long value;
+{
+  long i,j;
+  struct name {
+    long len;
+    char buf[MAX_NAME_SIZE+3];
+  } n;
+
+  j = strlen (name);
+  if (j > MAX_NAME_SIZE)
+    j = MAX_NAME_SIZE;
+  strncpy (n.buf, name, j);
+  i = LONGSIZE (j) | value;
+  n.len = GL (&i);
+  if (j&3) {
+    n.buf[j] = n.buf[j+1] = n.buf[j+2] = '\0';
+    j += (4-(j&3))&3;
+  }
+  return (bfd_write ((PTR)&n, 1, sizeof(long)+j, abfd) == sizeof(long)+j);
+}
+
+static boolean
+amiga_write_archive_contents (arch)
+     bfd *arch;
+{
+  bfd *object;
+  char buffer[DEFAULT_BUFFERSIZE];
+  int i;
+  unsigned long n[2];
+  long size;
+  struct stat status;
+
+  for (object = arch->archive_head; object; object = object->next)
+    {
+      unsigned int remaining;
+
+      if (bfd_write_p (object))
+	{
+	  bfd_set_error (bfd_error_invalid_operation);
+	  return false;
+	}
+
+      if (stat (object->filename, &status) != 0)
+	{
+	  bfd_set_error (bfd_error_system_call);
+	  return false;
+	}
+
+      if (bfd_seek (object, (file_ptr) 0, SEEK_SET) != 0)
+	return false;
+
+      remaining = status.st_size;
+
+      while (remaining)
+	{
+	  unsigned int amt = DEFAULT_BUFFERSIZE;
+	  if (amt > remaining)
+	    amt = remaining;
+	  errno = 0;
+	  if (bfd_read (buffer, amt, 1, object) != amt)
+	    {
+	      if (bfd_get_error () != bfd_error_system_call)
+		bfd_set_error (bfd_error_malformed_archive);
+	      return false;
+	    }
+	  if (bfd_write (buffer, amt, 1, arch) != amt)
+	    return false;
+	  remaining -= amt;
+	}
+    }
+    return true;
+}
+
+static boolean
+amiga_write_armap (abfd)
+     bfd *abfd;
+{
+  return true;
+}
+
+#define determine_size(type) (2 - ((type)>=3 ? (type)-3 : (type)))
+
+static int
+determine_type (r)
+     struct reloc_cache_entry *r;
+{
+  switch (r->howto->type) /* FIXME: Is this sufficient to distinguish them ?*/
+    {
+      /* AMIGA specific */
+      case HUNK_RELOC8:
+      case HUNK_RELOC16:
+      case HUNK_RELOC32:
+      case HUNK_DREL8:
+      case HUNK_DREL16:
+      case HUNK_DREL32:
+        if (r->howto->type >= HUNK_DREL32)
+          return 3 + r->howto->type - HUNK_DREL32;
+        return r->howto->type - HUNK_RELOC32;
+
+      /* Now, these may occur, if a.out was used as input */
+      case 0: /* 8 bit ref */
+        return 2;
+
+      case 1: /* 16 bit relative */
+        return 1;
+
+      case 2: /* 32 bit relative */
+        return 0;
+
+      case 9: /* 16 bit base rel */
+        return 4;
+
+      case 10: /* 32 bit baserel */
+        return 3;
+
+      /* FIXME: There are other (pc relative) displacements left */
+      default: /* Error, can't represent this */
+        bfd_set_error(bfd_error_nonrepresentable_section);
+        return -1;
+    }/* Of switch */
+}
+
+#define MAX_RELOC_OUT 3
+
+static unsigned long reloc_types[]= {
+  HUNK_RELOC32, HUNK_RELOC16, HUNK_RELOC8
+/* these reloc types are not supported at the moment */
+#if 0
+  HUNK_DREL32,  HUNK_DREL16,  HUNK_DREL8
+#endif
+};
+
+#define NB_RELOC_TYPES (sizeof(reloc_types) / sizeof(reloc_types[0]))
+
+/* Write out section contents, including relocs */
+static boolean
+amiga_write_section_contents (abfd, section, data_sec, datadata_relocs,
+			      index_map)
+     bfd *abfd;
+     asection *section;
+     asection *data_sec;
+     long datadata_relocs;
+     long *index_map;
+{
+  static const char zero[3]={0,0,0};
+  unsigned long n[2];
+  int i, j, type, size;
+  unsigned int k;
+  struct reloc_cache_entry *r;
+  asection *osection, *sec, *insection;
+  asymbol *sym_p;
+  int pad, reloc_count = 0;
+  unsigned long disksize;
+  int max_hunk = -1;
+  char *c_p;
+  unsigned char *values;
+  long *reloc_counts;
+
+  DPRINT(5, ("Entered Write-section-conts\n"));
+
+  /* Compute the maximum hunk number of the ouput file */
+  sec = abfd->sections;
+  while (sec) {
+    max_hunk++;
+    sec = sec->next;
+  }
+
+  /* If we are base-relative linking and the section is .bss and abfd
+     is a load file, then return */
+  if (AMIGA_DATA(abfd)->IsLoadFile)
+    {
+      if (amiga_base_relative && (strcmp(section->name, ".bss") == 0))
+	return true; /* Nothing to do */
+    }
+  else
+    {
+      /* WRITE out HUNK_NAME + section name */
+      n[0] = HUNK_NAME;
+      if (!write_longs (n, 1, abfd) || !write_name (abfd, section->name, 0))
+	return false;
+    }
+
+  /* Depending on the type of the section, write out HUNK_{CODE|DATA|BSS} */
+  if (section->flags & SEC_CODE) /* Code section */
+    n[0] = HUNK_CODE;
+  else if (section->flags & (SEC_DATA | SEC_LOAD)) /* data section */
+    n[0] = HUNK_DATA;
+  else if (section->flags & SEC_ALLOC) /* BSS */
+    n[0] = HUNK_BSS;
+  else if (section->flags & SEC_DEBUGGING) /* debug section */
+    n[0] = HUNK_DEBUG;
+  else /* Error */
+    {
+#if 0
+      bfd_set_error(bfd_error_nonrepresentable_section);
+      return(false);
+#else
+      /* FIXME: Just dump everything we don't currently recognize into
+	 a DEBUG hunk. */
+      n[0] = HUNK_DEBUG;
+#endif
+    }
+
+  DPRINT(10,("Section type is %lx\n",n[0]));
+
+  /* Get real size in n[1], this may be shorter than the size in the header */
+  disksize = LONGSIZE (amiga_per_section(section)->disk_size) + datadata_relocs;
+  pad = (4-(amiga_per_section(section)->disk_size & 3)) & 3;
+  n[1] = disksize;
+
+  /* in a load file, we put section attributes only in the header */
+  if (!(AMIGA_DATA(abfd)->IsLoadFile))
+    {
+      /* Get attribute for section */
+      switch (amiga_per_section(section)->attribute)
+	{
+	case MEMF_CHIP:
+	  n[1] |= HUNKF_CHIP;
+	  break;
+	case MEMF_FAST:
+	  n[1] |= HUNKF_FAST;
+	  break;
+	case 0:
+	  break;
+	default: /* error , can't represent this */
+	  bfd_set_error(bfd_error_nonrepresentable_section);
+	  return(false);
+	  break;
+	}
+    }/* Of switch */
+
+  if (!write_longs (n, 2, abfd))
+      return false;
+
+  DPRINT(5,("Wrote code and size=%lx\n",n[1]));
+
+  /* If a BSS hunk, we're done, else write out section contents */
+  if (HUNK_VALUE(n[0]) == HUNK_BSS)
+    return true;
+
+  DPRINT(5,("Non bss hunk...\n"));
+
+  /* Traverse through the relocs, sample them in reloc_data, adjust section
+     data to get 0 addend
+     Then compactify reloc_data
+     Set the entry in the section for the reloc to NULL */
+
+  if (disksize != 0)
+    BFD_ASSERT((section->flags & SEC_IN_MEMORY) != 0);
+
+  reloc_counts  = (long*) bfd_alloc (abfd, NB_RELOC_TYPES * (max_hunk+1)
+				     * sizeof (long));
+  if (!reloc_counts)
+    return false;
+  bzero (reloc_counts, NB_RELOC_TYPES*(max_hunk+1)*sizeof (long));
+
+  DPRINT(5,("Section has %d relocs\n", section->reloc_count));
+
+  for (i = 0; i < section->reloc_count; i++)
+    {
+      r = section->orelocation[i];
+      if (r == NULL)
+        continue;
+      sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+      insection = sym_p->section;
+      DPRINT(5,("Sec for reloc is %lx(%s)\n",insection,insection->name));
+      DPRINT(5,("Symbol for this reloc is %lx(%s)\n",sym_p, sym_p->name));
+
+      /* Is reloc relative to a special section ? */
+      if ((insection == bfd_abs_section_ptr) ||
+	  (insection == bfd_com_section_ptr) ||
+	  (insection == bfd_und_section_ptr) ||
+	  (insection == bfd_ind_section_ptr))
+	continue; /* Nothing to do, since this translates to HUNK_EXT */
+
+      r->addend += sym_p->value; /* Add offset of symbol from section start */
+
+      /* Address of reloc has been unchanged since original reloc, or has been
+	 adjusted by get_relocated_section_contents. */
+      /* For relocs, the vma of the target section is in the data, the
+	 addend is -vma of that section =>No need to add vma*/
+      /* Add in offset */
+      r->addend += insection->output_offset;
+      osection = insection->output_section; /* target section */
+
+      /* Determine which hunk to write, and index of target */
+      j = index_map[osection->index];
+
+      if (j<0 || j>max_hunk) {
+	fprintf (stderr, "erroneous relocation to hunk %d\n", j);
+	BFD_FAIL ();
+      }
+
+      type = determine_type(r);
+      if (type == -1)
+	return false;
+      size = determine_size(type);
+
+      if (type < NB_RELOC_TYPES)
+	reloc_counts[type+(j*NB_RELOC_TYPES)]++;
+      else {
+	bfd_set_error (bfd_error_nonrepresentable_section);
+	return false;
+      }
+
+      c_p = ((char *)(section->contents)) + r->address;
+      DPRINT(5,("reloc address=%lx,addend=%lx\n",r->address,r->addend));
+
+      /* There is no error checking with these.. */
+      values = (unsigned char *)c_p;
+      switch (size)
+	{
+	case 0: /* adjust byte */
+	  j = (int)(*c_p) + r->addend;
+	  *c_p = (signed char)j;
+	  break;
+	case 1: /* Adjust word */
+	  k = values[1] | (values[0] << 8);
+	  j = (int)k + r->addend;
+	  values[0] = (j & 0xff00) >> 8;
+	  values[1] = j & 0xff;
+	  break;
+	case 2: /* adjust long */
+	  k = values[3] | (values[2] << 8) | (values[1] << 16) |
+	    (values[0] << 24);
+	  j = (int)k + r->addend;
+	  values[3] = j & 0xff;
+	  values[2] = (j & 0xff00) >> 8;
+	  values[1] = (j & 0xff0000) >> 16;
+	  values[0] = ((unsigned int)j & 0xff000000) >> 24;
+	  break;
+	} /* of switch */
+
+      r->addend = 0;
+      DPRINT(5,("Did adjusting\n"));
+
+      if (type < MAX_RELOC_OUT)
+        reloc_count++;
+      else
+        section->orelocation[i] = NULL;
+    } /* of for i */
+
+  DPRINT(5,("Did all relocs\n"));
+
+  /* We applied all the relocs, as far as possible to obtain 0 addend fields */
+  /* Write the section contents */
+  if (amiga_per_section(section)->disk_size != 0)
+    {
+      if (bfd_write((PTR)(section->contents), sizeof(char),
+		    amiga_per_section(section)->disk_size, abfd) !=
+	  amiga_per_section(section)->disk_size)
+	return false;
+    }
+
+  /* pad the section on disk if necessary (to a long boundary) */
+  if (pad!=0 && (bfd_write (zero, 1, pad, abfd) != pad))
+    return false;
+
+#if 0
+  /* write bss data in the data hunk if needed */
+  i = 0;
+  while (bss_size--)
+    if (!write_longs((PTR)&i, 1, abfd))
+      return false;
+#endif
+
+  if (datadata_relocs)
+    {
+      datadata_relocs--;
+      if (!write_longs (&datadata_relocs, 1, abfd))
+        return false;
+      for (i = 0; i < data_sec->reloc_count; i++)
+        {
+          r = data_sec->orelocation[i];
+          if (r == NULL)
+            continue;
+          sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+          insection = sym_p->section;
+
+          /* Is reloc relative to a special section ? */
+          if ((insection == bfd_abs_section_ptr) ||
+	      (insection == bfd_com_section_ptr) ||
+              (insection == bfd_und_section_ptr) ||
+	      (insection == bfd_ind_section_ptr))
+            continue; /* Nothing to do, since this translates to HUNK_EXT */
+
+	  if (insection->output_section == data_sec)
+	    {
+	      if (determine_type(r) == 0)
+		if (!write_longs ((PTR)&r->address, 1, abfd))
+		  return false;
+	    }
+	}
+    }
+  DPRINT(10,("Wrote contents, writing relocs now\n"));
+
+
+  if (reloc_count) {
+    while (reloc_count) {
+      /* Sample every reloc type */
+      for (i = 0; i < NB_RELOC_TYPES; i++) {
+	int written = false;
+	for (j = 0; j <= max_hunk; j++) {
+	  long relocs;
+	  while ((relocs = reloc_counts [i+(j*NB_RELOC_TYPES)]) > 0) {
+	    if (!written)
+	      if (!write_longs(&reloc_types[i], 1, abfd))
+		return false;
+	      else
+		written = true;
+
+	    if (relocs > 0xffff)
+	      relocs = 0xffff;
+
+	    reloc_counts [i+(j*NB_RELOC_TYPES)] -= relocs;
+	    n[0] = relocs;
+	    n[1] = j;
+	    if (!write_longs(n, 2, abfd))
+	      return false;
+	    reloc_count -= relocs;
+
+	    for (k = 0; k < section->reloc_count; k++) {
+	      int jj;
+
+	      r = section->orelocation[k];
+	      if (r == NULL)	/* already written */
+		continue;
+	      sym_p = *(r->sym_ptr_ptr); /* The symbol for this section */
+	      insection = sym_p->section;
+	      /* Is reloc relative to a special section ? */
+	      if ((insection == bfd_abs_section_ptr) ||
+		  (insection == bfd_com_section_ptr) ||
+		  (insection == bfd_und_section_ptr) ||
+		  (insection == bfd_ind_section_ptr))
+		/* Nothing to do, since this translates to HUNK_EXT */
+		continue;
+
+	      osection = insection->output_section; /* target section */
+
+#if 0
+	      /* Determine which hunk to write, and index of target */
+	      for (jj = 0, sec = abfd->sections; sec != NULL;
+		   sec = sec->next, jj++) {
+		if (sec == osection)
+		  break;
+	      }
+
+	      BFD_ASSERT (jj==index_map[insection->output_section->index]);
+#else
+	      jj=index_map[insection->output_section->index];
+#endif
+	      if (jj == j && i == determine_type(r)) {
+		section->orelocation[k] = NULL;
+		if (!write_longs((PTR)&r->address, 1, abfd))
+		  return false;
+		if (--relocs == 0)
+		  break;
+	      }
+	    }
+	  }
+	}
+      }
+    }
+    /* write a zero to finish the relocs */
+    if (!write_longs((PTR)&reloc_count, 1, abfd))
+      return false;
+  }
+  bfd_release (abfd, reloc_counts);
+  DPRINT(5,("Leaving write_section...\n"));
+  return true;
+}
+
+
+/* Write out symbol information, including HUNK_EXT, DEFS, ABS. 
+   In the case, we were linking base relative, the symbols of the .bss
+   hunk have been converted already to belong to the .data hunk */
+
+static boolean
+amiga_write_symbols (abfd, section)
+     bfd *abfd;
+     asection *section;
+{
+
+  int i,j;
+  struct reloc_cache_entry *r;
+  asection *osection;
+  asymbol *sym_p;
+  char b[3]="\0\0\0";
+  unsigned long n[3];
+  int symbol_count;
+  unsigned long symbol_header;
+  unsigned long type, tmp;
+  int len;
+
+  /* If base rel linking and section is .bss ==> exit */
+  if (amiga_base_relative && (strcmp(section->name,".bss")==0))
+    return true;
+
+  if (section->reloc_count==0 && abfd->symcount==0)
+    {/* Write HUNK_END */
+    alldone:
+      DPRINT(5,("Leaving write_symbols\n"));
+      n[0]=HUNK_END;
+      return write_longs ((PTR)n, 1, abfd);
+    }
+
+  symbol_count=0;
+  symbol_header=HUNK_EXT;
+
+  /* If this is Loadfile, then do not write HUNK_EXT, but rather HUNK_SYMB*/
+
+ /* Write out all the symbol definitions, then HUNK_END 
+
+     Now, first traverse the relocs, all entries that are non NULL
+     have to be taken into account */
+  /* Determine the type of HUNK_EXT to issue and build a single
+     HUNK_EXT subtype */
+
+
+  /*FIXME: We write out many HUNK_EXT's entries for references to the
+    same symbol.. */
+  for (i=0;i<section->reloc_count;i++)
+    {
+      r=section->orelocation[i];
+
+      if (r==NULL) /* Empty entry */
+	continue;
+
+      sym_p=*(r->sym_ptr_ptr); /* The symbol for this section */
+      osection=sym_p->section; /* The section the symbol belongs to */
+      /* this section MUST be a special section */
+
+      DPRINT(5,("Symbol is %s, section is %lx(%s)\n",sym_p->name,osection,osection->name));
+
+      if (osection!=bfd_com_section_ptr) /* Not common symbol */
+	{
+	  DPRINT(5,("Non common ref\n"));
+	  /* Add a reference to this HUNK */
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      tmp=HUNK_EXT;
+	      if (!write_longs(&tmp, 1, abfd))
+		return false;
+	    }
+
+	  /* Determine type of ref */
+	  switch(r->howto->type)
+	    {
+	      /* AMIGA specific */
+	    case 0:
+	    case HUNK_RELOC8:
+	      type=EXT_REF8;
+	      break;
+
+	    case 1:
+	    case HUNK_RELOC16:
+	      type=EXT_REF16;
+	      break;
+
+	    case 2:
+	    case HUNK_RELOC32:
+	      type=EXT_REF32;
+	      break;
+	    case HUNK_DREL8:
+	      type=EXT_DEXT8;
+	      break;
+
+	    case 9:
+	    case HUNK_DREL16:
+	      type=EXT_DEXT16;
+	      break;
+
+	    case 10:
+	    case HUNK_DREL32:
+	        type=EXT_DEXT32;
+	      break;
+	      
+	      /* FIXME: There are other (pc relative) displacements left */
+	    default: /* Error, can't represent this */
+	      bfd_set_error(bfd_error_nonrepresentable_section);
+	      return false;
+	      break;
+	    }/* Of switch */
+	  DPRINT(5,("Type is %x\n",type));
+
+	  if (!write_name (abfd, sym_p->name, type << 24))
+	    return false;
+	  n[0]=1; /* 1 ref at address... */
+	  n[1]=r->address;
+	  if (!write_longs (n, 2, abfd))
+	    return false;
+
+	  continue; /* Next relocation */
+	}/* Of is ref to undefined or abs symbol */
+
+      else /* ref to common symbol */
+	{
+	  DPRINT(5,("Common ref\n"));
+
+	  /* If the reference is NOT 32 bit wide absolute , then issue warning */
+	  if ((r->howto->type!=2)&&(r->howto->type!=HUNK_RELOC32))
+	    fprintf(stderr,"Warning: Non 32 bit wide reference to common symbol %s\n",
+		    sym_p->name);
+
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      tmp=HUNK_EXT;
+	      if (!write_longs (&tmp, 1, abfd))
+		return false;
+	    }
+
+	  if (!write_name (abfd, sym_p->name, EXT_COMMON<<24))
+	    return false;
+	  n[0]=sym_p->value; /* Size of common block */
+	  n[1]=1;
+	  n[2]=r->address;
+	  if (!write_longs (n, 3, abfd))
+	    return false;
+
+	  continue;
+	}/* Of is common section */
+
+      DPRINT(10,("Failing...\n"));
+      BFD_FAIL();
+    }/* Of traverse relocs */
+      
+	  
+  /* Now traverse the symbol table and write out all definitions, that are relative
+     to this hunk */
+  /* Absolute defs are always only written out with the first hunk */
+  /* Don't write out local symbols
+                     undefined symbols
+		     indirect symbols
+		     warning symbols
+		     debugging symbols
+		     warning symbols
+		     constructor symbols, since they are unrepresentable in HUNK format..*/
+
+  DPRINT(10,("Traversing symbol table\n"));
+  symbol_header=(AMIGA_DATA(abfd)->IsLoadFile)?HUNK_SYMBOL:HUNK_EXT;
+  for (i=0;i<abfd->symcount;i++)
+    {
+      sym_p=abfd->outsymbols[i];
+      osection=sym_p->section;
+
+      DPRINT(5,("%d. symbol(%s), osec=%x(%s)\n",i,sym_p->name,osection,osection->name));
+
+      if ((osection==bfd_und_section_ptr)/*||(osection==bfd_com_section_ptr)*/||
+	  (osection==bfd_ind_section_ptr))
+	continue; /* Don't write these */
+
+      /* Only write abs defs, if not writing A Loadfile */
+      if ((osection==bfd_abs_section_ptr)&&(section->index==0)&&
+	  !AMIGA_DATA(abfd)->IsLoadFile) /* Write out abs defs */
+	{
+	  DPRINT(5,("Abs symbol\n"));
+	  /* don't write debug symbols, they will be written in a
+             HUNK_DEBUG later on */
+	  if (sym_p->flags & BSF_DEBUGGING)
+	    continue;
+
+	  if ((symbol_count++)==0) /* First write out the HUNK_EXT */
+	    {
+	      if (!write_longs (&symbol_header, 1, abfd))
+		return false;
+	    }
+
+	  if (!write_name (abfd, sym_p->name, EXT_ABS << 24))
+	    return false;
+	  n[0]=sym_p->value;
+	  if (!write_longs (n, 1,abfd))
+	    return false;
+	  continue;
+	}/* Of abs def */
+      if (osection == NULL) /* Happens with constructor functions. FIXME */
+        continue;
+      if (osection==bfd_abs_section_ptr) /* Not first hunk. Already written */
+	continue;
+
+      /* If it is a warning symbol, or a constructor symbol or a
+	 debugging or a local symbol, don't write it */
+      if (sym_p->flags & (BSF_WARNING|BSF_CONSTRUCTOR|BSF_DEBUGGING|BSF_LOCAL))
+	continue;
+
+      if (!(sym_p->flags & BSF_GLOBAL))
+	continue;
+
+      /* Now, if osection==section, write it out */
+      if (osection->output_section==section)
+	{
+	  DPRINT(5,("Writing it out\n"));
+
+	  if ((symbol_count++)==0) /* First write out the header */
+	    {
+	      if (!write_longs (&symbol_header, 1, abfd))
+		return false;
+	    }
+	  type=((symbol_header==HUNK_EXT?EXT_DEF:0)<<24)&0xff000000;
+
+	  if (!write_name (abfd, sym_p->name, type))
+	    return false;
+	  n[0] = sym_p->value + sym_p->section->output_offset;
+	  if (!write_longs (n, 1, abfd))
+	    return false;
+	}
+      else
+	{
+	  /* write common definitions as bss common references */
+	  if (osection->output_section == bfd_com_section_ptr &&
+	      section->index == 2)
+	    {
+	      if ((symbol_count++)==0) /* First write out the header */
+		{
+		  if (!write_longs (&symbol_header, 1, abfd))
+		    return false;
+		}
+	      if (!write_name (abfd, sym_p->name, EXT_COMMON<<24))
+		return false;
+
+	      n[0]=sym_p->value;
+	      n[1]=0;
+	      if (!write_longs (n, 2, abfd))
+		return false;
+	    }
+	}
+    }/* Of for */
+
+  DPRINT(10,("Did traversing\n"));
+  if (symbol_count) /* terminate HUNK_EXT, HUNK_SYMBOL */
+    {
+      n[0]=0;
+      if (!write_longs (n, 1, abfd))
+	return false;
+    }
+  DPRINT(5,("Leaving\n"));
+  goto alldone; /* Write HUNK_END, return */
+}
+
+static boolean
+amiga_get_section_contents (abfd, section, location, offset, count)
+     bfd *abfd;
+     sec_ptr section;
+     PTR location;
+     file_ptr offset;
+     bfd_size_type count;
+{
+  long disk_size = amiga_per_section (section)->disk_size;
+
+  if (bfd_seek (abfd, section->filepos + offset, SEEK_SET))
+    return false;
+
+  if (offset+count > disk_size) {
+    /* the section's size on disk may be smaller than in memory
+       in this case, pad the contents */
+    if (bfd_read (location, 1, disk_size-offset, abfd) != disk_size-offset)
+      return false;
+    memset ((char *) location + disk_size - offset, 0, count-(disk_size-offset));
+  }
+  else {
+    if (bfd_read (location, 1, count, abfd) != disk_size-offset)
+      return false;
+  }
+  return true;
+}
+
+
+boolean
+amiga_new_section_hook (abfd, newsect)
+     bfd *abfd;
+     asection *newsect;
+{
+  newsect->used_by_bfd = (PTR) bfd_zalloc (abfd,
+					   sizeof (amiga_per_section_type));
+  newsect->alignment_power = 2;
+  amiga_per_section(newsect)->reloc_tail = NULL;
+  if (!strcmp (newsect->name, ".data_chip") || !strcmp (newsect->name,
+						       ".bss_chip"))
+      amiga_per_section(newsect)->attribute |= MEMF_CHIP;
+  return true;
+}
+
+static boolean
+amiga_slurp_symbol_table (abfd)
+     bfd *abfd;
+{
+  amiga_data_type *amiga_data=AMIGA_DATA(abfd);
+  asection *section;
+  struct amiga_raw_symbol *sp;
+  amiga_symbol_type *asp=NULL;
+  unsigned long *lp, l, buf[4];
+  unsigned long len, type;
+
+  if (amiga_data->symbols)
+    return true; /* already read */
+
+  if (abfd->symcount)
+    asp = (amiga_symbol_type*) bfd_alloc (abfd, sizeof (amiga_symbol_type) *
+					     abfd->symcount);
+  else
+    return true;
+
+  if (abfd->symcount!=0 && !asp) {
+    bfd_set_error (bfd_error_no_memory);
+    return false;
+  }
+
+  amiga_data->symbols = asp;
+
+  /* Symbols are associated with every section */
+  for (section=abfd->sections; section!=NULL; section=section->next)
+    {
+      if (amiga_per_section(section)->hunk_ext_pos == 0)
+	continue;
+
+      if (bfd_seek (abfd, amiga_per_section(section)->hunk_ext_pos, SEEK_SET))
+	return false;
+
+      amiga_per_section(section)->amiga_symbols = asp;
+
+      while (get_long (abfd, &l) && (l!=0))
+	{
+	  type = l>>24;	/* type of entry */
+	  len = (l & 0xffffff) << 2; /* namelength */
+
+	  /* read the name */
+	  if ((asp->symbol.name = bfd_alloc (abfd ,len+1))==NULL)
+	    {
+	      bfd_set_error (bfd_error_no_memory);
+	      return false;
+	    }
+	  if (bfd_read ((PTR)asp->symbol.name, 1, len, abfd) != len)
+	    return false;
+	  ((char*)asp->symbol.name)[len] = '\0';
+
+	  asp->symbol.the_bfd = abfd;
+	  asp->type = type;
+	  asp->symbol.flags = BSF_GLOBAL;
+	  asp->index = asp - amiga_data->symbols;
+
+	  switch(type) {
+	  case EXT_COMMON: /* Common reference/definition*/
+	    asp->symbol.section = bfd_com_section_ptr;
+	    asp->hunk_number = -3;
+	    /* size of common block -> symbol's value */
+	    if (!get_long (abfd, &l))
+	      return false;
+	    asp->symbol.value = l;
+	    /* skip refs */
+	    if (!(get_long (abfd, &l) && bfd_seek (abfd, l<<2, SEEK_CUR)==0))
+	      return false;
+	    break;
+	  case EXT_ABS: /* Absolute */
+	    asp->symbol.section = bfd_abs_section_ptr;
+	    asp->hunk_number = -1;
+	    goto rval;
+	    break;
+	  case EXT_DEF: /* Relative Definition */
+	  case EXT_SYMB: /* Same as EXT_DEF for load files */
+	    asp->symbol.section = section;
+	    asp->hunk_number = section->target_index;
+	  rval:
+	    /* read the value */
+	    if (get_long (abfd, &l))
+	      asp->symbol.value = l;
+	    else
+	      return false;
+	    break;
+
+	  default: /* References to an undefined symbol */
+	    asp->symbol.section = bfd_und_section_ptr;
+	    asp->hunk_number = -2; /* undefined */
+	    asp->symbol.flags = 0;
+	    /* skip refs */
+	    if (!(get_long (abfd, &l) && bfd_seek (abfd, l<<2, SEEK_CUR)==0))
+	      return false;
+	    break;
+	  }
+	  asp++;
+	}
+    }
+  return true;
+}
+
+
+/* Get size of symtab */
+long
+amiga_get_symtab_upper_bound (abfd)
+     bfd *abfd;
+{
+  if (!amiga_slurp_symbol_table (abfd))
+    return -1;
+   return (abfd->symcount+1) * (sizeof (amiga_symbol_type *));
+}
+
+long
+amiga_get_symtab (abfd, location)
+     bfd *abfd;
+     asymbol **location;
+{
+  amiga_symbol_type *symp;
+  int i=0;
+
+  if(!amiga_slurp_symbol_table(abfd))
+    return -1;
+
+  if (abfd->symcount)
+    {
+      for (symp = AMIGA_DATA(abfd)->symbols; i < bfd_get_symcount (abfd);
+	   i++, symp++)
+	*location++ = &symp->symbol;
+    }
+  return abfd->symcount;
+}
+
+asymbol *
+amiga_make_empty_symbol (abfd)
+     bfd *abfd;
+{
+  amiga_symbol_type *new =
+    (amiga_symbol_type *) bfd_zalloc (abfd, sizeof (amiga_symbol_type));
+  new->symbol.the_bfd = abfd;
+  return &new->symbol;
+}
+
+
+
+void
+amiga_get_symbol_info (ignore_abfd, symbol, ret)
+      bfd *ignore_abfd;
+      asymbol *symbol;
+      symbol_info *ret;
+{
+  bfd_symbol_info (symbol, ret);
+  if (symbol->name[0] == ' ')
+    ret->name = "* empty table entry ";
+  if (symbol->section==bfd_abs_section_ptr)
+    ret->type = (symbol->flags & BSF_LOCAL) ? 'a' : 'A';
+}
+
+
+
+void
+amiga_print_symbol (ignore_abfd, afile,  symbol, how)
+      bfd *ignore_abfd;
+      PTR afile;
+      asymbol *symbol;
+      bfd_print_symbol_type how;
+{
+  FILE *file = (FILE *)afile;
+  
+  switch (how) {
+  case bfd_print_symbol_name:
+    fprintf(file, "%s", symbol->name);
+    break;
+  case bfd_print_symbol_more:
+    fprintf(stderr,"%4x %2x %2x",
+	    (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff),0,
+	    amiga_symbol(symbol)->type);
+    break;
+  case bfd_print_symbol_all:
+      {
+	CONST char *section_name = symbol->section->name;
+	if (symbol->name[0] == ' ')
+	  {
+	    fprintf(file, "* empty table entry ");
+	  }
+	else
+	  {
+	    bfd_print_symbol_vandf ((PTR)file, symbol);
+
+	    fprintf(file," %-5s %04x %02x %s",
+		    section_name,
+		    (unsigned int)((amiga_symbol(symbol)->hunk_number)&0xffff),
+		    (unsigned) 0,                       /* ->other */
+		    symbol->name);                      /* ->name */
+	}
+      }
+    break;
+  }
+}
+
+ long
+amiga_get_reloc_upper_bound (abfd, asect)
+     bfd *abfd;
+     sec_ptr asect;
+{
+  if (bfd_get_format (abfd) != bfd_object)
+    {
+      bfd_set_error(bfd_error_invalid_operation);
+      return 0;
+    }
+  return sizeof (arelent *) * (asect->reloc_count + 1);
+}
+
+
+static boolean
+read_raw_relocs (abfd, section, d_offset, count)
+    bfd *abfd;
+    sec_ptr section;
+    unsigned long d_offset;	/* offset in the bfd */
+    unsigned long count;	/* number of relocs */
+{
+  unsigned long type, no ,offset, hunk_number, j;
+  int index,br;
+
+  if (bfd_seek (abfd, d_offset, SEEK_SET))
+    return false;
+  while (count > 0) 
+    {
+      /* first determine type of reloc */
+      if (!get_long (abfd, &type))
+	return false;
+
+      switch (type)
+	{
+	case HUNK_RELOC32: /* 32 bit ref */
+	case HUNK_RELOC16: /* 16 bit ref */
+	case HUNK_RELOC8: /* 8 bit ref */
+	case HUNK_DREL32: /* 32 bit ref baserel */
+	case HUNK_DREL16: /* 16 bit baserel */
+	case HUNK_DREL8: /* 8 bit baserel */
+	  if (type < HUNK_DREL32)
+	    { /*0:8bit, 1: 16bit, 2:32bit */
+	      index=2-(type-HUNK_RELOC32);
+	      br=0; /* not base relative */
+	    }
+	  else
+	    {
+	      index=2-(type-HUNK_DREL32);
+	      br=1; /* base relative */
+	    }
+
+	  if (!get_long (abfd, &no))
+	    return false;
+	  while (no) /* read offsets and hunk number */
+	    {
+	      if (!get_long (abfd, &hunk_number))
+		return false;
+	      for (j=0; j<no; j++)
+		{ /* add relocs */
+		  if (!get_long (abfd, &offset) ||
+		      !amiga_add_reloc (abfd, section, offset, NULL,
+				       amiga_howto_array[br][index],hunk_number))
+		    return false;
+		}
+	      count -= no;
+	      if (!get_long (abfd, &no))
+		return false;
+	    }
+	  break;
+
+	default: /* error */
+	  bfd_set_error (bfd_error_wrong_format);
+	  return false;
+	  break;
+	}
+    }
+
+}
+
+
+/* slurp in relocs , amiga_digest_file left various pointers for us*/
+static boolean 
+amiga_slurp_relocs (abfd, section, symbols)
+     bfd *abfd;
+     sec_ptr section;
+     asymbol **symbols;
+{
+  amiga_data_type *amiga_data=AMIGA_DATA(abfd);
+  struct amiga_raw_symbol *sp;
+  amiga_symbol_type *asp;
+  long *lp;
+  unsigned long type, offset, hunk_number, no;
+  int i,n,br,j;
+  int index;
+  long count;
+  amiga_per_section_type *asect = amiga_per_section(section);
+
+  if (section->relocation)
+    return true;
+
+  if (asect->raw_relocs8)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs8,
+			  asect->num_raw_relocs8))
+      return false;
+
+  if (asect->raw_relocs16)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs16,
+			  asect->num_raw_relocs16))
+      return false;
+
+  if (asect->raw_relocs32)
+    if (!read_raw_relocs (abfd, section, asect->raw_relocs32,
+			  asect->num_raw_relocs32))
+      return false;
+
+  /* Now step through the raw_symbols and add all relocs in them */
+  if (!amiga_data->symbols && !amiga_slurp_symbol_table (abfd))
+    return false;
+
+  if (amiga_per_section(section)->hunk_ext_pos == 0)
+    return true;
+
+  if (bfd_seek (abfd, amiga_per_section(section)->hunk_ext_pos, SEEK_SET))
+    return false;
+
+  asp = amiga_per_section(section)->amiga_symbols;
+  while (get_long (abfd, &n) && n!=0)
+    {
+      type = (n>>24) & 0xff;
+      n &= 0xffffff;
+
+      /* skip the name */
+      if (bfd_seek (abfd, n<<2, SEEK_CUR))
+	return false;
+
+      switch (type)
+	{
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS: /* no relocs here */
+	  if (bfd_seek (abfd, sizeof (long), SEEK_CUR))
+	    return false;
+	  break;
+	  /* same as below, but advance lp by one to skip common size */
+	case EXT_COMMON:
+	  if (bfd_seek (abfd, sizeof (long), SEEK_CUR))
+	    return false;
+	  /* Fall through */
+	default: /* reference to something */
+	  /* points to num of refs to hunk */
+	  if (!get_long (abfd, &n))
+	    return false;
+
+	  /* Add relocs to this section, relative to asp */
+	  /* determine howto first */
+	  if (type==EXT_COMMON) /* 32 bit ref */
+	    {
+	      index=2;
+	      br=0;
+	    }
+	  else
+	    {
+	      if (type>EXT_REF32)
+		type--; /* skip EXT_COMMON gap */
+		     
+	      type-=EXT_REF32;
+	      br=0;
+
+	      if (type>2) /* base relative */
+		{
+		  type-=3;
+		  br=1;
+		}
+	      index=2-type;
+	    }/* of else */
+
+	  for (i=0;i<n;i++) /* refs follow */
+	    {
+	      if (!get_long (abfd, &offset))
+		return false;
+	      if (!amiga_add_reloc (abfd, section, offset, abfd->outsymbols ?
+				    (amiga_symbol_type*)abfd->outsymbols[asp->index]: asp,
+				    amiga_howto_array[br][index],-4))
+		return false;
+	    }
+	      
+	  break;
+	}/* of switch */
+      asp++;
+    }
+
+  return true;
+
+}/* Of slurp_relocs */
+
+
+long
+amiga_canonicalize_reloc (abfd, section, relptr, symbols)
+     bfd *abfd;
+     sec_ptr section;
+     arelent **relptr;
+     asymbol **symbols;
+{
+  amiga_reloc_type *src;
+  int i=0;
+
+  if (!section->relocation && !amiga_slurp_relocs (abfd, section, symbols))
+    return -1;
+
+  src = (amiga_reloc_type *)section->relocation;
+  while (src != (amiga_reloc_type *) 0)
+    {
+      *relptr++ = &src->relent;
+      src = src->next;
+    }
+  *relptr = (arelent *) 0;
+
+  return section->reloc_count;
+}
+
+
+/* Set section contents */
+/* We do it the following way: 
+   if this is a bss section ==> error
+   otherwise, we try to allocate space for this section,
+   if  this has not already been done
+   Then we set the memory area to the contents */
+static boolean
+amiga_set_section_contents (abfd, section, location, offset, count)
+     bfd *abfd;
+     sec_ptr section;
+     unsigned char *location;
+     file_ptr offset;
+     int count;
+{
+  unsigned char *contents;
+
+  if ((section->flags&SEC_HAS_CONTENTS)==0) /* BSS */
+    {
+      bfd_set_error(bfd_error_invalid_operation);
+      return false;
+    }
+  
+  if ((section->flags&SEC_IN_MEMORY)==0) /* Not in memory, so alloc space */
+    {
+      contents=bfd_zalloc(abfd,section->_raw_size);
+      if (!contents)
+	{
+	  bfd_set_error(bfd_error_no_memory);
+	  return false;
+	}
+      
+      DPRINT(5,("Allocated %lx bytes at %lx\n",section->_raw_size,contents));
+
+      section->contents=contents;
+      section->flags|=SEC_IN_MEMORY;
+    }
+  else /* In memory */
+    contents=section->contents;
+
+  /* Copy mem */
+  memmove(contents+offset,location,count);
+
+  return(true);
+
+}/* Of section_set_contents */
+
+
+/* FIXME: Is this everything ? */
+static boolean
+amiga_set_arch_mach (abfd, arch, machine)
+     bfd *abfd;
+     enum bfd_architecture arch;
+     unsigned long machine;
+{
+  bfd_default_set_arch_mach(abfd, arch, machine);
+
+  if (arch == bfd_arch_m68k)
+    {
+      switch (machine)
+	{
+	case 68000:
+	case 68008:
+	case 68010:
+	case 68020:
+	case 68030:
+	case 68040:
+	case 68070:
+	case 0:
+	  return true;
+	default:
+	  return false;
+	}
+    }
+  else if (arch == bfd_arch_powerpc)
+    {
+      return true;
+    }
+  return false;
+}
+
+static int
+DEFUN(amiga_sizeof_headers,(ignore_abfd, ignore),
+      bfd *ignore_abfd AND
+      boolean ignore)
+{
+  /* The amiga hunk format doesn't have headers.*/
+  return 0;
+}
+
+/* Provided a BFD, a section and an offset into the section, calculate
+   and return the name of the source file and the line nearest to the
+   wanted location.  */
+boolean
+amiga_find_nearest_line(abfd, section, symbols, offset, filename_ptr,
+			functionname_ptr, line_ptr)
+     bfd *abfd;
+     asection *section;
+     asymbol **symbols;
+     bfd_vma offset;
+     char **filename_ptr;
+     char **functionname_ptr;
+     int *line_ptr;
+{
+  /* FIXME (see aoutx.h, for example) */
+  return false;
+}
+
+static const struct reloc_howto_struct *
+amiga_bfd_reloc_type_lookup (abfd, code)
+       bfd *abfd;
+       bfd_reloc_code_real_type code;
+{
+  switch (code)
+    {
+    case BFD_RELOC_8_PCREL:  return &howto_hunk_reloc8;
+    case BFD_RELOC_16_PCREL: return &howto_hunk_reloc16;
+    case BFD_RELOC_CTOR:
+    case BFD_RELOC_32_PCREL: return &howto_hunk_reloc32;
+    case BFD_RELOC_8:        return &howto_hunk_reloc8;
+    case BFD_RELOC_16:       return &howto_hunk_reloc16;
+    case BFD_RELOC_32:       return &howto_hunk_reloc32;
+      /* FIXME: Add more cases here for base relative relocs*/
+    default:                 return 0;
+    }
+}
+
+static boolean
+amiga_bfd_copy_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  AMIGA_DATA(obfd)->IsLoadFile = AMIGA_DATA(ibfd)->IsLoadFile;
+  return true;
+}
+
+static boolean
+amiga_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
+     bfd *ibfd;
+     asection *isec;
+     bfd *obfd;
+     asection *osec;
+{
+  if (bfd_get_flavour (osec->owner) == bfd_target_amiga_flavour) {
+    amiga_per_section (osec)->disk_size = amiga_per_section (isec)->disk_size;
+    amiga_per_section (osec)->attribute = amiga_per_section (isec)->attribute;
+  }
+  return true;
+}
+
+/* There is no armap in the amiga libraries, so we fill carsym entries
+   one by one after having parsed the whole archive. */
+static boolean
+amiga_slurp_armap (abfd)
+     bfd *abfd;
+{
+  unsigned long type, n, slen;
+  struct arch_syms *syms;
+  unsigned long symcount=0;
+  carsym *defsyms, *csym;
+  unsigned long *symblock,len;
+
+  /* allocate the carsyms */
+  syms = amiga_ardata(abfd)->defsyms;
+  symcount = amiga_ardata(abfd)->defsym_count;
+
+  defsyms = (carsym*) bfd_alloc (abfd, sizeof (carsym) * symcount);
+  if (!defsyms)
+    return false;
+
+  bfd_ardata(abfd)->symdefs = defsyms;
+  bfd_ardata(abfd)->symdef_count = symcount;
+
+  csym = defsyms;
+  while (syms) {
+    if (bfd_seek (abfd, syms->offset, SEEK_SET))
+      return false;
+    symblock = (unsigned long*) bfd_alloc (abfd, syms->size);
+    if (!symblock)
+      return false;
+    if (bfd_read (symblock, 1, syms->size, abfd) != syms->size)
+      return false;
+    while ((n=GL(symblock)) != 0)
+      {
+	symblock++;
+	len = n & 0xffffff;
+	type = (n>>24) & 0xff;
+	switch (type) {
+	case EXT_SYMB:
+	case EXT_DEF:
+	case EXT_ABS:
+	  slen = len<<2;
+	  csym->name = (char*)symblock;
+	  if (*((char*)symblock+slen-1) != '\0')
+	    *((char*)symblock+slen) = '\0';
+	  csym->file_offset = syms->unit_offset;
+	  csym++;
+	  symblock += len+1;	/* name+value */
+	  break;
+	case EXT_REF8:
+	case EXT_REF16:
+	case EXT_REF32:
+	case EXT_DEXT8:
+	case EXT_DEXT16:
+	case EXT_DEXT32:
+	  symblock += len;
+	  symblock += 1+GL(symblock);
+	  break;
+	case EXT_COMMON:
+	  symblock += len+1;
+	  symblock += 1+GL(symblock);
+	  break;
+	default: /* error */
+	  fprintf (stderr, "unexpected type in hunk_ext\n");
+	  return false;
+	}
+      }
+    syms = syms->next;
+  }
+  bfd_has_map (abfd) = true;
+  return true;
+}
+
+static void amiga_truncate_arname ()
+{
+}
+
+static const struct bfd_target *
+amiga_archive_p (abfd)
+     bfd *abfd;
+{
+  long header;
+  struct stat stat_buffer;
+  int units;
+  symindex symcount = 0;
+  struct arch_syms *symbols = NULL;
+
+  bfd_set_error (bfd_error_wrong_format);
+
+  if (bfd_stat (abfd, &stat_buffer) < 0)
+    return false;
+
+  if (stat_buffer.st_size != 0)
+    {
+      /* scan the units */
+      if (!parse_archive_units (abfd, &units, stat_buffer.st_size, false,
+				&symbols, &symcount))
+	return NULL;
+
+      /* if there is only one unit, we consider it's an object, not an
+	 archive. Obviously it's not always true but taking objects
+	 for archives makes ld fail, so we don't have much of a choice */
+      if (units == 1)
+	return NULL;
+
+    }
+
+  if (abfd->arelt_data)
+    arelt_size (abfd) = bfd_tell (abfd);
+
+  bfd_seek (abfd, 0, SEEK_SET);
+  abfd->arch_info = bfd_scan_arch ("m68k:68000");
+
+  if (amiga_mkarchive (abfd))
+    {
+      amiga_ardata(abfd)->filesize = stat_buffer.st_size;
+      bfd_ardata(abfd)->first_file_filepos = 0;
+      amiga_ardata(abfd)->defsym_count = symcount;
+      amiga_ardata(abfd)->defsyms = symbols;
+      if (amiga_slurp_armap (abfd))
+	return abfd->xvec;
+      else
+	return NULL;
+    }
+    else
+      return NULL;
+}
+
+static bfd *
+amiga_openr_next_archived_file (archive, last_file)
+     bfd *archive;
+     bfd *last_file;
+{
+  file_ptr filestart;
+
+  if (!last_file)
+    filestart = bfd_ardata(archive)->first_file_filepos;
+  else
+    {
+      unsigned int size = arelt_size (last_file);
+      /* Pad to an even boundary... */
+      filestart = last_file->origin + size;
+      filestart += filestart % 2;
+    }
+
+  return _bfd_get_elt_at_filepos (archive, filestart);
+}
+
+static PTR
+amiga_read_ar_hdr (abfd)
+   bfd *abfd;
+{
+  struct areltdata *ared;
+  char *filename = NULL;
+  unsigned long header, read, len, start_pos;
+
+  start_pos = bfd_tell (abfd);
+
+  if (start_pos >= amiga_ardata(abfd)->filesize) {
+    bfd_set_error (bfd_error_no_more_archived_files);
+    return NULL;
+  }
+
+  if (bfd_read ((PTR) &header, 1, sizeof (header), abfd) != sizeof (header))
+      return NULL;
+
+  if (GL(&header) != HUNK_UNIT)
+    {
+      bfd_set_error (bfd_error_malformed_archive);
+      return NULL;
+    }
+
+  /* get the unit name length in long words */
+  if (!get_long (abfd, &len))
+    return NULL;
+  len = len << 2;
+
+  ared = bfd_zalloc (abfd, sizeof (struct areltdata));
+  if (ared == NULL) {
+    bfd_set_error (bfd_error_no_memory);
+    return NULL;
+  }
+
+  if (len)
+    {
+      if (!(ared->filename =  bfd_alloc (abfd, len+1)))
+	{
+	  bfd_set_error (bfd_error_no_memory);
+	  return NULL;
+	}
+      else
+	{
+	  if (bfd_read (ared->filename, 1, len, abfd) != len)
+	    return NULL;
+	  ared->filename[len] = '\0';
+	}
+    }
+  else
+    ared->filename = "(no name)";
+
+  if (bfd_seek (abfd, start_pos+4, SEEK_SET))
+    return false;
+
+  if (!amiga_read_unit (abfd, amiga_ardata(abfd)->filesize))
+    return NULL;
+
+  ared->parsed_size = bfd_tell(abfd)-start_pos;
+  if (bfd_seek (abfd, start_pos, SEEK_SET))
+    return false;
+  return (PTR) ared;
+}
+
+int
+amiga_generic_stat_arch_elt (abfd, buf)
+   bfd *abfd;
+   struct stat *buf;
+{
+  if (abfd->arelt_data == NULL)
+    {
+      bfd_set_error (bfd_error_invalid_operation);
+      return -1;
+    }
+
+  /* No header in amiga archives. Let's set reasonable default values */
+  buf->st_mtime = 0;
+  buf->st_uid = 0;
+  buf->st_gid = 0;
+  buf->st_mode = 0666;
+
+  buf->st_size = ((struct areltdata*)(abfd->arelt_data))->parsed_size;
+
+  return 0;
+}
+
+/* We don't have core files.  */
+#define	amiga_core_file_failing_command _bfd_dummy_core_file_failing_command
+#define	amiga_core_file_failing_signal _bfd_dummy_core_file_failing_signal
+#define	amiga_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p
+
+/* Entry points through BFD_JUMP_TABLE_ARCHIVE */
+/*#define	amiga_slurp_armap		bfd_slurp_amiga_armap*/
+#define	amiga_slurp_extended_name_table	_bfd_slurp_extended_name_table
+#define amiga_construct_extended_name_table _bfd_archive_bsd_construct_extended_name_table
+/*#define	amiga_truncate_arname		bfd_gnu_truncate_arname*/
+/*#define	amiga_write_armap		amiga_write_armap*/
+/*#define	amiga_read_ar_hdr		_bfd_generic_read_ar_hdr*/
+/*#define	amiga_openr_next_archived_file	bfd_generic_openr_next_archived_file*/
+
+#define amiga_get_elt_at_index		_bfd_generic_get_elt_at_index
+/* #define amiga_generic_stat_arch_elt	bfd_generic_stat_arch_elt */
+#define amiga_update_armap_timestamp	_bfd_archive_bsd_update_armap_timestamp
+
+/* Entry points through BFD_JUMP_TABLE_SYMBOLS */
+#undef amiga_get_symtab_upper_bound	/* defined above */
+#undef amiga_get_symtab			/* defined above */
+#undef amiga_make_empty_symbol		/* defined above */
+#undef amiga_print_symbol		/* defined above */
+#undef amiga_get_symbol_info		/* defined above */
+#define amiga_bfd_is_local_label	bfd_generic_is_local_label
+#define amiga_get_lineno		(struct lineno_cache_entry *(*)())bfd_nullvoidptr
+#undef amiga_find_nearest_line		/* defined above */
+#define amiga_bfd_make_debug_symbol	(asymbol * (*)(bfd *, void *, unsigned long)) bfd_nullvoidptr
+#define amiga_read_minisymbols		_bfd_generic_read_minisymbols
+#define amiga_minisymbol_to_symbol	_bfd_generic_minisymbol_to_symbol
+
+#define amiga_bfd_debug_info_start		bfd_void
+#define amiga_bfd_debug_info_end		bfd_void
+#define amiga_bfd_debug_info_accumulate	(PROTO(void,(*),(bfd*, struct sec *))) bfd_void
+#define amiga_bfd_is_local_label_name bfd_generic_is_local_label_name
+
+/* NOTE: We use a special get_relocated_section_contents both in amiga AND in a.out files.
+   In addition, we use an own final_link routine, which is nearly identical to _bfd_generic_final_link */
+extern bfd_byte *get_relocated_section_contents(bfd*, struct bfd_link_info *,
+						struct bfd_link_order *, bfd_byte *,
+						boolean, asymbol **);
+#define amiga_bfd_get_relocated_section_contents get_relocated_section_contents
+#define amiga_bfd_relax_section                   bfd_generic_relax_section
+
+#define amiga_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define amiga_bfd_link_add_symbols _bfd_generic_link_add_symbols
+extern boolean amiga_final_link(bfd *, struct bfd_link_info *);
+#define amiga_bfd_final_link amiga_final_link
+
+/* Entry points through BFD_JUMP_TABLE_GENERIC */
+#define amiga_close_and_cleanup         _bfd_generic_close_and_cleanup
+#define amiga_bfd_free_cached_info	_bfd_generic_bfd_free_cached_info
+/* amiga_new_section_hook defined above */
+/* amiga_get_section_hook defined above */
+#define amiga_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+
+/* Entry points through BFD_JUMP_TABLE_COPY */
+#define amiga_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+/*#define amiga_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data*/
+#define amiga_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define amiga_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define amiga_bfd_print_private_flags _bfd_generic_bfd_print_private_flags
+#define amiga_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
+
+#define amiga_bfd_link_split_section  _bfd_generic_link_split_section
+
+#if defined (amiga)
+/* So that the JUMP_TABLE() macro below can work.  */
+#undef amiga
+#endif
+
+const bfd_target amiga_vec =
+{
+  "amiga",		/* name */
+  bfd_target_amiga_flavour,
+  true,			/* data byte order is big */
+  true,			/* header byte order is big */
+  HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT, /* object flags */
+ /* section flags */
+  SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA,
+  '_',				/* symbol leading char */
+  ' ',				/* ar_pad_char */
+  15,				/* ar_max_namelen */	/* (15 for UNIX compatibility) */
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
+  bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+  bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32,
+  bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+  {
+    /* bfd_check_format */
+    _bfd_dummy_target,
+    amiga_object_p,
+    amiga_archive_p,
+    _bfd_dummy_target
+  },
+  {
+    /* bfd_set_format */
+    bfd_false,
+    amiga_mkobject,
+    amiga_mkarchive,
+    bfd_false
+  },
+  {
+    /* bfd_write_contents */
+    bfd_false,
+    amiga_write_object_contents,
+    amiga_write_archive_contents,
+    bfd_false
+  },
+  BFD_JUMP_TABLE_GENERIC (amiga),
+  BFD_JUMP_TABLE_COPY (amiga),
+  BFD_JUMP_TABLE_CORE (_bfd_nocore),
+  BFD_JUMP_TABLE_ARCHIVE (amiga),
+  BFD_JUMP_TABLE_SYMBOLS (amiga),
+  BFD_JUMP_TABLE_RELOCS (amiga),
+  BFD_JUMP_TABLE_WRITE (amiga),
+  BFD_JUMP_TABLE_LINK (amiga),
+  BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+  (PTR) 0
+#if 0
+/* fixme: no longer in use?  */
+  /* How applications can find out about amiga relocation types (see
+     documentation on reloc types).  */
+  amiga_reloc_type_lookup
+#endif
+};
diff --git a/bfd/amigaoslink.c b/bfd/amigaoslink.c
new file mode 100644
index 0000000..a386969
--- /dev/null
+++ binutils-2.9.1/bfd/amigaoslink.c
@@ -0,0 +1,1190 @@
+/* BFD back-end for Commodore-Amiga AmigaOS binaries. Linker routines.
+   Copyright (C) 1990-1994 Free Software Foundation, Inc.
+   Contributed by Stephan Thesing
+
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/*
+INODE
+amigalink, , implementation, amiga
+SECTION
+	amigalink
+
+This is the description of the linker routines for the amiga.
+In fact, this includes a description of the changes made to the
+a.out code, in order to build a working linker for the Amiga.
+@menu
+@* alterations::
+@end menu
+
+INODE 
+alterations, , , amigalink
+SUBSECTION
+	alterations
+
+The file @file{aout-amiga.c} defines the amiga a.out backend. It differs from
+the sun3 backend only in these details:
+	o The @code{final_link} routine is @code{amiga_final_link}.
+	o The routine to get the relocated section contents is
+           @code{aout_bfd_get_relocated_section_contents}.
+
+This ensures that the link is performed properly, but has the side effect of loosing
+performance.
+
+
+The amiga bfd code uses the same @code{amiga_final_link} routine, but with a 
+different <<get_relocated_section_contents>> entry: <<amiga_bfd_get_relocated_section_contents>>.
+The latter  differs from the routine of the a.out backend only in the application of relocs
+ to the section contents.
+@@*
+
+The usage of a special linker code has one reason:
+The bfd library assumes that a program is always loaded at a known memory
+address. This is not a case on an Amiga. So the Amiga format has to take over
+some relocs to an executable output file. 
+This is not the case with a.out formats, so there relocations can be applied at link time,
+not at run time, like on the Amiga.
+The special routines compensate this: instead of applying the relocations, they are
+copied to the output file, if neccessary.
+As as consequence, the @code{final_link} and @code{get_relocated_section_contents} are nearly identical to
+the original routines from @file{linker.c} and @file{reloc.c}.
+*/
+
+#include "bfd.h"
+#include "bfdlink.h"
+#include "sysdep.h"
+#include "genlink.h"
+#include "libbfd.h"
+
+#include "libamiga.h"
+#undef GET_SWORD
+#define aadata ((bfd)->tdata.amiga_data->a)
+#undef adata
+#include "libaout.h"
+
+
+#define max(x,y) (((x)<=(y))?(y):(x))
+
+#define DEBUG_AMIGA 10000
+
+#if DEBUG_AMIGA
+#include <stdarg.h>
+static void
+error_print(const char *fmt,...)
+{
+  va_list args;
+
+  va_start (args, fmt);
+  vfprintf (stderr, fmt, args);
+  va_end (args);
+}
+
+#define DPRINT(L,x) if (L>=DEBUG_AMIGA) error_print x
+#else
+#define DPRINT(L,x) 
+#endif
+
+/* This one is used by the linker and tells us, if a debug hunk should be
+   written out*/
+int write_debug_hunk = 0;
+
+/* This is also used by the linker to set the attribute of sections */
+int amiga_attribute = 0;
+
+/* This one is used to indicate base-relative linking */
+int amiga_base_relative=0;
+
+/* This one is used to indicate -resident linking */
+int amiga_resident=0;
+
+/* generate a pOS executable */
+int amiga_pOS_flg;
+
+extern boolean default_indirect_link_order
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+	   struct bfd_link_order *, boolean));
+
+
+
+bfd_byte *
+get_relocated_section_contents PARAMS((bfd *, struct bfd_link_info *,
+				       struct bfd_link_order *, bfd_byte *,
+				       boolean , asymbol **));
+static bfd_reloc_status_type
+amiga_perform_reloc PARAMS((bfd *, arelent *, PTR, asection *, bfd *, char **));
+static bfd_reloc_status_type 
+aout_perform_reloc PARAMS ((bfd *, arelent *, PTR, asection *, bfd *, char **));
+static boolean
+amiga_reloc_link_order PARAMS ((bfd *, struct bfd_link_info *,asection *,
+				struct bfd_link_order *));
+
+
+/* This one is nearly identical to bfd_generic_get_relocated_section_contents
+   from reloc.c */
+bfd_byte *
+get_relocated_section_contents (abfd, link_info, link_order, data,
+					    relocateable, symbols)
+     bfd *abfd;
+     struct bfd_link_info *link_info;
+     struct bfd_link_order *link_order;
+     bfd_byte *data;
+     boolean relocateable;
+     asymbol **symbols;
+{
+  bfd *input_bfd = link_order->u.indirect.section->owner;
+  asection *input_section = link_order->u.indirect.section;
+
+  long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
+  arelent **reloc_vector = NULL;
+  long reloc_count;
+  bfd_reloc_status_type (*reloc_func)(bfd *, arelent *, PTR, asection *,
+				      bfd *, char **);
+
+  DPRINT(5,("Entering get_rel_sec_cont\n"));
+
+  if (reloc_size < 0)
+    goto error_return;
+
+  if (input_bfd->xvec->flavour==bfd_target_amiga_flavour)
+    reloc_func=amiga_perform_reloc;
+  else if (input_bfd->xvec->flavour==bfd_target_aout_flavour)
+    reloc_func=aout_perform_reloc;
+  else
+    {
+      bfd_set_error(bfd_error_bad_value);
+      goto error_return;
+    }
+
+  reloc_vector = (arelent **) malloc (reloc_size);
+
+  if (reloc_vector == NULL && reloc_size != 0)
+    {
+      bfd_set_error (bfd_error_no_memory);
+      goto error_return;
+    }
+
+  DPRINT(5,("GRSC: GetSecCont()\n"));
+  /* read in the section */
+  if (!bfd_get_section_contents (input_bfd,
+				 input_section,
+				 (PTR) data,
+				 0,
+				 input_section->_raw_size))
+    goto error_return;
+
+  /* We're not relaxing the section, so just copy the size info */
+  input_section->_cooked_size = input_section->_raw_size;
+  input_section->reloc_done = true;
+
+  DPRINT(5,("GRSC: CanReloc\n"));
+  reloc_count = bfd_canonicalize_reloc (input_bfd,
+					input_section,
+					reloc_vector,
+					symbols);
+  if (reloc_count < 0)
+    goto error_return;
+
+  if (reloc_count > 0)
+    {
+      arelent **parent;
+
+      DPRINT(5,("reloc_count=%d\n",reloc_count));
+
+      for (parent = reloc_vector; *parent != (arelent *) NULL;
+	   parent++)
+	{
+	  char *error_message = (char *) NULL;
+	  bfd_reloc_status_type r ;
+
+	  DPRINT(5,("Applying a reloc\nparent=%lx, reloc_vector=%lx,"
+		    "*parent=%lx\n",parent,reloc_vector,*parent));
+	  r=(*reloc_func) (input_bfd,
+			   *parent,
+			   (PTR) data,
+			   input_section,
+			   relocateable ? abfd : (bfd *) NULL,
+			   &error_message);
+	  if (relocateable)
+	    {
+	      asection *os = input_section->output_section;
+
+	      DPRINT(5,("Keeping reloc\n"));
+	      /* A partial link, so keep the relocs */
+	      os->orelocation[os->reloc_count] = *parent;
+	      os->reloc_count++;
+	    }
+
+	  if (r != bfd_reloc_ok)
+	    {
+	      switch (r)
+		{
+		case bfd_reloc_undefined:
+		  if (!((*link_info->callbacks->undefined_symbol)
+			(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+			 input_bfd, input_section, (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_dangerous:
+		  BFD_ASSERT (error_message != (char *) NULL);
+		  if (!((*link_info->callbacks->reloc_dangerous)
+			(link_info, error_message, input_bfd, input_section,
+			 (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_overflow:
+		  if (!((*link_info->callbacks->reloc_overflow)
+			(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+			 (*parent)->howto->name, (*parent)->addend,
+			 input_bfd, input_section, (*parent)->address)))
+		    goto error_return;
+		  break;
+		case bfd_reloc_outofrange:
+		default:
+		  DPRINT(10,("get_rel_sec_cont fails, perform reloc "
+			     "returned $%x\n",r));
+		  abort ();
+		  break;
+		}
+
+	    }
+	}
+    }
+  if (reloc_vector != NULL)
+    free (reloc_vector);
+  DPRINT(5,("GRSC: Returning ok\n"));
+  return data;
+
+error_return:
+  DPRINT(5,("GRSC: Error_return\n"));
+  if (reloc_vector != NULL)
+    free (reloc_vector);
+  return NULL;
+}
+
+
+/* Add a value to a location */
+static bfd_reloc_status_type
+my_add_to (data, offset, size, add, sign)
+  PTR data;
+  int offset, size, add, sign;
+{
+  signed char *p;
+  int val;
+  bfd_reloc_status_type ret;
+
+  DPRINT(5,("Entering add_value\n"));
+
+  ret=bfd_reloc_ok;
+  p=((signed char*)data)+offset;
+
+  switch (size)
+    {
+    case 0: /* byte size */
+      val = (int)(p[0]) + add;
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x80 || val>0x7f)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffffff00)!=0 && (val&0xffffff00)!=0xffffff00)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[0]=val&0xff;
+      break;
+
+    case 1: /* word size */
+      val = (int)((p[1]&0xff)|(p[0]<<8)) + add;
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x8000 || val>0x7fff)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffff0000)!=0 && (val&0xffff0000)!=0xffff0000)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[1]=val&0xff;
+      p[0]=((val&0xff00)>>8)&0xff;
+      break;
+
+    case 2: /* long word */
+      val = bfd_getb_signed_32 (p) + add;
+      /* If we are linking a resident program, then we limit the reloc size
+         to about +/- 1 GB.
+         
+         When linking a shared library all variables defined in other
+         libraries are placed in memory >0x80000000, so if the library
+         tries to use one of those variables an error is output.
+         
+         Without this it would be much more difficult to check for
+         incorrect references.
+       */
+      if (amiga_resident &&
+          (val & 0xc0000000)!=0 && (val&0xc0000000)!=0xc0000000) /* Overflow */
+	{
+	  ret=bfd_reloc_overflow;
+	}
+      bfd_putb32 (val, p);
+      break;
+      
+    default: /* Error */
+      ret=bfd_reloc_notsupported;
+      break;
+    }/* Of switch */
+
+  DPRINT(5,("Leaving add_value\n"));
+  return (ret);
+}
+
+/* Set a value to a location */
+static bfd_reloc_status_type
+my_set_to (data, offset, size, val, sign)
+  PTR data;
+  int offset, size, val, sign;
+{
+  signed char *p;
+  bfd_reloc_status_type ret;
+
+  DPRINT(5,("Entering add_value\n"));
+
+  ret=bfd_reloc_ok;
+  p=((signed char*)data)+offset;
+
+  switch (size)
+    {
+    case 0: /* byte size */
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x80 || val>0x7f)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffffff00)!=0 && (val&0xffffff00)!=0xffffff00)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[0]=val&0xff;
+      break;
+
+    case 1: /* word size */
+      /* check for overflow */
+      if (sign) {
+	if (val<-0x8000 || val>0x7fff)
+	  ret = bfd_reloc_overflow;
+      }
+      else {
+	if ((val&0xffff0000)!=0 && (val&0xffff0000)!=0xffff0000)
+	  ret=bfd_reloc_overflow;
+      }
+      /* set the value */
+      p[1]=val&0xff;
+      p[0]=((val&0xff00)>>8)&0xff;
+      break;
+
+    case 2: /* long word */
+      /* If we are linking a resident program, then we limit the reloc size
+         to about +/- 1 GB.
+         
+         When linking a shared library all variables defined in other
+         libraries are placed in memory >0x80000000, so if the library
+         tries to use one of those variables an error is output.
+         
+         Without this it would be much more difficult to check for
+         incorrect references.
+       */
+      if (amiga_resident &&
+          (val & 0xc0000000)!=0 && (val&0xc0000000)!=0xc0000000) /* Overflow */
+	{
+	  ret=bfd_reloc_overflow;
+	}
+      p[3] = val & 0xff;
+      p[2] = (val >> 8) & 0xff;
+      p[1] = (val >> 16) & 0xff;
+      p[0] = (val >> 24) & 0xff;
+      break;
+      
+    default: /* Error */
+      ret=bfd_reloc_notsupported;
+      break;
+    }/* Of switch */
+
+  DPRINT(5,("Leaving set_value\n"));
+  return (ret);
+}
+
+/* Perform an Amiga relocation */
+static bfd_reloc_status_type 
+amiga_perform_reloc (abfd, r, data, sec, obfd, error_message)
+   bfd *abfd;
+   arelent *r;
+   PTR data;
+   asection *sec;
+   bfd *obfd;
+   char **error_message;
+{
+  asymbol *sym; /* Reloc is relative to sym */
+  asection *target_section; /* reloc is relative to this section */
+  int relocation;
+  boolean copy;
+  bfd_reloc_status_type ret;
+  int size = 2;
+  int sign = false;
+
+  DPRINT(5,("Entering APR\nflavour is %d (aflavour=%d, aout_flavour=%d)\n",
+	    sec->owner->xvec->flavour, bfd_target_amiga_flavour,
+	    bfd_target_aout_flavour));
+
+  /* If obfd==NULL: Apply the reloc, if possible. */
+  /* Else: Modify it and return */
+
+  if (obfd!=NULL) /* Only modify the reloc */
+    {
+      r->address+=sec->output_offset;
+      sec->output_section->flags|=SEC_RELOC;
+      DPRINT(5,("Leaving APR, modified case \n"));
+      return bfd_reloc_ok;
+    }
+
+  /* Try to apply the reloc */
+
+  sym=*(r->sym_ptr_ptr);
+
+#if 0
+  /* FIXME */
+   if (sym->udata.p)
+     sym = ((struct generic_link_hash_entry*)sym->udata.p)->sym;
+#endif
+
+  target_section=sym->section;
+
+  if (target_section==bfd_und_section_ptr) /* Error */
+    {
+      DPRINT(10,("perform_reloc: Target is undefined section\n"));
+      return bfd_reloc_undefined;
+    }
+  
+  relocation=0; copy=false; ret=bfd_reloc_ok;
+
+  switch(r->howto->type)
+    {
+    case HUNK_RELOC32: /* 32 bit reloc */
+      DPRINT(5,("RELOC32\n"));
+      size=2;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* ref to common */
+	{
+	  relocation=0;
+	  copy=true;
+	}
+      else
+	{
+	  /* If we access a symbol in the .bss section, we have to convert
+	     this to an access to .data section */
+	  /* This is done through a change to the symbol... */
+	  if (amiga_base_relative && (strcmp(sym->section->output_section->name,
+					     ".bss")==0))
+	    {
+	      /* get value for .data section */
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_offset=s->_raw_size;
+		    sym->section->output_section=s;
+		  }
+	    }
+
+	  relocation=0;
+	  copy=true;
+	}
+      break;
+
+    case HUNK_RELOC8:
+    case HUNK_RELOC16:
+      DPRINT(5,("RELOC16/8\n"));
+      size=(r->howto->type==HUNK_RELOC8)?0:1;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else {
+	if (target_section==bfd_com_section_ptr) /* Error.. */
+	  {
+	    relocation=0;
+	    copy=false;
+	    ret=bfd_reloc_undefined;
+	  }
+	else
+	  {
+	    DPRINT(5,("PC relative\n"));
+	    /* This is a pc relative hunk... */
+	    if (sec->output_section!=target_section->output_section) /* Error */
+	      {
+		DPRINT(10,("pc relative, but out of range I\n"));
+		relocation=0;
+		copy =false;
+		ret=bfd_reloc_outofrange;
+	      }
+	    else
+	      { /* Same section */
+		relocation=-(r->address+sec->output_offset);
+		copy=false;
+	      }
+	  }
+      }
+      break;
+      
+    case HUNK_DREL32: /* baserel relocs */
+    case HUNK_DREL16:
+    case HUNK_DREL8:
+      DPRINT(5,("HUNK_BASEREL relocs\n"));
+
+      /* Relocs are always relative to the symbol ___a4_init */
+      /* Relocs to .bss section are converted to a reloc to .data section, since
+	 .bss section contains only COMMON sections...... and should be
+	 following .data section.. */
+
+      size=(r->howto->type==HUNK_DREL32)?2:((r->howto->type==HUNK_DREL16)?1:0);
+      
+      if (target_section==bfd_abs_section_ptr)
+	{
+	  relocation=sym->value;
+	}
+      else 
+	{
+	  if (! (AMIGA_DATA (target_section->output_section->owner)->baserel))
+	    {
+	      fprintf(stderr,"Base symbol for base relative reloc not defined,"
+		      "section %s, reloc to symbol %s\n", sec->name, sym->name);
+	      copy=false;
+	      ret=bfd_reloc_notsupported;
+	      break;
+	    }
+
+	  /* If target->out is .bss, add the value of the .data section to sym->value and
+	     set output_section new to .data section.... */
+	  if (strcmp(target_section->output_section->name,".bss")==0)
+	    {
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_section=s;
+		    sym->section->output_offset=s->_raw_size;
+		  }
+	    }
+
+	  relocation = sym->value + sym->section->output_offset
+	    - (AMIGA_DATA (target_section->output_section->owner))->a4init
+	    + r->addend;
+	  copy=false; 
+	  sign = true;
+	}
+      break;
+      
+    default:
+      fprintf(stderr,"Error:Not supported reloc type:%d\n",r->howto->type);
+      copy=false;
+      relocation=0;
+      ret=bfd_reloc_notsupported;
+      break;
+    } /* Of switch */
+  
+  /* Add in relocation */
+  if (relocation!=0)
+    ret = my_add_to (data, r->address, size, relocation, sign);
+  
+  if (copy)/* Copy reloc to output section */
+    {
+      DPRINT(5,("Copying reloc\n"));
+      target_section=sec->output_section;
+      r->address+=sec->output_offset;
+      target_section->orelocation[target_section->reloc_count++]=r;
+      sec->output_section->flags|=SEC_RELOC;
+    }
+  DPRINT(5,("Leaving a_perform_reloc\n"));
+  return ret;
+}
+
+
+/* Perform an a.out reloc */
+static bfd_reloc_status_type 
+aout_perform_reloc (abfd, r, data, sec, obfd, error_message)
+   bfd *abfd;
+   arelent *r;
+   PTR data;
+   asection *sec;
+   bfd *obfd;
+   char **error_message;
+{
+  asymbol *sym; /* Reloc is relative to this */
+  asection *target_section; /* reloc is relative to this section */
+  int relocation;
+  boolean copy, addval = true;
+  bfd_reloc_status_type ret;
+  int size = 2;
+  int sign = false;
+
+  /* If obfd==NULL: Apply the reloc, if possible. */
+  /* Else: Modify it and return */
+  DPRINT(5,("Entering aout_perf_reloc\n"));
+  if (obfd!=NULL) /* Only modify the reloc */
+    {
+      r->address+=sec->output_offset;
+      DPRINT(5,("Leaving aout_perf_reloc, modified\n"));
+      return bfd_reloc_ok;
+    }
+
+  sym=*(r->sym_ptr_ptr);
+  target_section=sym->section;
+
+  if (target_section==bfd_und_section_ptr) /* Error */
+    {
+      DPRINT(10,("target_sec=UND, aout_perf_rel\n"));
+      return bfd_reloc_undefined;
+    }
+  relocation=0; copy=false; ret=bfd_reloc_ok;
+
+  switch (r->howto->type)
+    {
+    case 0: /* 8 bit reloc, pc relative or absolute */
+    case 1: /* 16 bit reloc */
+      DPRINT(10,("16/8 bit relative\n"));
+      size=r->howto->type;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* Error.. */
+	{
+	  relocation=0;
+	  copy=false;
+	  ret=bfd_reloc_undefined;
+	  fprintf(stderr,"Pc relative relocation to  common symbol \"%s\" "
+		  "in section %s\n", sym->name,sec->name);
+	  DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
+	}
+      else 
+	{
+	  /* This is a pc relative hunk... or a baserel... */
+	  if (sec->output_section!=target_section->output_section)
+	    /* Error or baserel */
+	    {
+	      if (target_section->output_section->flags&SEC_DATA!=0)
+		/* Baserel reloc */
+		{
+		  goto baserel; /* Dirty, but no code doubling.. */
+		}/* Of is baserel */
+
+	      relocation=0;
+	      copy =false;
+	      ret=bfd_reloc_outofrange;
+	      fprintf(stderr,"pc relative relocation out of range in section"
+		      "%s. Relocation was to symbol %s\n",sec->name,sym->name);
+
+	      DPRINT(10,("Section%s, target %s: Reloc out of range..."
+			 "not same section, aout_perf\nsec->out=%s, target->out"
+			 "=%s, offset=%lx\n",sec->name, target_section->name,
+			 sec->output_section->name,
+			 target_section->output_section->name,r->address));
+	    }
+	  else
+	    { /* Same section */
+	      relocation=-(r->address+sec->output_offset);
+	      copy=false;
+	      DPRINT(5,("Reloc to same section...\n"));
+	    }
+	}
+      break;
+
+    case 4: /* 8 bit displacement */
+    case 5: /* 16 bit displacement */
+    case 6: /* 32 bit displacement */
+      size=r->howto->type - 4;
+      sign = true;
+      if (target_section == bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation = sym->value;
+      else
+         {
+           relocation = (sym->value + target_section->output_offset) -
+ 			(r->address + sec->output_offset);
+           if (size == 0)
+             relocation--;
+	   addval = false;
+	   copy = 0;
+         }
+      break;
+
+    case 2: /* 32 bit reloc, abs. or relative */
+      DPRINT(10,("32 bit\n"));
+      size=2;
+      if (target_section==bfd_abs_section_ptr) /* Ref to absolute hunk */
+	relocation=sym->value;
+      else if (target_section==bfd_com_section_ptr) /* ref to common */
+	{
+	  relocation=0;
+	  copy=true;
+	}
+      else
+	{
+	  /* If we access a symbol in the .bss section, we have to convert
+	     this to an access to .data section*/
+	  /* This is done through a change to the output section of
+	     the symbol... */
+	  if (amiga_base_relative && (strcmp(sym->section->output_section->name,
+					     ".bss")==0))
+	    {
+	      /* get value for .data section */
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_section=s;
+		    sym->section->output_offset+=s->_raw_size;
+		  }
+	    }
+	  relocation=0;
+	  copy=true;
+	}
+      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+		 target_section->output_section->name,
+		 target_section->output_section,sec->output_section->name,
+		 sec->output_section,sym->name));
+      break;
+
+    case 9: /* 16 bit base relative */
+    case 10: /* 32 bit base relative */
+      DPRINT(10,("32/16 bit baserel\n"));
+      /* We use the symbol ___a4_init as base */
+      size=r->howto->type-8;
+      
+    baserel: 
+      if (target_section==bfd_abs_section_ptr)
+	{
+	  relocation=sym->value;
+	}
+      else if (target_section==bfd_com_section_ptr) /* Error.. */
+	{
+	  relocation=0;
+	  copy=false;
+	  ret=bfd_reloc_undefined;
+	  fprintf(stderr,"Baserelative relocation to common \"%s\"\n",
+		  sym->name);
+
+	  DPRINT(10,("Ref to common symbol...aout_perf_reloc\n"));
+	}
+      else /* Target section and sec need not be the same... */
+	{
+	  if (! (AMIGA_DATA (target_section->output_section->owner)->baserel))
+
+	    {
+	      fprintf(stderr,"Base symbol for base relative reloc not defined,"
+		      "section %s, reloc to symbol %s\n", sec->name, sym->name);
+	      copy=false;
+	      ret=bfd_reloc_notsupported;
+	      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+			 target_section->output_section->name,
+			 target_section->output_section,
+			 sec->output_section->name,
+			 sec->output_section,sym->name));
+	      
+	      break;
+	    }
+	  
+	  /* If target->out is .bss, add the value of the .data section....
+	     to sym, set new output_section */
+	  if (strcmp(target_section->output_section->name,".bss")==0)
+	    {
+	      bfd *ibfd;
+	      asection *s;
+
+	      ibfd=target_section->output_section->owner;
+
+	      for (s=ibfd->sections;s!=NULL;s=s->next)
+		if (strcmp(s->name,".data")==0)
+		  {
+		    sym->section->output_offset+=s->_raw_size;
+		    sym->section->output_section=s;
+		  }
+	    }
+
+	  relocation = sym->value+target_section->output_offset - 0x7ffe;
+
+	  /* if the symbol is in bss, subtract the offset that gas has put
+	     into the opcode */
+	  if (target_section->index == 2)
+	    relocation -= abfd->tdata.aout_data->a.datasec->_raw_size;
+
+	  addval = true;
+	  copy = false;
+	  sign = true;
+
+	  DPRINT (20, ("symbol=%s (0x%lx)\nsection %s (0x%lx; %s; output=0x%lx)"
+		       "\nrelocation @0x%lx\n\n", sym->name, sym->value,
+		       sym->section->name, (unsigned long)sym->section,
+		       sym->section->owner->filename, sym->section->output_offset,
+		       r->address));
+	}
+      DPRINT(10,("target->out=%s(%lx), sec->out=%s(%lx), symbol=%s\n",
+		 target_section->output_section->name,
+		 target_section->output_section,sec->output_section->name,
+		 sec->output_section,sym->name));
+      break;
+      
+    default:
+      copy=false;
+      relocation=0;
+      ret=bfd_reloc_notsupported;
+      fprintf(stderr,"Unsupported reloc: %d\n",r->howto->type);
+      break;
+
+    }/* Of switch */
+
+  /* Add in relocation */
+  if (relocation!=0)
+    if (addval)
+      ret = my_add_to (data, r->address,size, relocation, sign);
+    else
+      ret = my_set_to (data, r->address, size, relocation, sign);
+
+  if (copy)/* Copy reloc to output section */
+    {
+      DPRINT(5,("Copying reloc\n"));
+      target_section=sec->output_section;
+      r->address+=sec->output_offset;
+      target_section->orelocation[target_section->reloc_count++]=r;
+    }
+  DPRINT(5,("Leaving aout_perf_reloc with %d (OK=%d)\n",ret,bfd_reloc_ok));
+  return ret;
+}
+
+
+/* The final link routine, used both by Amiga and a.out backend*/
+/* This is nearly a copy of _bfd_generic_final_link */
+boolean
+amiga_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  bfd *sub;
+  asection *o,*act_sec;
+  struct bfd_link_order *p;
+  size_t outsymalloc;
+  struct generic_write_global_symbol_info wginfo;
+  struct bfd_link_hash_entry *h =
+    bfd_link_hash_lookup (info->hash, "___a4_init", false, false, true);
+
+  if (h && h->type == bfd_link_hash_defined) {
+    AMIGA_DATA (abfd)->baserel = true;
+    AMIGA_DATA (abfd)->a4init = h->u.def.value;
+  }
+  else
+    AMIGA_DATA (abfd)->baserel = false;
+
+  DPRINT(5,("Entering final_link\n"));
+
+  if (abfd->xvec->flavour == bfd_target_aout_flavour)
+    return amiga_aout_bfd_final_link(abfd, info);
+
+  abfd->outsymbols = (asymbol **) NULL;
+  abfd->symcount = 0;
+  outsymalloc = 0;
+
+  /* Mark all sections which will be included in the output file.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    for (p = o->link_order_head; p != NULL; p = p->next)
+      if (p->type == bfd_indirect_link_order)
+	p->u.indirect.section->linker_mark = true;
+
+  /* Build the output symbol table.  */
+  for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next)
+    if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc))
+      return false;
+
+  DPRINT(10,("Did build output symbol table\n"));
+
+  /* Accumulate the global symbols.  */
+  wginfo.info = info;
+  wginfo.output_bfd = abfd;
+  wginfo.psymalloc = &outsymalloc;
+  _bfd_generic_link_hash_traverse (_bfd_generic_hash_table (info),
+                                   _bfd_generic_link_write_global_symbol,
+                                   (PTR) &wginfo);
+
+  DPRINT(10,("Accumulated global symbols\n"));
+
+  DPRINT(10,("Output bfd is %s(%lx)\n",abfd->filename,abfd));
+
+  /* Allocate space for the output relocs for each section.  */
+  /* We also handle base-relative linking special, by setting the .data
+     sections real length to it's length + .bss length */
+  /* This is different to bfd_generic_final_link: We ALWAYS alloc space for
+     the relocs, because we may need it anyway */
+  for (o = abfd->sections;
+       o != (asection *) NULL;
+       o = o->next)
+    {
+      /* If section is .data, find .bss and add that length */
+      if (!info->relocateable && amiga_base_relative &&
+	  (strcmp(o->name,".data")==0))
+	{
+	  if (abfd->xvec->flavour!=bfd_target_amiga_flavour) /* oops */
+	    {
+	      fprintf(stderr,"You can't use base relative linking with"
+		      " partial links.\n");
+	    }
+	  else
+	    {
+#if 0
+	      for (act_sec=abfd->sections; act_sec!=NULL;act_sec=act_sec->next)
+		if (strcmp(act_sec->name,".bss")==0)
+		  amiga_per_section(o)->disk_size = o->_raw_size +
+		    act_sec->_raw_size;
+#endif
+	    }
+	}/* Of base-relative linking */
+
+      DPRINT(10,("Section in output bfd is %s (%lx)\n",o->name,o));
+
+      o->reloc_count = 0;
+      for (p = o->link_order_head;
+	   p != (struct bfd_link_order *) NULL;
+	   p = p->next)
+	{
+	  if (p->type == bfd_section_reloc_link_order
+	      || p->type == bfd_symbol_reloc_link_order)
+	    ++o->reloc_count;
+	  else if (p->type == bfd_indirect_link_order)
+	    {
+	      asection *input_section;
+	      bfd *input_bfd;
+	      long relsize;
+	      arelent **relocs;
+	      asymbol **symbols;
+	      long reloc_count;
+	      
+	      input_section = p->u.indirect.section;
+	      input_bfd = input_section->owner;
+
+	      DPRINT(10,("\tIndirect section from bfd %s, section is %s(%lx)"
+			 " (COM=%lx)\n",
+			 input_bfd->filename,input_section->name,input_section,
+			 bfd_com_section_ptr));
+
+	      relsize = bfd_get_reloc_upper_bound (input_bfd,
+						   input_section);
+	      if (relsize < 0)
+		{
+		  DPRINT(10,("Relsize<0.I..in bfd %s, sec %s\n",
+			     input_bfd->filename, input_section->name));
+		  return false;
+		}
+
+	      relocs = (arelent **) malloc ((size_t) relsize);
+
+	      if (!relocs && relsize != 0)
+		{
+		  bfd_set_error (bfd_error_no_memory);
+		  return false;
+		}
+	      symbols = _bfd_generic_link_get_symbols (input_bfd);
+	      reloc_count = bfd_canonicalize_reloc (input_bfd,
+						    input_section,
+						    relocs,
+						    symbols);
+	      if (reloc_count < 0)
+		{
+		  DPRINT(10,("Relsize<0.II..in bfd %s, sec %s\n",
+			     input_bfd->filename, input_section->name));
+		  return false;
+		}
+
+	      BFD_ASSERT (reloc_count == input_section->reloc_count);
+	      o->reloc_count += reloc_count;
+	      free (relocs);
+	    }
+	}
+      if (o->reloc_count > 0)
+	{
+	  o->orelocation = ((arelent **)
+			    bfd_alloc (abfd,
+				       (o->reloc_count
+					* sizeof (arelent *))));
+
+	  if (!o->orelocation)
+	    {
+	      bfd_set_error (bfd_error_no_memory);
+	      return false;
+	    }
+	  /* o->flags |= SEC_RELOC; There may be no relocs. This can be
+	     determined only later */
+	  /* Reset the count so that it can be used as an index
+	     when putting in the output relocs.  */
+	  o->reloc_count = 0;
+	}
+    }
+
+  DPRINT(10,("Got all relocs\n"));
+
+  /* Handle all the link order information for the sections.  */
+  for (o = abfd->sections;
+       o != (asection *) NULL;
+       o = o->next)
+    {
+      for (p = o->link_order_head;
+           p != (struct bfd_link_order *) NULL;
+           p = p->next)
+        {
+          switch (p->type)
+            {
+            case bfd_section_reloc_link_order:
+            case bfd_symbol_reloc_link_order:
+              if (! amiga_reloc_link_order (abfd, info, o, p)) /* We use an own routine */
+                return false;
+              break;
+            case bfd_indirect_link_order:
+              if (! default_indirect_link_order (abfd, info, o, p, false)) 
+		/* Calls our get_relocated_section_contents*/
+                return false;
+              break;
+            default:
+              if (! _bfd_default_link_order (abfd, info, o, p))
+                return false;
+              break;
+            }
+        }
+    }
+  if (abfd->xvec->flavour==bfd_target_amiga_flavour&&!info->relocateable)
+    AMIGA_DATA(abfd)->IsLoadFile=true;
+
+  DPRINT(10,("Leaving final_link\n"));
+  return true;
+}
+
+
+/* Handle reloc link order . This is nearly a copy from generic_reloc_link_order
+   in linker.c*/
+static boolean 
+amiga_reloc_link_order(abfd, info, sec, link_order)
+  bfd *abfd;
+  struct bfd_link_info *info;
+  asection *sec;
+  struct bfd_link_order *link_order;
+{
+   amiga_reloc_type *r;
+
+   DPRINT(5,("Entering amiga_reloc_link_order\n"));
+
+   /* We generate a new AMIGA style reloc */
+   BFD_ASSERT(sec->orelocation!=NULL);
+
+   if (sec->orelocation == (arelent **) NULL)
+     {
+       DPRINT(10,("aborting, since orelocation==NULL\n"));
+       abort ();
+     }
+
+   r = (amiga_reloc_type *) bfd_zalloc (abfd, sizeof (amiga_reloc_type));
+   if (r ==  NULL)
+     {
+       bfd_set_error (bfd_error_no_memory);
+       DPRINT(5,("Leaving amiga_reloc_link, no mem\n"));
+       return false;
+     }
+   
+   r->relent.address = link_order->offset;
+   r->relent.howto = bfd_reloc_type_lookup (abfd, link_order->u.reloc.p->reloc);
+   if (r->relent.howto ==  NULL)
+     {
+       bfd_set_error (bfd_error_bad_value);
+       DPRINT(5,("Leaving amiga_reloc_link, bad value\n"));
+       return false;
+     }
+   
+   /* Get the symbol to use for the relocation.  */
+   if (link_order->type == bfd_section_reloc_link_order)
+     r->relent.sym_ptr_ptr = link_order->u.reloc.p->u.section->symbol_ptr_ptr;
+   else
+     {
+       struct generic_link_hash_entry *h;
+       
+       h = _bfd_generic_link_hash_lookup (_bfd_generic_hash_table (info),
+					  link_order->u.reloc.p->u.name,
+					  false, false, true);
+       if (h == (struct generic_link_hash_entry *) NULL
+	   || ! h->written)
+	 {
+	   if (! ((*info->callbacks->unattached_reloc)
+		  (info, link_order->u.reloc.p->u.name,
+		   (bfd *) NULL, (asection *) NULL, (bfd_vma) 0)))
+	     return false;
+	   bfd_set_error (bfd_error_bad_value);
+	   DPRINT(5,("Leaving amiga_reloc_link, bad value in hash lookup\n"));
+	   return false;
+	 }
+       r->relent.sym_ptr_ptr = &h->sym;
+     }
+   DPRINT(5,("Got symbol for relocation\n"));
+   /* Store the addend */
+   r->relent.addend = link_order->u.reloc.p->addend;
+
+
+   /* If we are generating relocateable output, just add the reloc */
+   if (info->relocateable)
+     {
+       DPRINT(5,("Adding reloc\n"));
+       sec->orelocation[sec->reloc_count] = (arelent *)r;
+       ++sec->reloc_count; 
+       sec->flags|=SEC_RELOC;
+     }
+   else
+     { /* Try to apply the reloc */
+       char *em="";
+       PTR data;
+       bfd_reloc_status_type ret;
+
+       DPRINT(5,("Apply link_order_reloc\n"));
+       /*FIXME: Maybe, we have to get the section contents, before we use them,
+	 if they have not been
+	 set by now.. */
+
+       BFD_ASSERT(sec->contents!=NULL);
+       data=(PTR)(sec->contents);
+
+       if (bfd_get_flavour(abfd)==bfd_target_amiga_flavour)
+	 ret=amiga_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
+       else
+	 ret=aout_perform_reloc(abfd,(arelent *)r,data,sec,NULL,&em);
+
+       if (ret!=bfd_reloc_ok)
+	 {
+	   DPRINT(5,("Leaving amiga_reloc_link, value false\n"));
+	   return false;
+	 }
+     }
+   DPRINT(5,("Leaving amiga_reloc_link\n"));
+   return true;
+}
diff --git a/bfd/aout-amiga.c b/bfd/aout-amiga.c
new file mode 100644
index 0000000..7af31be
--- /dev/null
+++ binutils-2.9.1/bfd/aout-amiga.c
@@ -0,0 +1,50 @@
+/* BFD backend for Amiga style a.out with flags set to 0
+   Copyright (C) 1990, 91, 92, 93, 1994 Free Software Foundation, Inc.
+   Written by Stephan Thesing.
+
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#define TARGETNAME "a.out-amiga"
+#define MY(OP) CAT(aout_amiga_,OP)
+
+#include "bfd.h"
+
+#define MY_exec_hdr_flags 0
+
+extern boolean
+amiga_final_link(bfd *,struct bfd_link_info *);
+#define MY_bfd_final_link amiga_final_link
+
+extern bfd_byte *
+get_relocated_section_contents(bfd *, struct bfd_link_info *,
+			       struct bfd_link_order *, bfd_byte *,
+			       boolean , asymbol **);
+#define MY_bfd_get_relocated_section_contents get_relocated_section_contents
+
+/* Include the usual a.out support.  */
+#include "aoutf1.h"
+
+/* Final link routine.  We need to use a call back to get the correct
+   offsets in the output file.  */
+
+boolean
+amiga_aout_bfd_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
+}
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index ff1cdd2..dbb8028 100644
--- binutils-2.9.1.orig/bfd/aoutx.h
+++ binutils-2.9.1/bfd/aoutx.h
@@ -135,7 +135,8 @@ DESCRIPTION
 static boolean aout_get_external_symbols PARAMS ((bfd *));
 static boolean translate_from_native_sym_flags
   PARAMS ((bfd *, aout_symbol_type *));
-static boolean translate_to_native_sym_flags
+/*Amiga hack - used in amigaos.c, must be global */
+/*static*/ boolean translate_to_native_sym_flags
   PARAMS ((bfd *, asymbol *, struct external_nlist *));
 static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *));
 static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *));
@@ -1576,7 +1577,7 @@ translate_from_native_sym_flags (abfd, cache_ptr)
 
 /* Set the fields of SYM_POINTER according to CACHE_PTR.  */
 
-static boolean
+/*static*/ boolean
 translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer)
      bfd *abfd;
      asymbol *cache_ptr;
@@ -1977,10 +1978,29 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr)
 
   r_length = g->howto->size ;	/* Size as a power of two */
   r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC? */
+#if 1
+  /* FIXME! "#if 1" is the wrong way to select this Amiga specific code.
+   We can't just test for __amigaos__ defined either, since we may be
+   building a cross compiler and __amigaos__ is only defined if the
+   compiler we are using is targeted for the Amiga. */
+  /* Changed for cooperation with AMIGA backend */
+  /* This only applies, if aout flavour    191194 ST*/
   /* XXX This relies on relocs coming from a.out files.  */
+  if (bfd_asymbol_bfd(sym)->xvec->flavour==bfd_target_aout_flavour)
+    {
+      r_baserel = (g->howto->type & 8) != 0;
+      r_jmptable = (g->howto->type & 16) != 0;
+      r_relative = (g->howto->type & 32) != 0;
+    }
+  else
+    {
+      r_baserel=r_jmptable=r_relative=0;
+    }
+#else
   r_baserel = (g->howto->type & 8) != 0;
   r_jmptable = (g->howto->type & 16) != 0;
   r_relative = (g->howto->type & 32) != 0;
+#endif
 
 #if 0
   /* For a standard reloc, the addend is in the object file.  */
@@ -2273,8 +2293,12 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
   /* Base relative relocs are always against the symbol table,
      regardless of the setting of r_extern.  r_extern just reflects
      whether the symbol the reloc is against is local or global.  */
+#if 0
+  /* FIXME! "#if 0" is the wrong way to disable this code.  See comment
+     earlier in file. */
   if (r_baserel)
     r_extern = 1;
+#endif
 
   if (r_extern && r_index > symcount)
     {
diff --git a/bfd/archive.c b/bfd/archive.c
index 6b9dbbc..a91cf1b 100644
--- binutils-2.9.1.orig/bfd/archive.c
+++ binutils-2.9.1/bfd/archive.c
@@ -870,6 +870,30 @@ do_slurp_coff_armap (abfd)
     {
       rawptr = raw_armap + i;
       carsyms->file_offset = swap ((PTR) rawptr);
+
+#if 0
+      /* WARNING: This code breaks symbol offsets! This code was the cause
+         for the infamous 'could not read symbols: Malformed archive' -error.
+         Disabled 20-Jul-2004 - Harry Sintonen <sintonen@iki.fi> */
+
+      /* This is a hack to work around a bug in x86 BeOS linkers that did not
+	 follow the PE spec and saved the file offsets in little endian mode. */
+      {
+	file_ptr le_val;
+	le_val = bfd_getl32 ((PTR) rawptr);
+	if (carsyms->file_offset < 0)
+	  {
+	    /* Must have been little endian */
+	    carsyms->file_offset = le_val;
+	  }
+	else if ((le_val > 0) && (le_val < carsyms->file_offset))
+	  {
+	    /* Both values positive and le_val smaller, so use le_val. */
+	    carsyms->file_offset = le_val;
+	  }
+      }
+#endif
+
       carsyms->name = stringbase;
       stringbase += strlen (stringbase) + 1;
       carsyms++;
diff --git a/bfd/archures.c b/bfd/archures.c
index fa6c7cc..bdf4d1c 100644
--- binutils-2.9.1.orig/bfd/archures.c
+++ binutils-2.9.1/bfd/archures.c
@@ -869,3 +869,7 @@ bfd_printable_arch_mach (arch, machine)
       return ap->printable_name;
     return "UNKNOWN!";
 }
+
+#ifndef HAVE_i386pei_vec
+void pei_get_comdat_info(struct sec *pei_comdat_section){}
+#endif
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index e2ed936..f9e024f 100644
--- binutils-2.9.1.orig/bfd/bfd-in.h
+++ binutils-2.9.1/bfd/bfd-in.h
@@ -694,4 +694,9 @@ extern boolean bfd_coff_get_syment
 extern boolean bfd_coff_get_auxent
   PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
 
+/* Externally visible PEI routines */
+
+extern void pei_get_comdat_info 
+  PARAMS ((struct sec *));
+
 /* And more from the source.  */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 9137998..8f8220a 100644
--- binutils-2.9.1.orig/bfd/bfd-in2.h
+++ binutils-2.9.1/bfd/bfd-in2.h
@@ -694,6 +694,11 @@ extern boolean bfd_coff_get_syment
 extern boolean bfd_coff_get_auxent
   PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
 
+/* Externally visible PEI routines */
+
+extern void pei_get_comdat_info 
+  PARAMS ((struct sec *));
+
 /* And more from the source.  */
 void 
 bfd_init PARAMS ((void));
@@ -797,6 +802,13 @@ bfd_create PARAMS ((CONST char *filename, bfd *templ));
 #define bfd_h_get_signed_64(abfd, ptr) \
                 BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
 
+typedef struct _comdat_info
+{
+  int asoc_sec;
+  char name_buf[9];
+  const char * comdat_sym;
+} comdat_info;
+
 typedef struct sec
 {
          /* The name of the section; the name isn't a copy, the pointer is
@@ -1078,6 +1090,8 @@ typedef struct sec
    struct symbol_cache_entry *symbol;
    struct symbol_cache_entry **symbol_ptr_ptr;
 
+   comdat_info *pe_comdat_info;
+
    struct bfd_link_order *link_order_head;
    struct bfd_link_order *link_order_tail;
 } asection ;
@@ -1821,6 +1835,10 @@ to compensate for the borrow when the low bits are added. */
   BFD_RELOC_PPC_EMB_RELST_HA,
   BFD_RELOC_PPC_EMB_BIT_FLD,
   BFD_RELOC_PPC_EMB_RELSDA,
+  BFD_RELOC_PPC_MORPHOS_DREL,
+  BFD_RELOC_PPC_MORPHOS_DREL_LO,
+  BFD_RELOC_PPC_MORPHOS_DREL_HI,
+  BFD_RELOC_PPC_MORPHOS_DREL_HA,
 
 /* The type of reloc used to build a contructor table - at the moment
 probably a 32 bit wide absolute relocation, but the target can choose.
@@ -2290,6 +2308,7 @@ struct _bfd
       struct cisco_core_struct *cisco_core_data;
       struct versados_data_struct *versados_data;
       struct netbsd_core_struct *netbsd_core_data;
+      struct amiga_data_struct *amiga_data;
       PTR any;
       } tdata;
   
@@ -2505,6 +2524,7 @@ core_file_matches_executable_p
 #endif
 enum bfd_flavour {
   bfd_target_unknown_flavour,
+  bfd_target_amiga_flavour,
   bfd_target_aout_flavour,
   bfd_target_coff_flavour,
   bfd_target_ecoff_flavour,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 8293a72..7cf7991 100644
--- binutils-2.9.1.orig/bfd/bfd.c
+++ binutils-2.9.1/bfd/bfd.c
@@ -177,6 +177,7 @@ CODE_FRAGMENT
 .      struct cisco_core_struct *cisco_core_data;
 .      struct versados_data_struct *versados_data;
 .      struct netbsd_core_struct *netbsd_core_data;
+.      struct amiga_data_struct *amiga_data;
 .      PTR any;
 .      } tdata;
 .  
@@ -1153,3 +1154,4 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
 
   return true;
 }
+
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index f0514c4..5b3b6cb 100644
--- binutils-2.9.1.orig/bfd/coffcode.h
+++ binutils-2.9.1/bfd/coffcode.h
@@ -577,7 +577,7 @@ styp_to_sec_flags (abfd, hdr, name)
   if (styp_flags & IMAGE_SCN_LNK_REMOVE)
     sec_flags |= SEC_EXCLUDE;
 
-  if (styp_flags & IMAGE_SCN_LNK_COMDAT)
+  if (styp_flags & IMAGE_SCN_LNK_COMDAT & 0 /* fnf hack for mwcc hijacking this bit */)
     {
       sec_flags |= SEC_LINK_ONCE;
 
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index b5ecbc9..cb348cc 100644
--- binutils-2.9.1.orig/bfd/coffgen.c
+++ binutils-2.9.1/bfd/coffgen.c
@@ -41,6 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "libbfd.h"
 #include "coff/internal.h"
 #include "libcoff.h"
+#include <ctype.h>
 
 static void coff_fix_symbol_name
   PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
@@ -654,6 +655,7 @@ coff_renumber_symbols (bfd_ptr, first_undef)
     if (!newsyms)
       return false;
     bfd_ptr->outsymbols = newsyms;
+#ifndef HAVE_i386pei_vec
     for (i = 0; i < symbol_count; i++)
       if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0
 	  || (!bfd_is_und_section (symbol_ptr_ptr[i]->section)
@@ -670,6 +672,35 @@ coff_renumber_symbols (bfd_ptr, first_undef)
 		  == BSF_GLOBAL)))
 	*newsyms++ = symbol_ptr_ptr[i];
 
+#else
+	 /* link.exe depends on the symbols being sorted in
+		their natural order in each section. this is 
+		as close as I could come without using backend data
+		otherwise it finds local labels and thinks they are comdats */
+    for (i = 0; i < symbol_count; i++)
+      if ( (symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0 
+	   || ( !bfd_is_und_section (symbol_ptr_ptr[i]->section) 
+              && !bfd_is_com_section (symbol_ptr_ptr[i]->section)
+              && !isalpha(symbol_ptr_ptr[i]->name[0])
+              && ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION)) != BSF_GLOBAL )
+              )
+         )
+	*newsyms++ = symbol_ptr_ptr[i];
+
+    for (i = 0; i < symbol_count; i++)
+      if ( (symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) == 0 
+           && !bfd_is_und_section (symbol_ptr_ptr[i]->section)
+           && !isalpha(symbol_ptr_ptr[i]->name[0])
+           && (bfd_is_com_section (symbol_ptr_ptr[i]->section) 
+              || ((symbol_ptr_ptr[i]->flags & (BSF_GLOBAL | BSF_FUNCTION)) == BSF_GLOBAL)
+              ) 
+         )
+	*newsyms++ = symbol_ptr_ptr[i];
+	/* for Scope etc.. */
+    for (i = 0;i < symbol_count;i++)
+	if (isalpha(symbol_ptr_ptr[i]->name[0]))
+	  *newsyms++ = symbol_ptr_ptr[i];
+#endif
     *first_undef = newsyms - bfd_ptr->outsymbols;
 
     for (i = 0; i < symbol_count; i++)
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 7b2b830..b90e1b5 100644
--- binutils-2.9.1.orig/bfd/cofflink.c
+++ binutils-2.9.1/bfd/cofflink.c
@@ -34,6 +34,8 @@ static boolean coff_link_check_archive_element
 static boolean coff_link_check_ar_symbols
   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
 static boolean coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));
+static asection *coff_get_first_section_of_archive
+ PARAMS ((struct bfd_link_info *, bfd *, CONST char *));
 static char *dores_com PARAMS ((char *, bfd *, int));
 static char *get_name PARAMS ((char *, char **));
 static int process_embedded_commands
@@ -2654,8 +2656,33 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
 		     + sec->output_offset);
 	      }
 
+      else if (coff_data(input_bfd)->pe
+	       && h->class == C_SECTION
+	       && h->root.type == bfd_link_hash_undefined)
+        {
+           /* Reference to an idata sub-section label, 
+              currently undefined */
+	      asection *sec;
+           if (!strncmp(sym->n_name, "i4", (size_t)2 ))
+                  sprintf(sym->n_name, ".idata$4");
+           else 
+             { 
+               if (!strncmp(sym->n_name, "i5", (size_t)2 ))
+                  sprintf(sym->n_name, ".idata$5"); 
+             }
+           sec = coff_get_first_section_of_archive(info,
+	         h->root.u.undef.abfd,
+	         sym->n_name);
+           if (sec == NULL)
+                 goto undef_sym;
+           val = (sec->output_section->vma
+	   + sec->output_offset
+	   - sec->vma);
+        }
+
 	  else if (! info->relocateable)
 	    {
+undef_sym:
 	      if (! ((*info->callbacks->undefined_symbol)
 		     (info, h->root.root.string, input_bfd, input_section,
 		      rel->r_vaddr - input_section->vma)))
@@ -2732,4 +2759,39 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
     }
   return true;
 }
-
+static asection *
+coff_get_first_section_of_archive(info, abfd, name)
+     struct bfd_link_info *info;
+     bfd *abfd;
+     CONST char *name;
+{
+bfd *sub;
+asection *sect;
+asection *rtn = NULL;
+bfd_vma offset;
+
+/* move abfd to containing archive */
+if (abfd->my_archive == NULL)
+   return NULL;
+
+abfd = abfd->my_archive;
+
+for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) 
+  {
+   /* make sure that the bfd comes from the same archive */
+   if (sub->my_archive == NULL || strcmp(abfd->filename, sub->my_archive->filename) )
+     continue;
+
+   for (sect = sub->sections; sect != NULL; sect = sect->next) 
+     {
+     if (strcmp (sect->name, name))
+       continue;
+     if (rtn == NULL || offset > sect->output_offset)
+       {
+       offset = sect->output_offset;
+       rtn = sect;
+       }
+     }
+  }
+ return rtn;
+}
diff --git a/bfd/config.bfd b/bfd/config.bfd
old mode 100755
new mode 100644
index 589bb8f..ae45be5
--- binutils-2.9.1.orig/bfd/config.bfd
+++ binutils-2.9.1/bfd/config.bfd
@@ -236,7 +236,7 @@ case "${targ}" in
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs="i386msdos_vec i386aout_vec"
     ;;
-  i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe)
+  i[3456]86-*-mingw32* | i[3456]86-*-cygwin32* | i[3456]86-*-winnt | i[3456]86-*-pe | i[3456]86-*-beos* )
     targ_defvec=i386pe_vec
     targ_selvecs="i386pe_vec i386pei_vec"
     ;;
@@ -284,6 +284,10 @@ case "${targ}" in
   m68*-motorola-sysv*)
     targ_defvec=m68ksysvcoff_vec
     ;;
+  m68*-*-amigaos*)
+    targ_defvec=amiga_vec
+    targ_selvecs="aout_amiga_vec amiga_vec"
+    ;;
   m68*-hp-bsd*)
     targ_defvec=hp300bsd_vec
     targ_underscore=yes
@@ -341,7 +345,7 @@ case "${targ}" in
     targ_selvecs="m68kcoff_vec versados_vec tekhex_vec"
     targ_underscore=yes
     ;;
-  m68*-cbm-*)
+  m68*-cbm-amix)
     targ_defvec=bfd_elf32_m68k_vec
     targ_selvecs=m68kcoff_vec
     ;;
@@ -464,6 +468,18 @@ case "${targ}" in
   powerpc-*-aix* | powerpc-*-beos*)
     targ_defvec=rs6000coff_vec
     ;;
+  powerpc-*-amigaoshunk*)
+    targ_defvec=amiga_vec
+    targ_selvecs="bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec aout_amiga_vec"
+    ;;
+  powerpc-*-amigaos*)
+    targ_defvec=bfd_elf32_powerpc_vec
+    targ_selvecs="bfd_elf32_powerpcle_vec"
+    ;;
+  powerpc-*-morphos*)
+    targ_defvec=bfd_elf32_morphos_vec
+    targ_selvecs="bfd_elf32_morphos_vec"
+    ;;
   powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
   powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems*)
     targ_defvec=bfd_elf32_powerpc_vec
diff --git a/bfd/configure b/bfd/configure
index a0643a7..0f6ce60 100755
--- binutils-2.9.1.orig/bfd/configure
+++ binutils-2.9.1/bfd/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -65,6 +65,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -182,6 +186,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -224,6 +232,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -354,7 +378,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -524,9 +548,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -588,7 +614,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:592: checking host system type" >&5
+echo "configure:618: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -609,7 +635,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:613: checking target system type" >&5
+echo "configure:639: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -627,7 +653,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:631: checking build system type" >&5
+echo "configure:657: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -652,15 +678,16 @@ test "$host_alias" != "$target_alias" &&
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:656: checking for $ac_word" >&5
+echo "configure:682: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -678,19 +705,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:712: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:745: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:774: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:685: checking for $ac_word" >&5
+echo "configure:807: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -725,25 +848,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:859: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:890: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 743 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 901 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -757,18 +916,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:932: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:772: checking whether we are using GNU C" >&5
+echo "configure:937: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -777,7 +942,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -788,11 +953,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:965: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -807,20 +976,47 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:824: checking for POSIXized ISC" >&5
+echo "configure:1020: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -848,21 +1044,22 @@ fi
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:857: checking for a BSD compatible install" >&5
+echo "configure:1054: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -901,13 +1098,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:911: checking whether build environment is sane" >&5
+echo "configure:1110: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -964,7 +1163,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:968: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1167: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1010,7 +1209,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1014: checking for working aclocal" >&5
+echo "configure:1213: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1023,7 +1222,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1027: checking for working autoconf" >&5
+echo "configure:1226: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1036,7 +1235,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1040: checking for working automake" >&5
+echo "configure:1239: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1049,7 +1248,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1053: checking for working autoheader" >&5
+echo "configure:1252: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1062,7 +1261,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1066: checking for working makeinfo" >&5
+echo "configure:1265: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1085,15 +1284,49 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1089: checking for $ac_word" >&5
+echo "configure:1288: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+ if test -z "$AR"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1321: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_AR="${ac_tool_prefix}ar"
@@ -1113,18 +1346,35 @@ fi
 
 
 
+fi
+echo $ac_n "checking what flags $AR needs to create archives""... $ac_c" 1>&6
+echo "configure:1352: checking what flags $AR needs to create archives" >&5
+if eval "test \"`echo '$''{'gg_cv_arflags'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$CC" in
+  mwcc* | bcc*) ARFLAGS=${ARFLAGS-"-xml -o"} ;;
+  *)		ARFLAGS=${ARFLAGS-"cr"} ;;
+esac
+gg_cv_arflags=$ARFLAGS
+
+fi
+ARFLAGS="$gg_cv_arflags"
+echo "$ac_t""$ARFLAGS" 1>&6
+
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1369: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
@@ -1147,15 +1397,16 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1151: checking for $ac_word" >&5
+echo "configure:1401: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1229,15 +1480,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1233: checking for $ac_word" >&5
+echo "configure:1484: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1268,7 +1520,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1272: checking for ld used by GCC" >&5
+echo "configure:1524: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1286,10 +1538,10 @@ echo "configure:1272: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1290: checking for GNU ld" >&5
+echo "configure:1542: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1293: checking for non-GNU ld" >&5
+echo "configure:1545: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1325,7 +1577,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1329: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1581: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1341,7 +1593,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1345: checking for BSD-compatible nm" >&5
+echo "configure:1597: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1378,7 +1630,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1382: checking whether ln -s works" >&5
+echo "configure:1634: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1388,14 +1640,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1414,8 +1676,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1418 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1680 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1515,7 +1777,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1519: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1781: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1533,19 +1795,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1537: checking for Cygwin32 environment" >&5
+echo "configure:1799: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
+#line 1804 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1562,19 +1824,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1566: checking for Mingw32 environment" >&5
+echo "configure:1828: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1571 "configure"
+#line 1833 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1593,7 +1855,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1597: checking for executable suffix" >&5
+echo "configure:1859: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1625,15 +1887,16 @@ target64=false
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1629: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1651,19 +1914,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1921: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1954: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1983: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1658: checking for $ac_word" >&5
+echo "configure:2016: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1698,25 +2057,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2068: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2099: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2110 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1730,18 +2125,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2141: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1745: checking whether we are using GNU C" >&5
+echo "configure:2146: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1750,7 +2151,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1761,11 +2162,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1769: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2174: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1780,18 +2185,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 # Permit host specific settings.
 . ${srcdir}/configure.host
@@ -1831,7 +2263,7 @@ if test "x$cross_compiling" = "xno"; then
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:1835: checking for build system executable suffix" >&5
+echo "configure:2267: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1853,7 +2285,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1857: checking how to run the C preprocessor" >&5
+echo "configure:2289: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1868,14 +2300,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1872 "configure"
+#line 2304 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1885,14 +2317,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1889 "configure"
+#line 2321 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2338 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1905,6 +2354,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1917,18 +2368,18 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1921: checking for $ac_hdr" >&5
+echo "configure:2372: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1926 "configure"
+#line 2377 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1957,18 +2408,18 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1961: checking for $ac_hdr" >&5
+echo "configure:2412: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 2417 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1994,12 +2445,12 @@ fi
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1998: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2449: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2003 "configure"
+#line 2454 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2008,7 +2459,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2031,12 +2482,12 @@ fi
 for ac_func in fcntl getpagesize setitimer sysconf fdopen
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2035: checking for $ac_func" >&5
+echo "configure:2486: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2491 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2059,7 +2510,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2094,12 +2545,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2098: checking whether strstr must be declared" >&5
+echo "configure:2549: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2103 "configure"
+#line 2554 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2120,7 +2571,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2142,12 +2593,12 @@ EOF
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:2146: checking whether malloc must be declared" >&5
+echo "configure:2597: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 2602 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2168,7 +2619,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:2172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -2190,12 +2641,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:2194: checking whether realloc must be declared" >&5
+echo "configure:2645: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2199 "configure"
+#line 2650 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2216,7 +2667,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:2220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -2238,12 +2689,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2242: checking whether free must be declared" >&5
+echo "configure:2693: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2247 "configure"
+#line 2698 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2264,7 +2715,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -2286,12 +2737,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2290: checking whether getenv must be declared" >&5
+echo "configure:2741: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2746 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2312,7 +2763,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2587,19 +3038,19 @@ EOF
   # Define HAVE_SYS_PROCFS_H if the file exists and defines
   # prstatus_t.
   echo $ac_n "checking for sys/procfs.h""... $ac_c" 1>&6
-echo "configure:2591: checking for sys/procfs.h" >&5
+echo "configure:3042: checking for sys/procfs.h" >&5
   if eval "test \"`echo '$''{'bfd_cv_header_sys_procfs_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2596 "configure"
+#line 3047 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 prstatus_t t;
 ; return 0; }
 EOF
-if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_header_sys_procfs_h=yes
 else
@@ -2700,6 +3151,7 @@ do
     # with the two vector lists in targets.c.
     a29kcoff_big_vec)		tb="$tb coff-a29k.lo cofflink.lo" ;;
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
+    amiga_vec)			tb="$tb amigaos.lo amigaoslink.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
@@ -2707,6 +3159,7 @@ do
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
+    aout_amiga_vec)		tb="$tb aout-amiga.lo aout32.lo stab-syms.lo";;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
     aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
@@ -2735,6 +3188,7 @@ do
     bfd_elf32_m88k_vec)		tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
     bfd_elf32_mn10200_vec)	tb="$tb elf-m10200.lo elf32.lo $elf" ;;
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+    bfd_elf32_morphos_vec)	tb="$tb elf32-morphos.lo elf32.lo $elf" ;;
     bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
@@ -2910,18 +3364,18 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2914: checking for $ac_hdr" >&5
+echo "configure:3367: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 3372 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:3377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2949,12 +3403,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2953: checking for $ac_func" >&5
+echo "configure:3406: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2958 "configure"
+#line 3411 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2977,7 +3431,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3002,7 +3456,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3006: checking for working mmap" >&5
+echo "configure:3459: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3010,7 +3464,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3014 "configure"
+#line 3467 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3150,7 +3604,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3175,12 +3629,12 @@ fi
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3179: checking for $ac_func" >&5
+echo "configure:3632: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3184 "configure"
+#line 3637 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3203,7 +3657,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3258,7 +3712,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -3304,7 +3758,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -3325,7 +3781,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -3349,6 +3805,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -3366,6 +3823,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -3383,9 +3844,11 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -3394,8 +3857,7 @@ s%@AUTOMAKE@%$AUTOMAKE%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
+s%@ARFLAGS@%$ARFLAGS%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -3560,6 +4022,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -3605,6 +4068,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -3636,6 +4100,7 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/bfd/configure.host b/bfd/configure.host
index 769c0a2..2ce55a4 100644
--- binutils-2.9.1.orig/bfd/configure.host
+++ binutils-2.9.1/bfd/configure.host
@@ -44,6 +44,7 @@ mips*-*-sysv*)		HDEFINES="-G 4" ;;
 mips*-*-riscos*)	HDEFINES="-G 4" ;;
 
 m68*-hp-hpux*)		HDEFINES=-DHOST_HP300HPUX ;;
+m68*-*-amigaos*)	HDEFINES=-mstackextend ;;
 
 *-*-solaris*)		HOST_64BIT_TYPE="long long"
 			HOST_U_64BIT_TYPE="unsigned long long"
diff --git a/bfd/configure.in b/bfd/configure.in
index f8951e6..3836d37 100644
--- binutils-2.9.1.orig/bfd/configure.in
+++ binutils-2.9.1/bfd/configure.in
@@ -12,6 +12,7 @@ AM_INIT_AUTOMAKE(bfd, 2.9.1)
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
+AC_ARFLAGS
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
 dnl Default to a non shared library.  This may be overridden by the
@@ -385,6 +386,7 @@ do
     # with the two vector lists in targets.c.
     a29kcoff_big_vec)		tb="$tb coff-a29k.lo cofflink.lo" ;;
     a_out_adobe_vec)		tb="$tb aout-adobe.lo aout32.lo" ;;
+    amiga_vec)			tb="$tb amigaos.lo amigaoslink.lo" ;;
     armcoff_little_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armcoff_big_vec)		tb="$tb coff-arm.lo cofflink.lo " ;;
     armpe_little_vec)		tb="$tb pe-arm.lo coff-arm.lo cofflink.lo " ;;
@@ -392,6 +394,7 @@ do
     armpei_little_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     armpei_big_vec)		tb="$tb pei-arm.lo cofflink.lo " ;;
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
+    aout_amiga_vec)		tb="$tb aout-amiga.lo aout32.lo stab-syms.lo";;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
     aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
@@ -420,6 +423,7 @@ do
     bfd_elf32_m88k_vec)		tb="$tb elf32-m88k.lo elf32.lo $elf" ;;
     bfd_elf32_mn10200_vec)	tb="$tb elf-m10200.lo elf32.lo $elf" ;;
     bfd_elf32_mn10300_vec)	tb="$tb elf-m10300.lo elf32.lo $elf" ;;
+    bfd_elf32_morphos_vec)	tb="$tb elf32-morphos.lo elf32.lo $elf";;
     bfd_elf32_powerpc_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_powerpcle_vec)	tb="$tb elf32-ppc.lo elf32.lo $elf" ;;
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index 871299c..bacccc1 100644
--- binutils-2.9.1.orig/bfd/doc/ChangeLog
+++ binutils-2.9.1/bfd/doc/ChangeLog
@@ -41,6 +41,10 @@ Wed Oct  1 14:41:28 1997  Ian Lance Taylor  <ian@cygnus.com>
 	elfcode.h as input files; they don't contribute anything.
 	* Makefile.in: Rebuild.
 
+Mon Aug 25 16:32:00 1997  Steffen Opel  <opel@rumms.uni-mannheim.de>
+
+	* Makefile.in (docs): Add bfd.guide.
+
 Fri Aug 15 04:55:15 1997  Doug Evans  <dje@canuck.cygnus.com>
 
 	* Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC).
diff --git a/bfd/doc/Makefile.am b/bfd/doc/Makefile.am
index 7588273..dcb1580 100644
--- binutils-2.9.1.orig/bfd/doc/Makefile.am
+++ binutils-2.9.1/bfd/doc/Makefile.am
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = cygnus
 
-DOCFILES = aoutx.texi  archive.texi archures.texi \
+DOCFILES = amiga.texi amigalink.texi aoutx.texi  archive.texi archures.texi \
 	bfdt.texi  cache.texi coffcode.texi \
 	core.texi elf.texi elfcode.texi  format.texi  libbfd.texi  \
 	opncls.texi  reloc.texi  section.texi  \
@@ -24,6 +24,7 @@ SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c \
 	$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
 	$(srcdir)/../corefile.c $(srcdir)/../elf.c \
 	$(srcdir)/../elfcode.h  $(srcdir)/../format.c \
+	$(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
 	$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
 	$(srcdir)/../reloc.c  $(srcdir)/../section.c \
 	$(srcdir)/../syms.c  $(srcdir)/../targets.c \
@@ -48,14 +49,14 @@ info_TEXINFOS = bfd.texinfo
 MKDOC = chew$(EXEEXT_FOR_BUILD)
 
 $(MKDOC): chew.o
-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
+	$(CC_FOR_BUILD) $(H_CFLAGS) $(CFLAGS) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
 
 chew.o: chew.c
 	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi bfd.guide: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
@@ -183,6 +184,18 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
 	touch s-linker
 linker.texi: s-linker
 
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
+	$(srcdir)/../../move-if-change amiga.tmp amiga.texi
+	touch s-amiga
+amiga.texi: s-amiga
+
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
+	$(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
+	touch s-amigalink
+amigalink.texi: s-amigalink
+
 libbfd.h: $(srcdir)/../libbfd-in.h	\
 	$(srcdir)/../init.c		\
 	$(srcdir)/../libbfd.c		\
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index cc1a092..3ce08cb 100644
--- binutils-2.9.1.orig/bfd/doc/Makefile.in
+++ binutils-2.9.1/bfd/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -91,7 +97,7 @@ wordsize = @wordsize@
 
 AUTOMAKE_OPTIONS = cygnus
 
-DOCFILES = aoutx.texi  archive.texi archures.texi \
+DOCFILES = amiga.texi amigalink.texi aoutx.texi  archive.texi archures.texi \
 	bfdt.texi  cache.texi coffcode.texi \
 	core.texi elf.texi elfcode.texi  format.texi  libbfd.texi  \
 	opncls.texi  reloc.texi  section.texi  \
@@ -113,6 +119,7 @@ SRCDOC = $(srcdir)/../aoutx.h  $(srcdir)/../archive.c \
 	$(srcdir)/../cache.c $(srcdir)/../coffcode.h \
 	$(srcdir)/../corefile.c $(srcdir)/../elf.c \
 	$(srcdir)/../elfcode.h  $(srcdir)/../format.c \
+	$(srcdir)/../amigaos.c $(srcdir)/../amigaoslink.c \
 	$(srcdir)/../libbfd.c $(srcdir)/../opncls.c \
 	$(srcdir)/../reloc.c  $(srcdir)/../section.c \
 	$(srcdir)/../syms.c  $(srcdir)/../targets.c \
@@ -151,26 +158,35 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = bfd.info
 DVIS = bfd.dvi
 TEXINFOS = bfd.texinfo
+GUIDES = bfd.guide
+GUIDE_DEPS = bfd.guide
+HTMLS = bfd.html
+HTML_DEPS = bfd.html
+PS_S = bfd.ps
+PS_DEPS = bfd.ps
 DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
-default: all
+all: Makefile
 
 .SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+.SUFFIXES: .dvi .guide .html .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps doc/Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 
 bfd.info: bfd.texinfo
+bfd.guide: bfd.texinfo
+bfd.html: bfd.texinfo
+bfd.ps: bfd.dvi
 bfd.dvi: bfd.texinfo
 
 
@@ -178,7 +194,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -186,39 +202,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -229,11 +257,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -246,10 +274,140 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
+	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f bfd.aux bfd.cp bfd.cps bfd.dvi bfd.fn bfd.fns bfd.ky bfd.kys \
 	  bfd.ps bfd.log bfd.pg bfd.toc bfd.tp bfd.tps bfd.vr bfd.vrs \
-	  bfd.op bfd.tr bfd.cv bfd.cn
+	  bfd.op bfd.tr bfd.cv bfd.cn bfd.guide bfd.html bfd.ps
 
 clean-aminfo:
 
@@ -280,6 +438,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -296,8 +457,6 @@ install: install-exec install-data all
 
 uninstall: 
 
-all: Makefile
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
@@ -317,36 +476,45 @@ distclean-generic:
 maintainer-clean-generic:
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-aminfo mostlyclean-generic
+mostlyclean:  mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-generic
 
-clean:  clean-aminfo clean-generic mostlyclean
+clean:  clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-generic mostlyclean
 
-distclean:  distclean-aminfo distclean-generic clean
+distclean:  distclean-aminfo distclean-guide distclean-html \
+		distclean-dvi distclean-ps distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
-maintainer-clean:  maintainer-clean-aminfo maintainer-clean-generic \
-		distclean
+maintainer-clean:  maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
-dvi installcheck install-info install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+.PHONY: install-info-am uninstall-info install-guide uninstall-guide \
+install-ps uninstall-ps install-html uninstall-html install-dvi \
+uninstall-dvi mostlyclean-guide distclean-guide clean-guide \
+maintainer-clean-guide mostlyclean-html distclean-html clean-html \
+maintainer-clean-html mostlyclean-ps distclean-ps clean-ps \
+maintainer-clean-ps mostlyclean-dvi distclean-dvi clean-dvi \
+maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo tags distdir info guide html ps dvi \
+installcheck install-info install-exec install-data install uninstall \
+all installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 $(MKDOC): chew.o
-	$(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
+	$(CC_FOR_BUILD) $(H_CFLAGS) $(CFLAGS) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS)
 
 chew.o: chew.c
 	$(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
 
 protos: libbfd.h libcoff.h bfd.h
 
-bfd.info bfd.dvi: $(DOCFILES) bfdsumm.texi bfd.texinfo
+bfd.info bfd.dvi bfd.guide: $(DOCFILES) bfdsumm.texi bfd.texinfo
 
 # We can't replace these rules with an implicit rule, because
 # makes without VPATH support couldn't find the .h files in `..'.
@@ -474,6 +642,18 @@ s-linker: $(MKDOC) $(srcdir)/../linker.c $(srcdir)/doc.str
 	touch s-linker
 linker.texi: s-linker
 
+s-amiga: $(MKDOC) $(srcdir)/../amigaos.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaos.c >amiga.tmp
+	$(srcdir)/../../move-if-change amiga.tmp amiga.texi
+	touch s-amiga
+amiga.texi: s-amiga
+
+s-amigalink: $(MKDOC) $(srcdir)/../amigaoslink.c $(srcdir)/doc.str
+	./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../amigaoslink.c >amigalink.tmp
+	$(srcdir)/../../move-if-change amigalink.tmp amigalink.texi
+	touch s-amigalink
+amigalink.texi: s-amigalink
+
 libbfd.h: $(srcdir)/../libbfd-in.h	\
 	$(srcdir)/../init.c		\
 	$(srcdir)/../libbfd.c		\
diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo
index dc0f96c..f6c803f 100644
--- binutils-2.9.1.orig/bfd/doc/bfd.texinfo
+++ binutils-2.9.1/bfd/doc/bfd.texinfo
@@ -1,6 +1,6 @@
 \input texinfo.tex
 @setfilename bfd.info
-@c $Id: bfd.texinfo,v 1.29 1997/07/22 18:47:29 ian Exp $
+@c $Id: bfd.texinfo,v 1.1.1.1 2005/03/15 16:00:42 laire Exp $
 @tex
 % NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE
 \global\long\def\example{%
@@ -67,7 +67,7 @@ into another language, under the above conditions for modified versions.
 
 @tex
 \def\$#1${{#1}}  % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.29 $}  % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.1.1.1 $}  % For use in headers, footers too
 {\parskip=0pt
 \hfill Cygnus Support\par
 \hfill sac\@cygnus.com\par
@@ -302,9 +302,10 @@ structures.
 @chapter BFD back ends
 @menu
 * What to Put Where::
-* aout ::	a.out backends
-* coff ::	coff backends
-* elf  ::	elf backends
+* aout  ::	a.out backends
+* coff  ::	coff backends
+* elf   ::	elf backends
+* amiga ::      amigaos backend
 @ignore
 * oasys ::	oasys backends
 * ieee ::	ieee backend
@@ -320,11 +321,15 @@ All of BFD lives in one directory.
 @node coff, elf, aout, BFD back ends
 @include  coffcode.texi
 
-@node elf,  , coff, BFD back ends
+@node elf, amiga  , coff, BFD back ends
 @include  elf.texi
 @c Leave this out until the file has some actual contents...
 @c @include  elfcode.texi
 
+@node amiga,  , elf, BFD back ends
+@include amiga.texi
+@include amigalink.texi
+
 @node Index,  , BFD back ends , Top
 @unnumbered Index
 @printindex cp
diff --git a/bfd/elf32-morphos.c b/bfd/elf32-morphos.c
new file mode 100644
index 0000000..aadcbf7
--- /dev/null
+++ binutils-2.9.1/bfd/elf32-morphos.c
@@ -0,0 +1,5557 @@
+/* PowerPC-specific support for 32-bit ELF
+   Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Written by Ian Lance Taylor, Cygnus Support.
+
+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.  */
+
+/* This file is based on a preliminary PowerPC ELF ABI.  The
+   information may not match the final PowerPC ELF ABI.  It includes
+   suggestions from the in-progress Embedded PowerPC ABI, and that
+   information may also not match.  */
+
+#define ARCH_SIZE		32
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "genlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/ppc.h"
+
+#define USE_RELA		/* we want RELA relocations, not REL */
+
+/* Renaming structures, typedefs, macros and functions to be size-specific.  */
+#define Elf_External_Ehdr	NAME(Elf,External_Ehdr)
+#define Elf_External_Sym	NAME(Elf,External_Sym)
+#define Elf_External_Shdr	NAME(Elf,External_Shdr)
+#define Elf_External_Phdr	NAME(Elf,External_Phdr)
+#define Elf_External_Rel	NAME(Elf,External_Rel)
+#define Elf_External_Rela	NAME(Elf,External_Rela)
+#define Elf_External_Dyn	NAME(Elf,External_Dyn)
+#define elf_core_file_failing_command	NAME(bfd_elf,core_file_failing_command)
+#define elf_core_file_failing_signal	NAME(bfd_elf,core_file_failing_signal)
+#define elf_core_file_matches_executable_p \
+  NAME(bfd_elf,core_file_matches_executable_p)
+#define elf_object_p			NAME(bfd_elf,object_p)
+#define elf_core_file_p			NAME(bfd_elf,core_file_p)
+#define elf_get_symtab_upper_bound	NAME(bfd_elf,get_symtab_upper_bound)
+#define elf_get_dynamic_symtab_upper_bound \
+  NAME(bfd_elf,get_dynamic_symtab_upper_bound)
+#define elf_swap_reloc_in		NAME(bfd_elf,swap_reloc_in)
+#define elf_swap_reloca_in		NAME(bfd_elf,swap_reloca_in)
+#define elf_swap_reloc_out		NAME(bfd_elf,swap_reloc_out)
+#define elf_swap_reloca_out		NAME(bfd_elf,swap_reloca_out)
+#define elf_swap_symbol_in		NAME(bfd_elf,swap_symbol_in)
+#define elf_swap_symbol_out		NAME(bfd_elf,swap_symbol_out)
+#define elf_swap_phdr_in		NAME(bfd_elf,swap_phdr_in)
+#define elf_swap_phdr_out		NAME(bfd_elf,swap_phdr_out)
+#define elf_swap_dyn_in			NAME(bfd_elf,swap_dyn_in)
+#define elf_swap_dyn_out		NAME(bfd_elf,swap_dyn_out)
+#define elf_get_reloc_upper_bound	NAME(bfd_elf,get_reloc_upper_bound)
+#define elf_canonicalize_reloc		NAME(bfd_elf,canonicalize_reloc)
+#define elf_slurp_symbol_table		NAME(bfd_elf,slurp_symbol_table)
+#define elf_get_symtab			NAME(bfd_elf,get_symtab)
+#define elf_canonicalize_dynamic_symtab \
+  NAME(bfd_elf,canonicalize_dynamic_symtab)
+#define elf_make_empty_symbol		NAME(bfd_elf,make_empty_symbol)
+#define elf_get_symbol_info		NAME(bfd_elf,get_symbol_info)
+#define elf_get_lineno			NAME(bfd_elf,get_lineno)
+#define elf_set_arch_mach		NAME(bfd_elf,set_arch_mach)
+#define elf_find_nearest_line		NAME(bfd_elf,find_nearest_line)
+#define elf_sizeof_headers		NAME(bfd_elf,sizeof_headers)
+#define elf_set_section_contents	NAME(bfd_elf,set_section_contents)
+#define elf_no_info_to_howto		NAME(bfd_elf,no_info_to_howto)
+#define elf_no_info_to_howto_rel	NAME(bfd_elf,no_info_to_howto_rel)
+#define elf_find_section		NAME(bfd_elf,find_section)
+#define elf_bfd_link_add_symbols	NAME(bfd_elf,bfd_link_add_symbols)
+#define elf_add_dynamic_entry		NAME(bfd_elf,add_dynamic_entry)
+#define elf_write_shdrs_and_ehdr	NAME(bfd_elf,write_shdrs_and_ehdr)
+#define elf_write_out_phdrs		NAME(bfd_elf,write_out_phdrs)
+#define elf_link_create_dynamic_sections \
+  NAME(bfd_elf,link_create_dynamic_sections)
+#define elf_link_record_dynamic_symbol  _bfd_elf_link_record_dynamic_symbol
+#define elf_bfd_final_link		NAME(bfd_elf,bfd_final_link)
+#define elf_create_pointer_linker_section NAME(bfd_elf,create_pointer_linker_section)
+#define elf_finish_pointer_linker_section NAME(bfd_elf,finish_pointer_linker_section)
+
+#define ELF_R_INFO(X,Y)	ELF32_R_INFO(X,Y)
+#define ELF_R_SYM(X)	ELF32_R_SYM(X)
+#define ELF_R_TYPE(X)	ELF32_R_TYPE(X)
+#define ELFCLASS	ELFCLASS32
+#define FILE_ALIGN	4
+#define LOG_FILE_ALIGN	2
+
+#define put_word	bfd_h_put_32
+#define put_signed_word	bfd_h_put_signed_32
+#define get_word	bfd_h_get_32
+#define get_signed_word	bfd_h_get_signed_32
+
+#define elf_stringtab_init _bfd_elf_stringtab_init
+
+#define section_from_elf_index bfd_section_from_elf_index
+
+static int ddr_count;
+static bfd_byte *ddr_ptr;
+
+/* PowerPC relocations defined by the ABIs */
+enum ppc_reloc_type
+{
+  R_PPC_NONE			=   0,
+  R_PPC_ADDR32			=   1,
+  R_PPC_ADDR24			=   2,
+  R_PPC_ADDR16			=   3,
+  R_PPC_ADDR16_LO		=   4,
+  R_PPC_ADDR16_HI		=   5,
+  R_PPC_ADDR16_HA		=   6,
+  R_PPC_ADDR14			=   7,
+  R_PPC_ADDR14_BRTAKEN		=   8,
+  R_PPC_ADDR14_BRNTAKEN		=   9,
+  R_PPC_REL24			=  10,
+  R_PPC_REL14			=  11,
+  R_PPC_REL14_BRTAKEN		=  12,
+  R_PPC_REL14_BRNTAKEN		=  13,
+  R_PPC_GOT16			=  14,
+  R_PPC_GOT16_LO		=  15,
+  R_PPC_GOT16_HI		=  16,
+  R_PPC_GOT16_HA		=  17,
+  R_PPC_PLTREL24		=  18,
+  R_PPC_COPY			=  19,
+  R_PPC_GLOB_DAT		=  20,
+  R_PPC_JMP_SLOT		=  21,
+  R_PPC_RELATIVE		=  22,
+  R_PPC_LOCAL24PC		=  23,
+  R_PPC_UADDR32			=  24,
+  R_PPC_UADDR16			=  25,
+  R_PPC_REL32			=  26,
+  R_PPC_PLT32			=  27,
+  R_PPC_PLTREL32		=  28,
+  R_PPC_PLT16_LO		=  29,
+  R_PPC_PLT16_HI		=  30,
+  R_PPC_PLT16_HA		=  31,
+  R_PPC_SDAREL16		=  32,
+  R_PPC_SECTOFF			=  33,
+  R_PPC_SECTOFF_LO		=  34,
+  R_PPC_SECTOFF_HI		=  35,
+  R_PPC_SECTOFF_HA		=  36,
+
+  /* The remaining relocs are from the Embedded ELF ABI, and are not
+     in the SVR4 ELF ABI.  */
+  R_PPC_EMB_NADDR32		= 101,
+  R_PPC_EMB_NADDR16		= 102,
+  R_PPC_EMB_NADDR16_LO		= 103,
+  R_PPC_EMB_NADDR16_HI		= 104,
+  R_PPC_EMB_NADDR16_HA		= 105,
+  R_PPC_EMB_SDAI16		= 106,
+  R_PPC_EMB_SDA2I16		= 107,
+  R_PPC_EMB_SDA2REL		= 108,
+  R_PPC_EMB_SDA21		= 109,
+  R_PPC_EMB_MRKREF		= 110,
+  R_PPC_EMB_RELSEC16		= 111,
+  R_PPC_EMB_RELST_LO		= 112,
+  R_PPC_EMB_RELST_HI		= 113,
+  R_PPC_EMB_RELST_HA		= 114,
+  R_PPC_EMB_BIT_FLD		= 115,
+  R_PPC_EMB_RELSDA		= 116,
+
+  /* Special MorphOS relocs. */
+  R_PPC_MORPHOS_DREL		= 200,
+  R_PPC_MORPHOS_DREL_LO		= 201,
+  R_PPC_MORPHOS_DREL_HI		= 202,
+  R_PPC_MORPHOS_DREL_HA		= 203,
+
+  /* This is a phony reloc to handle any old fashioned TOC16 references
+     that may still be in object files.  */
+  R_PPC_TOC16			= 255,
+
+  R_PPC_max
+};
+
+static reloc_howto_type *ppc_elf_reloc_type_lookup
+  PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+static void ppc_elf_info_to_howto
+  PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst));
+static void ppc_elf_howto_init PARAMS ((void));
+static bfd_reloc_status_type ppc_elf_addr16_ha_reloc
+  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword));
+static boolean ppc_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
+static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *));
+
+static int ppc_elf_additional_program_headers PARAMS ((bfd *));
+static boolean ppc_elf_modify_segment_map PARAMS ((bfd *));
+
+static boolean ppc_elf_create_dynamic_sections
+  PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean ppc_elf_section_from_shdr PARAMS ((bfd *,
+						  Elf32_Internal_Shdr *,
+						  char *));
+static boolean ppc_elf_fake_sections
+  PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *));
+
+static elf_linker_section_t *ppc_elf_create_linker_section
+  PARAMS ((bfd *abfd,
+	   struct bfd_link_info *info,
+	   enum elf_linker_section_enum));
+
+static boolean ppc_elf_check_relocs PARAMS ((bfd *,
+					     struct bfd_link_info *,
+					     asection *,
+					     const Elf_Internal_Rela *));
+
+static boolean ppc_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *,
+						      struct elf_link_hash_entry *));
+
+static boolean ppc_elf_adjust_dynindx PARAMS ((struct elf_link_hash_entry *, PTR));
+
+static boolean ppc_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean ppc_elf_relocate_section PARAMS ((bfd *,
+						 struct bfd_link_info *info,
+						 bfd *,
+						 asection *,
+						 bfd_byte *,
+						 Elf_Internal_Rela *relocs,
+						 Elf_Internal_Sym *local_syms,
+						 asection **));
+
+static boolean ppc_elf_add_symbol_hook  PARAMS ((bfd *,
+						 struct bfd_link_info *,
+						 const Elf_Internal_Sym *,
+						 const char **,
+						 flagword *,
+						 asection **,
+						 bfd_vma *));
+
+static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *,
+						      struct bfd_link_info *,
+						      struct elf_link_hash_entry *,
+						      Elf_Internal_Sym *));
+
+static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
+
+static boolean ppc_elf_reloc_link_order PARAMS ((bfd *, struct bfd_link_info *,asection *,
+						 struct bfd_link_order *));
+
+#define BRANCH_PREDICT_BIT 0x200000		/* branch prediction bit for branch taken relocs */
+#define RA_REGISTER_MASK 0x001f0000		/* mask to set RA in memory instructions */
+#define RA_REGISTER_SHIFT 16			/* value to shift register by to insert RA */
+
+/* The name of the dynamic interpreter.  This is put in the .interp
+   section.  */
+
+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
+
+/* The size in bytes of an entry in the procedure linkage table, and of the initial size
+   of the plt reserved for the dynamic linker.  */
+
+#define PLT_ENTRY_SIZE 12
+#define PLT_INITIAL_ENTRY_SIZE 72
+
+
+static reloc_howto_type *ppc_elf_howto_table[ (int)R_PPC_max ];
+
+static reloc_howto_type ppc_elf_howto_raw[] =
+{
+  /* This reloc does nothing.  */
+  HOWTO (R_PPC_NONE,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_NONE",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A standard 32 bit relocation.  */
+  HOWTO (R_PPC_ADDR32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR32",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* An absolute 26 bit branch; the lower two bits must be zero.
+     FIXME: we don't check that, we just clear them.  */
+  HOWTO (R_PPC_ADDR24,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 26,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR24",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x3fffffc,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A standard 16 bit relocation.  */
+  HOWTO (R_PPC_ADDR16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A 16 bit relocation without overflow.  */
+  HOWTO (R_PPC_ADDR16_LO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR16_LO",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* The high order 16 bits of an address.  */
+  HOWTO (R_PPC_ADDR16_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR16_HI",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* The high order 16 bits of an address, plus 1 if the contents of
+     the low 16 bits, treated as a signed number, is negative.	*/
+  HOWTO (R_PPC_ADDR16_HA,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 ppc_elf_addr16_ha_reloc, /* special_function */
+	 "R_PPC_ADDR16_HA",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* An absolute 16 bit branch; the lower two bits must be zero.
+     FIXME: we don't check that, we just clear them.  */
+  HOWTO (R_PPC_ADDR14,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR14",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* An absolute 16 bit branch, for which bit 10 should be set to
+     indicate that the branch is expected to be taken.	The lower two
+     bits must be zero.	 */
+  HOWTO (R_PPC_ADDR14_BRTAKEN,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR14_BRTAKEN",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* An absolute 16 bit branch, for which bit 10 should be set to
+     indicate that the branch is not expected to be taken.  The lower
+     two bits must be zero.  */
+  HOWTO (R_PPC_ADDR14_BRNTAKEN, /* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_ADDR14_BRNTAKEN",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A relative 26 bit branch; the lower two bits must be zero.	 */
+  HOWTO (R_PPC_REL24,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 26,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_REL24",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x3fffffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* A relative 16 bit branch; the lower two bits must be zero.	 */
+  HOWTO (R_PPC_REL14,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_REL14",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* A relative 16 bit branch.	Bit 10 should be set to indicate that
+     the branch is expected to be taken.  The lower two bits must be
+     zero.  */
+  HOWTO (R_PPC_REL14_BRTAKEN,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_REL14_BRTAKEN",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* A relative 16 bit branch.	Bit 10 should be set to indicate that
+     the branch is not expected to be taken.  The lower two bits must
+     be zero.  */
+  HOWTO (R_PPC_REL14_BRNTAKEN,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_REL14_BRNTAKEN",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xfffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16, but referring to the GOT table entry for the
+     symbol.  */
+  HOWTO (R_PPC_GOT16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_GOT16",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_LO, but referring to the GOT table entry for
+     the symbol.  */
+  HOWTO (R_PPC_GOT16_LO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_GOT16_LO",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_HI, but referring to the GOT table entry for
+     the symbol.  */
+  HOWTO (R_PPC_GOT16_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_GOT16_HI",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		 /* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_HA, but referring to the GOT table entry for
+     the symbol.  */
+  HOWTO (R_PPC_GOT16_HA,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 ppc_elf_addr16_ha_reloc, /* special_function */
+	 "R_PPC_GOT16_HA",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_REL24, but referring to the procedure linkage table
+     entry for the symbol.  */
+  HOWTO (R_PPC_PLTREL24,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 26,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed,  /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLTREL24",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x3fffffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* This is used only by the dynamic linker.  The symbol should exist
+     both in the object being run and in some shared library.  The
+     dynamic linker copies the data addressed by the symbol from the
+     shared library into the object, because the object being
+     run has to have the data at some particular address.  */
+  HOWTO (R_PPC_COPY,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	 /* special_function */
+	 "R_PPC_COPY",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_ADDR32, but used when setting global offset table
+     entries.  */
+  HOWTO (R_PPC_GLOB_DAT,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	 /* special_function */
+	 "R_PPC_GLOB_DAT",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Marks a procedure linkage table entry for a symbol.  */
+  HOWTO (R_PPC_JMP_SLOT,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	 /* special_function */
+	 "R_PPC_JMP_SLOT",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Used only by the dynamic linker.  When the object is run, this
+     longword is set to the load address of the object, plus the
+     addend.  */
+  HOWTO (R_PPC_RELATIVE,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	 /* special_function */
+	 "R_PPC_RELATIVE",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_REL24, but uses the value of the symbol within the
+     object rather than the final value.  Normally used for
+     _GLOBAL_OFFSET_TABLE_.  */
+  HOWTO (R_PPC_LOCAL24PC,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 26,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_LOCAL24PC",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x3fffffc,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* Like R_PPC_ADDR32, but may be unaligned.  */
+  HOWTO (R_PPC_UADDR32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_UADDR32",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16, but may be unaligned.  */
+  HOWTO (R_PPC_UADDR16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_UADDR16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 32-bit PC relative */
+  HOWTO (R_PPC_REL32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_REL32",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* 32-bit relocation to the symbol's procedure linkage table.
+     FIXME: not supported. */
+  HOWTO (R_PPC_PLT32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLT32",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 32-bit PC relative relocation to the symbol's procedure linkage table.
+     FIXME: not supported. */
+  HOWTO (R_PPC_PLTREL32,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLTREL32",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 true),			/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_LO, but referring to the PLT table entry for
+     the symbol.  */
+  HOWTO (R_PPC_PLT16_LO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLT16_LO",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_HI, but referring to the PLT table entry for
+     the symbol.  */
+  HOWTO (R_PPC_PLT16_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLT16_HI",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		 /* pcrel_offset */
+
+  /* Like R_PPC_ADDR16_HA, but referring to the PLT table entry for
+     the symbol.  FIXME: Not supported.	 */
+  HOWTO (R_PPC_PLT16_HA,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_PLT16_HA",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A sign-extended 16 bit value relative to _SDA_BASE_, for use with
+     small data items.  */
+  HOWTO (R_PPC_SDAREL16,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_SDAREL16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 32-bit section relative relocation. */
+  HOWTO (R_PPC_SECTOFF,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_SECTOFF",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16-bit lower half section relative relocation. */
+  HOWTO (R_PPC_SECTOFF_LO,	  /* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_SECTOFF_LO",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16-bit upper half section relative relocation. */
+  HOWTO (R_PPC_SECTOFF_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_SECTOFF_HI",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		 /* pcrel_offset */
+
+  /* 16-bit upper half adjusted section relative relocation. */
+  HOWTO (R_PPC_SECTOFF_HA,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_SECTOFF_HA",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* The remaining relocs are from the Embedded ELF ABI, and are not
+     in the SVR4 ELF ABI.  */
+
+  /* 32 bit value resulting from the addend minus the symbol */
+  HOWTO (R_PPC_EMB_NADDR32,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_NADDR32",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16 bit value resulting from the addend minus the symbol */
+  HOWTO (R_PPC_EMB_NADDR16,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_NADDR16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16 bit value resulting from the addend minus the symbol */
+  HOWTO (R_PPC_EMB_NADDR16_LO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_ADDR16_LO",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* The high order 16 bits of the addend minus the symbol */
+  HOWTO (R_PPC_EMB_NADDR16_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_NADDR16_HI", /* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* The high order 16 bits of the result of the addend minus the address,
+     plus 1 if the contents of the low 16 bits, treated as a signed number,
+     is negative.  */
+  HOWTO (R_PPC_EMB_NADDR16_HA,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_NADDR16_HA", /* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16 bit value resulting from allocating a 4 byte word to hold an
+     address in the .sdata section, and returning the offset from
+     _SDA_BASE_ for that relocation */
+  HOWTO (R_PPC_EMB_SDAI16,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_SDAI16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 16 bit value resulting from allocating a 4 byte word to hold an
+     address in the .sdata2 section, and returning the offset from
+     _SDA2_BASE_ for that relocation */
+  HOWTO (R_PPC_EMB_SDA2I16,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_SDA2I16",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* A sign-extended 16 bit value relative to _SDA2_BASE_, for use with
+     small data items.	 */
+  HOWTO (R_PPC_EMB_SDA2REL,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_SDA2REL",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Relocate against either _SDA_BASE_ or _SDA2_BASE_, filling in the 16 bit
+     signed offset from the appropriate base, and filling in the register
+     field with the appropriate register (0, 2, or 13).  */
+  HOWTO (R_PPC_EMB_SDA21,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_SDA21",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Relocation not handled: R_PPC_EMB_MRKREF */
+  /* Relocation not handled: R_PPC_EMB_RELSEC16 */
+  /* Relocation not handled: R_PPC_EMB_RELST_LO */
+  /* Relocation not handled: R_PPC_EMB_RELST_HI */
+  /* Relocation not handled: R_PPC_EMB_RELST_HA */
+  /* Relocation not handled: R_PPC_EMB_BIT_FLD */
+
+  /* PC relative relocation against either _SDA_BASE_ or _SDA2_BASE_, filling
+     in the 16 bit signed offset from the appropriate base, and filling in the
+     register field with the appropriate register (0, 2, or 13).  */
+  HOWTO (R_PPC_EMB_RELSDA,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 true,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_EMB_RELSDA",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Phony reloc to handle AIX style TOC entries */
+  HOWTO (R_PPC_TOC16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_TOC16",		/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* 32-bit relocation relative to _SDA_BASE_ */
+  HOWTO (R_PPC_MORPHOS_DREL,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_MORPHOS_DREL",	/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Lower 16 bits of a relocation relative to _SDA_BASE */
+  HOWTO (R_PPC_MORPHOS_DREL_LO,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 /*complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_MORPHOS_DREL_LO",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+
+  /* Upper 16 bits of a relocation relative to _SDA_BASE */
+  HOWTO (R_PPC_MORPHOS_DREL_HI,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 /*complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_MORPHOS_DREL_HI",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		 /* pcrel_offset */
+
+  /* Upper 16 bits of a relocation relative to _SDA_BASE */
+  HOWTO (R_PPC_MORPHOS_DREL_HA,	/* type */
+	 16,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 false,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 /*complain_overflow_bitfield, /* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_PPC_MORPHOS_DREL_HA",/* name */
+	 false,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0xffff,		/* dst_mask */
+	 false),		/* pcrel_offset */
+};
+
+
+/* Initialize the ppc_elf_howto_table, so that linear accesses can be done.  */
+
+static void
+ppc_elf_howto_init ()
+{
+  unsigned int i, type;
+
+  for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++)
+    {
+      type = ppc_elf_howto_raw[i].type;
+      BFD_ASSERT (type < sizeof(ppc_elf_howto_table) / sizeof(ppc_elf_howto_table[0]));
+      ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i];
+    }
+}
+
+
+static reloc_howto_type *
+ppc_elf_reloc_type_lookup (abfd, code)
+     bfd *abfd;
+     bfd_reloc_code_real_type code;
+{
+  enum ppc_reloc_type ppc_reloc = R_PPC_NONE;
+
+  if (!ppc_elf_howto_table[ R_PPC_ADDR32 ])	/* Initialize howto table if needed */
+    ppc_elf_howto_init ();
+
+  switch ((int)code)
+    {
+    default:
+      return (reloc_howto_type *)NULL;
+
+    case BFD_RELOC_NONE:		ppc_reloc = R_PPC_NONE;			break;
+    case BFD_RELOC_32:			ppc_reloc = R_PPC_ADDR32;		break;
+    case BFD_RELOC_PPC_BA26:		ppc_reloc = R_PPC_ADDR24;		break;
+    case BFD_RELOC_16:			ppc_reloc = R_PPC_ADDR16;		break;
+    case BFD_RELOC_LO16:		ppc_reloc = R_PPC_ADDR16_LO;		break;
+    case BFD_RELOC_HI16:		ppc_reloc = R_PPC_ADDR16_HI;		break;
+    case BFD_RELOC_HI16_S:		ppc_reloc = R_PPC_ADDR16_HA;		break;
+    case BFD_RELOC_PPC_BA16:		ppc_reloc = R_PPC_ADDR14;		break;
+    case BFD_RELOC_PPC_BA16_BRTAKEN:	ppc_reloc = R_PPC_ADDR14_BRTAKEN;	break;
+    case BFD_RELOC_PPC_BA16_BRNTAKEN:	ppc_reloc = R_PPC_ADDR14_BRNTAKEN;	break;
+    case BFD_RELOC_PPC_B26:		ppc_reloc = R_PPC_REL24;		break;
+    case BFD_RELOC_PPC_B16:		ppc_reloc = R_PPC_REL14;		break;
+    case BFD_RELOC_PPC_B16_BRTAKEN:	ppc_reloc = R_PPC_REL14_BRTAKEN;	break;
+    case BFD_RELOC_PPC_B16_BRNTAKEN:	ppc_reloc = R_PPC_REL14_BRNTAKEN;	break;
+    case BFD_RELOC_16_GOTOFF:		ppc_reloc = R_PPC_GOT16;		break;
+    case BFD_RELOC_LO16_GOTOFF:		ppc_reloc = R_PPC_GOT16_LO;		break;
+    case BFD_RELOC_HI16_GOTOFF:		ppc_reloc = R_PPC_GOT16_HI;		break;
+    case BFD_RELOC_HI16_S_GOTOFF:	ppc_reloc = R_PPC_GOT16_HA;		break;
+    case BFD_RELOC_24_PLT_PCREL:	ppc_reloc = R_PPC_PLTREL24;		break;
+    case BFD_RELOC_PPC_COPY:		ppc_reloc = R_PPC_COPY;			break;
+    case BFD_RELOC_PPC_GLOB_DAT:	ppc_reloc = R_PPC_GLOB_DAT;		break;
+    case BFD_RELOC_PPC_LOCAL24PC:	ppc_reloc = R_PPC_LOCAL24PC;		break;
+    case BFD_RELOC_32_PCREL:		ppc_reloc = R_PPC_REL32;		break;
+    case BFD_RELOC_32_PLTOFF:		ppc_reloc = R_PPC_PLT32;		break;
+    case BFD_RELOC_32_PLT_PCREL:	ppc_reloc = R_PPC_PLTREL32;		break;
+    case BFD_RELOC_LO16_PLTOFF:		ppc_reloc = R_PPC_PLT16_LO;		break;
+    case BFD_RELOC_HI16_PLTOFF:		ppc_reloc = R_PPC_PLT16_HI;		break;
+    case BFD_RELOC_HI16_S_PLTOFF:	ppc_reloc = R_PPC_PLT16_HA;		break;
+    case BFD_RELOC_GPREL16:		ppc_reloc = R_PPC_SDAREL16;		break;
+    case BFD_RELOC_32_BASEREL:		ppc_reloc = R_PPC_SECTOFF;		break;
+    case BFD_RELOC_LO16_BASEREL:	ppc_reloc = R_PPC_SECTOFF_LO;		break;
+    case BFD_RELOC_HI16_BASEREL:	ppc_reloc = R_PPC_SECTOFF_HI;		break;
+    case BFD_RELOC_HI16_S_BASEREL:	ppc_reloc = R_PPC_SECTOFF_HA;		break;
+    case BFD_RELOC_CTOR:		ppc_reloc = R_PPC_ADDR32;		break;
+    case BFD_RELOC_PPC_TOC16:		ppc_reloc = R_PPC_TOC16;		break;
+    case BFD_RELOC_PPC_EMB_NADDR32:	ppc_reloc = R_PPC_EMB_NADDR32;		break;
+    case BFD_RELOC_PPC_EMB_NADDR16:	ppc_reloc = R_PPC_EMB_NADDR16;		break;
+    case BFD_RELOC_PPC_EMB_NADDR16_LO:	ppc_reloc = R_PPC_EMB_NADDR16_LO;	break;
+    case BFD_RELOC_PPC_EMB_NADDR16_HI:	ppc_reloc = R_PPC_EMB_NADDR16_HI;	break;
+    case BFD_RELOC_PPC_EMB_NADDR16_HA:	ppc_reloc = R_PPC_EMB_NADDR16_HA;	break;
+    case BFD_RELOC_PPC_EMB_SDAI16:	ppc_reloc = R_PPC_EMB_SDAI16;		break;
+    case BFD_RELOC_PPC_EMB_SDA2I16:	ppc_reloc = R_PPC_EMB_SDA2I16;		break;
+    case BFD_RELOC_PPC_EMB_SDA2REL:	ppc_reloc = R_PPC_EMB_SDA2REL;		break;
+    case BFD_RELOC_PPC_EMB_SDA21:	ppc_reloc = R_PPC_EMB_SDA21;		break;
+    case BFD_RELOC_PPC_EMB_MRKREF:	ppc_reloc = R_PPC_EMB_MRKREF;		break;
+    case BFD_RELOC_PPC_EMB_RELSEC16:	ppc_reloc = R_PPC_EMB_RELSEC16;		break;
+    case BFD_RELOC_PPC_EMB_RELST_LO:	ppc_reloc = R_PPC_EMB_RELST_LO;		break;
+    case BFD_RELOC_PPC_EMB_RELST_HI:	ppc_reloc = R_PPC_EMB_RELST_HI;		break;
+    case BFD_RELOC_PPC_EMB_RELST_HA:	ppc_reloc = R_PPC_EMB_RELST_HA;		break;
+    case BFD_RELOC_PPC_EMB_BIT_FLD:	ppc_reloc = R_PPC_EMB_BIT_FLD;		break;
+    case BFD_RELOC_PPC_EMB_RELSDA:	ppc_reloc = R_PPC_EMB_RELSDA;		break;
+    case BFD_RELOC_PPC_MORPHOS_DREL:	ppc_reloc = R_PPC_MORPHOS_DREL;		break;
+    case BFD_RELOC_PPC_MORPHOS_DREL_LO:	ppc_reloc = R_PPC_MORPHOS_DREL_LO;	break;
+    case BFD_RELOC_PPC_MORPHOS_DREL_HI:	ppc_reloc = R_PPC_MORPHOS_DREL_HI;	break;
+    case BFD_RELOC_PPC_MORPHOS_DREL_HA:	ppc_reloc = R_PPC_MORPHOS_DREL_HA;	break;
+    }
+
+  return ppc_elf_howto_table[ (int)ppc_reloc ];
+};
+
+/* Set the howto pointer for a PowerPC ELF reloc.  */
+
+static void
+ppc_elf_info_to_howto (abfd, cache_ptr, dst)
+     bfd *abfd;
+     arelent *cache_ptr;
+     Elf32_Internal_Rela *dst;
+{
+  if (!ppc_elf_howto_table[ R_PPC_ADDR32 ])	/* Initialize howto table if needed */
+    ppc_elf_howto_init ();
+
+  BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max);
+  cache_ptr->howto = ppc_elf_howto_table[ELF32_R_TYPE (dst->r_info)];
+}
+
+/* Handle the R_PPC_ADDR16_HA reloc.  */
+
+static bfd_reloc_status_type
+ppc_elf_addr16_ha_reloc (abfd, r, symbol, data, sec,
+			 output_bfd, error_message)
+     bfd *abfd;
+     arelent *r;
+     asymbol *symbol;
+     PTR data;
+     asection *sec;
+     bfd *output_bfd;
+     char **error_message;
+{
+  /*bfd_vma relocation;*/
+  if (output_bfd != NULL)
+    {
+      r->address += sec->output_offset;
+      return bfd_reloc_ok;
+    }
+  else
+    {
+      r->address += sec->output_offset;
+      sec->output_section->orelocation[sec->output_section->reloc_count++]=r;
+      return bfd_reloc_ok;
+    }
+
+  /*if (reloc_entry->address > input_section->_cooked_size)
+    return bfd_reloc_outofrange;
+
+  if (bfd_is_com_section (symbol->section))
+    relocation = 0;
+  else
+    relocation = symbol->value;
+
+  relocation += symbol->section->output_section->vma;
+  relocation += symbol->section->output_offset;
+  relocation += reloc_entry->addend;
+
+  reloc_entry->addend += (relocation & 0x8000) << 1;
+
+  return bfd_reloc_continue;*/
+}
+
+/* Function to set whether a module needs the -mrelocatable bit set. */
+
+static boolean
+ppc_elf_set_private_flags (abfd, flags)
+     bfd *abfd;
+     flagword flags;
+{
+  BFD_ASSERT (!elf_flags_init (abfd)
+	      || elf_elfheader (abfd)->e_flags == flags);
+
+  elf_elfheader (abfd)->e_flags = flags;
+  elf_flags_init (abfd) = true;
+  return true;
+}
+
+/* Copy backend specific data from one object module to another */
+static boolean
+ppc_elf_copy_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+
+  BFD_ASSERT (!elf_flags_init (obfd)
+	      || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
+
+  elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
+  elf_flags_init (obfd) = true;
+  return true;
+}
+
+/* Merge backend specific data from an object file to the output
+   object file when linking */
+static boolean
+ppc_elf_merge_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  flagword old_flags;
+  flagword new_flags;
+  boolean error;
+
+  /* Check if we have the same endianess */
+  if (ibfd->xvec->byteorder != obfd->xvec->byteorder
+      && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN)
+    {
+      (*_bfd_error_handler)
+	("%s: compiled for a %s endian system and target is %s endian",
+	 bfd_get_filename (ibfd),
+	 bfd_big_endian (ibfd) ? "big" : "little",
+	 bfd_big_endian (obfd) ? "big" : "little");
+
+      bfd_set_error (bfd_error_wrong_format);
+      return false;
+    }
+
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+
+  new_flags = elf_elfheader (ibfd)->e_flags;
+  old_flags = elf_elfheader (obfd)->e_flags;
+  if (!elf_flags_init (obfd))	/* First call, no flags set */
+    {
+      elf_flags_init (obfd) = true;
+      elf_elfheader (obfd)->e_flags = new_flags;
+    }
+
+  else if (new_flags == old_flags)	/* Compatible flags are ok */
+    ;
+
+  else					/* Incompatible flags */
+    {
+      /* Warn about -mrelocatable mismatch.  Allow -mrelocatable-lib to be linked
+         with either.  */
+      error = false;
+      if ((new_flags & EF_PPC_RELOCATABLE) != 0
+	  && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0)
+	{
+	  error = true;
+	  (*_bfd_error_handler)
+	    ("%s: compiled with -mrelocatable and linked with modules compiled normally",
+	     bfd_get_filename (ibfd));
+	}
+      else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0
+	       && (old_flags & EF_PPC_RELOCATABLE) != 0)
+	{
+	  error = true;
+	  (*_bfd_error_handler)
+	    ("%s: compiled normally and linked with modules compiled with -mrelocatable",
+	     bfd_get_filename (ibfd));
+	}
+      /* If -mrelocatable-lib is linked with an object without -mrelocatable-lib, turn off
+	 the -mrelocatable-lib, since at least one module isn't relocatable.  */
+      else if ((old_flags & EF_PPC_RELOCATABLE_LIB) != 0
+	       && (new_flags & EF_PPC_RELOCATABLE_LIB) == 0)
+	elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB;
+
+
+      /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */
+      elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB);
+
+      new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+      old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
+
+      /* Warn about any other mismatches */
+      if (new_flags != old_flags)
+	{
+	  error = true;
+	  (*_bfd_error_handler)
+	    ("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
+	     bfd_get_filename (ibfd), (long)new_flags, (long)old_flags);
+	}
+
+      if (error)
+	{
+	  bfd_set_error (bfd_error_bad_value);
+	  return false;
+	}
+    }
+
+  return true;
+}
+
+
+/* Handle a PowerPC specific section when reading an object file.  This
+   is called when elfcode.h finds a section with an unknown type.  */
+
+static boolean
+ppc_elf_section_from_shdr (abfd, hdr, name)
+     bfd *abfd;
+     Elf32_Internal_Shdr *hdr;
+     char *name;
+{
+  asection *newsect;
+  flagword flags;
+
+  if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
+    return false;
+
+  newsect = hdr->bfd_section;
+  flags = bfd_get_section_flags (abfd, newsect);
+  if (hdr->sh_flags & SHF_EXCLUDE)
+    flags |= SEC_EXCLUDE;
+
+  if (hdr->sh_type == SHT_ORDERED)
+    flags |= SEC_SORT_ENTRIES;
+
+  bfd_set_section_flags (abfd, newsect, flags);
+  return true;
+}
+
+
+/* Set up any other section flags and such that may be necessary.  */
+
+static boolean
+ppc_elf_fake_sections (abfd, shdr, asect)
+     bfd *abfd;
+     Elf32_Internal_Shdr *shdr;
+     asection *asect;
+{
+  if ((asect->flags & SEC_EXCLUDE) != 0)
+    shdr->sh_flags |= SHF_EXCLUDE;
+
+  if ((asect->flags & SEC_SORT_ENTRIES) != 0)
+    shdr->sh_type = SHT_ORDERED;
+
+  return true;
+}
+
+
+/* Create a special linker section */
+static elf_linker_section_t *
+ppc_elf_create_linker_section (abfd, info, which)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     enum elf_linker_section_enum which;
+{
+  bfd *dynobj = elf_hash_table (info)->dynobj;
+  elf_linker_section_t *lsect;
+
+  /* Record the first bfd section that needs the special section */
+  if (!dynobj)
+    dynobj = elf_hash_table (info)->dynobj = abfd;
+
+  /* If this is the first time, create the section */
+  lsect = elf_linker_section (dynobj, which);
+  if (!lsect)
+    {
+      elf_linker_section_t defaults;
+      static elf_linker_section_t zero_section;
+
+      defaults = zero_section;
+      defaults.which = which;
+      defaults.hole_written_p = false;
+      defaults.alignment = 2;
+
+      /* Both of these sections are (technically) created by the user
+	 putting data in them, so they shouldn't be marked
+	 SEC_LINKER_CREATED.
+
+	 The linker creates them so it has somewhere to attach their
+	 respective symbols. In fact, if they were empty it would
+	 be OK to leave the symbol set to 0 (or any random number), because
+	 the appropriate register should never be used.  */
+      defaults.flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+			| SEC_IN_MEMORY);
+
+      switch (which)
+	{
+	default:
+	  (*_bfd_error_handler) ("%s: Unknown special linker type %d",
+				 bfd_get_filename (abfd),
+				 (int)which);
+
+	  bfd_set_error (bfd_error_bad_value);
+	  return (elf_linker_section_t *)0;
+
+	case LINKER_SECTION_SDATA:	/* .sdata/.sbss section */
+	  defaults.name		  = ".sdata";
+	  defaults.rel_name	  = ".rela.sdata";
+	  defaults.bss_name	  = ".sbss";
+	  defaults.sym_name	  = "_SDA_BASE_";
+	  defaults.sym_offset	  = 32768;
+	  break;
+
+	case LINKER_SECTION_SDATA2:	/* .sdata2/.sbss2 section */
+	  defaults.name		  = ".sdata2";
+	  defaults.rel_name	  = ".rela.sdata2";
+	  defaults.bss_name	  = ".sbss2";
+	  defaults.sym_name	  = "_SDA2_BASE_";
+	  defaults.sym_offset	  = 32768;
+	  defaults.flags	 |= SEC_READONLY;
+	  break;
+	}
+
+      lsect = _bfd_elf_create_linker_section (abfd, info, which, &defaults);
+    }
+
+  return lsect;
+}
+
+
+/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we need to bump up
+   the number of section headers.  */
+
+static int
+ppc_elf_additional_program_headers (abfd)
+     bfd *abfd;
+{
+  asection *s;
+  int ret;
+
+  ret = 0;
+
+  s = bfd_get_section_by_name (abfd, ".interp");
+  if (s != NULL)
+    ++ret;
+
+  s = bfd_get_section_by_name (abfd, ".sbss2");
+  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+    ++ret;
+
+  s = bfd_get_section_by_name (abfd, ".PPC.EMB.sbss0");
+  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+    ++ret;
+
+  return ret;
+}
+
+/* Modify the segment map if needed */
+
+static boolean
+ppc_elf_modify_segment_map (abfd)
+     bfd *abfd;
+{
+  return true;
+}
+
+/* We have to create .dynsbss and .rela.sbss here so that they get mapped
+   to output sections (just like _bfd_elf_create_dynamic_sections has
+   to create .dynbss and .rela.bss).  */
+
+static boolean
+ppc_elf_create_dynamic_sections (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  register asection *s;
+  flagword flags;
+
+  if (!_bfd_elf_create_dynamic_sections(abfd, info))
+    return false;
+
+  flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+	   | SEC_LINKER_CREATED);
+
+  s = bfd_make_section (abfd, ".dynsbss");
+  if (s == NULL
+      || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+    return false;
+
+  if (! info->shared)
+    {
+      s = bfd_make_section (abfd, ".rela.sbss");
+      if (s == NULL
+	  || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
+	  || ! bfd_set_section_alignment (abfd, s, 2))
+	return false;
+    }
+  return true;
+}
+
+/* Adjust a symbol defined by a dynamic object and referenced by a
+   regular object.  The current definition is in some section of the
+   dynamic object, but we're not including those sections.  We have to
+   change the definition to something the rest of the link can
+   understand.  */
+
+static boolean
+ppc_elf_adjust_dynamic_symbol (info, h)
+     struct bfd_link_info *info;
+     struct elf_link_hash_entry *h;
+{
+  bfd *dynobj = elf_hash_table (info)->dynobj;
+  asection *s;
+  unsigned int power_of_two;
+  bfd_vma plt_offset;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", h->root.root.string);
+#endif
+
+  /* Make sure we know what is going on here.  */
+  BFD_ASSERT (dynobj != NULL
+	      && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
+		  || h->weakdef != NULL
+		  || ((h->elf_link_hash_flags
+		       & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+		      && (h->elf_link_hash_flags
+			  & ELF_LINK_HASH_REF_REGULAR) != 0
+		      && (h->elf_link_hash_flags
+			  & ELF_LINK_HASH_DEF_REGULAR) == 0)));
+
+
+  /* If this is a function, put it in the procedure linkage table.  We
+     will fill in the contents of the procedure linkage table later,
+     when we know the address of the .got section.  */
+  if (h->type == STT_FUNC
+      || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
+    {
+      if (! info->shared
+	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+	  && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
+	{
+	  /* This case can occur if we saw a PLT32 reloc in an input
+             file, but the symbol was never referred to by a dynamic
+             object.  In such a case, we don't actually need to build
+             a procedure linkage table, and we can just do a PC32
+             reloc instead.  */
+	  BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+	  return true;
+	}
+
+      /* Make sure this symbol is output as a dynamic symbol.  */
+      if (h->dynindx == -1)
+	{
+	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	    return false;
+	}
+      BFD_ASSERT (h->dynindx != -1);
+
+      s = bfd_get_section_by_name (dynobj, ".plt");
+      BFD_ASSERT (s != NULL);
+
+      /* If this is the first .plt entry, make room for the special
+	 first entry.  */
+      if (s->_raw_size == 0)
+	s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
+
+      /* The PowerPC PLT is actually composed of two parts, the first part
+	 is 2 words (for a load and a jump), and then there is a remaining
+	 word available at the end.  */
+      plt_offset = (PLT_INITIAL_ENTRY_SIZE
+		    + 8 * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE));
+
+      /* If this symbol is not defined in a regular file, and we are
+	 not generating a shared library, then set the symbol to this
+	 location in the .plt.  This is required to make function
+	 pointers compare as equal between the normal executable and
+	 the shared library.  */
+      if (! info->shared
+	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+	{
+	  h->root.u.def.section = s;
+	  h->root.u.def.value = plt_offset;
+	}
+
+      h->plt_offset = plt_offset;
+
+      /* Make room for this entry.  */
+      s->_raw_size += PLT_ENTRY_SIZE;
+
+      /* We also need to make an entry in the .rela.plt section.  */
+      s = bfd_get_section_by_name (dynobj, ".rela.plt");
+      BFD_ASSERT (s != NULL);
+      s->_raw_size += sizeof (Elf32_External_Rela);
+
+      return true;
+    }
+
+  /* If this is a weak symbol, and there is a real definition, the
+     processor independent code will have arranged for us to see the
+     real definition first, and we can just use the same value.  */
+  if (h->weakdef != NULL)
+    {
+      BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined
+		  || h->weakdef->root.type == bfd_link_hash_defweak);
+      h->root.u.def.section = h->weakdef->root.u.def.section;
+      h->root.u.def.value = h->weakdef->root.u.def.value;
+      return true;
+    }
+
+  /* This is a reference to a symbol defined by a dynamic object which
+     is not a function.  */
+
+  /* If we are creating a shared library, we must presume that the
+     only references to the symbol are via the global offset table.
+     For such cases we need not do anything here; the relocations will
+     be handled correctly by relocate_section.  */
+  if (info->shared)
+    return true;
+
+  /* We must allocate the symbol in our .dynbss section, which will
+     become part of the .bss section of the executable.  There will be
+     an entry for this symbol in the .dynsym section.  The dynamic
+     object will contain position independent code, so all references
+     from the dynamic object to this symbol will go through the global
+     offset table.  The dynamic linker will use the .dynsym entry to
+     determine the address it must put in the global offset table, so
+     both the dynamic object and the regular object will refer to the
+     same memory location for the variable.
+
+     Of course, if the symbol is sufficiently small, we must instead
+     allocate it in .sbss.  FIXME: It would be better to do this if and
+     only if there were actually SDAREL relocs for that symbol.  */
+
+  if (h->size <= elf_gp_size (dynobj))
+    s = bfd_get_section_by_name (dynobj, ".dynsbss");
+  else
+    s = bfd_get_section_by_name (dynobj, ".dynbss");
+  BFD_ASSERT (s != NULL);
+
+  /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to
+     copy the initial value out of the dynamic object and into the
+     runtime process image.  We need to remember the offset into the
+     .rela.bss section we are going to use.  */
+  if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
+    {
+      asection *srel;
+
+      if (h->size <= elf_gp_size (dynobj))
+	srel = bfd_get_section_by_name (dynobj, ".rela.sbss");
+      else
+	srel = bfd_get_section_by_name (dynobj, ".rela.bss");
+      BFD_ASSERT (srel != NULL);
+      srel->_raw_size += sizeof (Elf32_External_Rela);
+      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
+    }
+
+  /* We need to figure out the alignment required for this symbol.  I
+     have no idea how ELF linkers handle this.  */
+  power_of_two = bfd_log2 (h->size);
+  if (power_of_two > 4)
+    power_of_two = 4;
+
+  /* Apply the required alignment.  */
+  s->_raw_size = BFD_ALIGN (s->_raw_size,
+			    (bfd_size_type) (1 << power_of_two));
+  if (power_of_two > bfd_get_section_alignment (dynobj, s))
+    {
+      if (! bfd_set_section_alignment (dynobj, s, power_of_two))
+	return false;
+    }
+
+  /* Define the symbol as being at this point in the section.  */
+  h->root.u.def.section = s;
+  h->root.u.def.value = s->_raw_size;
+
+  /* Increment the section size to make room for the symbol.  */
+  s->_raw_size += h->size;
+
+  return true;
+}
+
+
+/* Increment the index of a dynamic symbol by a given amount.  Called
+   via elf_link_hash_traverse.  */
+
+static boolean
+ppc_elf_adjust_dynindx (h, cparg)
+     struct elf_link_hash_entry *h;
+     PTR cparg;
+{
+  int *cp = (int *) cparg;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_adjust_dynindx called, h->dynindx = %d, *cp = %d\n", h->dynindx, *cp);
+#endif
+
+  if (h->dynindx != -1)
+    h->dynindx += *cp;
+
+  return true;
+}
+
+
+/* Set the sizes of the dynamic sections.  */
+
+static boolean
+ppc_elf_size_dynamic_sections (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+{
+  bfd *dynobj;
+  asection *s;
+  boolean plt;
+  boolean relocs;
+  boolean reltext;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_size_dynamic_sections called\n");
+#endif
+
+  dynobj = elf_hash_table (info)->dynobj;
+  BFD_ASSERT (dynobj != NULL);
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      /* Set the contents of the .interp section to the interpreter.  */
+      if (! info->shared)
+	{
+	  s = bfd_get_section_by_name (dynobj, ".interp");
+	  BFD_ASSERT (s != NULL);
+	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+	}
+    }
+  else
+    {
+      /* We may have created entries in the .rela.got, .rela.sdata, and
+	 .rela.sdata2 sections.  However, if we are not creating the
+	 dynamic sections, we will not actually use these entries.  Reset
+	 the size of .rela.got, et al, which will cause it to get
+	 stripped from the output file below.  */
+      static char *rela_sections[] = { ".rela.got", ".rela.sdata",
+				       ".rela.sdata2", ".rela.sbss",
+				       (char *)0 };
+      char **p;
+
+      for (p = rela_sections; *p != (char *)0; p++)
+	{
+	  s = bfd_get_section_by_name (dynobj, *p);
+	  if (s != NULL)
+	    s->_raw_size = 0;
+	}
+    }
+
+  /* The check_relocs and adjust_dynamic_symbol entry points have
+     determined the sizes of the various dynamic sections.  Allocate
+     memory for them.  */
+  plt = false;
+  relocs = false;
+  reltext = false;
+  for (s = dynobj->sections; s != NULL; s = s->next)
+    {
+      const char *name;
+      boolean strip;
+
+      if ((s->flags & SEC_LINKER_CREATED) == 0)
+	continue;
+
+      /* It's OK to base decisions on the section name, because none
+	 of the dynobj section names depend upon the input files.  */
+      name = bfd_get_section_name (dynobj, s);
+
+      strip = false;
+
+      if (strcmp (name, ".plt") == 0)
+	{
+	  if (s->_raw_size == 0)
+	    {
+	      /* Strip this section if we don't need it; see the
+                 comment below.  */
+	      strip = true;
+	    }
+	  else
+	    {
+	      /* Remember whether there is a PLT.  */
+	      plt = true;
+	    }
+	}
+      else if (strncmp (name, ".rela", 5) == 0)
+	{
+	  if (s->_raw_size == 0)
+	    {
+	      /* If we don't need this section, strip it from the
+		 output file.  This is mostly to handle .rela.bss and
+		 .rela.plt.  We must create both sections in
+		 create_dynamic_sections, because they must be created
+		 before the linker maps input sections to output
+		 sections.  The linker does that before
+		 adjust_dynamic_symbol is called, and it is that
+		 function which decides whether anything needs to go
+		 into these sections.  */
+	      strip = true;
+	    }
+	  else
+	    {
+	      asection *target;
+	      const char *outname;
+
+	      /* Remember whether there are any relocation sections. */
+	      relocs = true;
+
+	      /* If this relocation section applies to a read only
+		 section, then we probably need a DT_TEXTREL entry.  */
+	      outname = bfd_get_section_name (output_bfd,
+					      s->output_section);
+	      target = bfd_get_section_by_name (output_bfd, outname + 5);
+	      if (target != NULL
+		  && (target->flags & SEC_READONLY) != 0
+		  && (target->flags & SEC_ALLOC) != 0)
+		reltext = true;
+
+	      /* We use the reloc_count field as a counter if we need
+		 to copy relocs into the output file.  */
+	      s->reloc_count = 0;
+	    }
+	}
+      else if (strcmp (name, ".got") != 0
+	       && strcmp (name, ".sdata") != 0
+	       && strcmp (name, ".sdata2") != 0)
+	{
+	  /* It's not one of our sections, so don't allocate space.  */
+	  continue;
+	}
+
+      if (strip)
+	{
+	  asection **spp;
+
+	  for (spp = &s->output_section->owner->sections;
+	       *spp != s->output_section;
+	       spp = &(*spp)->next)
+	    ;
+	  *spp = s->output_section->next;
+	  --s->output_section->owner->section_count;
+
+	  continue;
+	}
+
+      /* Allocate memory for the section contents.  */
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      if (s->contents == NULL && s->_raw_size != 0)
+	return false;
+    }
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      /* Add some entries to the .dynamic section.  We fill in the
+	 values later, in ppc_elf_finish_dynamic_sections, but we
+	 must add the entries now so that we get the correct size for
+	 the .dynamic section.  The DT_DEBUG entry is filled in by the
+	 dynamic linker and used by the debugger.  */
+      if (! info->shared)
+	{
+	  if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+	    return false;
+	}
+
+      if (plt)
+	{
+	  if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
+	      || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+	      || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+	      || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
+	    return false;
+	}
+
+      if (relocs)
+	{
+	  if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0)
+	      || ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0)
+	      || ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT,
+						sizeof (Elf32_External_Rela)))
+	    return false;
+	}
+
+      if (reltext)
+	{
+	  if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+	    return false;
+	}
+    }
+
+  /* If we are generating a shared library, we generate a section
+     symbol for each output section.  These are local symbols, which
+     means that they must come first in the dynamic symbol table.
+     That means we must increment the dynamic symbol index of every
+     other dynamic symbol.
+
+     FIXME: We assume that there will never be relocations to
+     locations in linker-created sections that do not have
+     externally-visible names. Instead, we should work out precisely
+     which sections relocations are targetted at.  */
+  if (info->shared)
+    {
+      int c;
+
+      for (c = 0, s = output_bfd->sections; s != NULL; s = s->next)
+	{
+	  if ((s->flags & SEC_LINKER_CREATED) != 0
+	      || (s->flags & SEC_ALLOC) == 0)
+	    {
+	      elf_section_data (s)->dynindx = -1;
+	      continue;
+	    }
+
+	  /* These symbols will have no names, so we don't need to
+	     fiddle with dynstr_index.  */
+
+	  elf_section_data (s)->dynindx = c + 1;
+
+	  c++;
+	}
+
+      elf_link_hash_traverse (elf_hash_table (info),
+			      ppc_elf_adjust_dynindx,
+			      (PTR) &c);
+      elf_hash_table (info)->dynsymcount += c;
+    }
+
+  return true;
+}
+
+
+/* Look through the relocs for a section during the first phase, and
+   allocate space in the global offset table or procedure linkage
+   table.  */
+
+static boolean
+ppc_elf_check_relocs (abfd, info, sec, relocs)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     asection *sec;
+     const Elf_Internal_Rela *relocs;
+{
+  boolean ret = true;
+  bfd *dynobj;
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  const Elf_Internal_Rela *rel;
+  const Elf_Internal_Rela *rel_end;
+  bfd_vma *local_got_offsets;
+  elf_linker_section_t *sdata;
+  elf_linker_section_t *sdata2;
+  asection *sreloc;
+  asection *sgot;
+  asection *srelgot = NULL;
+
+  if (info->relocateable)
+    return true;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n",
+	   bfd_get_section_name (abfd, sec),
+	   bfd_get_filename (abfd));
+#endif
+
+  /* Create the linker generated sections all the time so that the
+     special symbols are created.  */
+
+  if ((sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA)) == NULL)
+    {
+      sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA);
+      if (!sdata)
+	ret = false;
+    }
+
+
+  if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL)
+    {
+      sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2);
+      if (!sdata2)
+	ret = false;
+    }
+
+  dynobj = elf_hash_table (info)->dynobj;
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (abfd);
+  local_got_offsets = elf_local_got_offsets (abfd);
+
+  /* FIXME: We should only create the .got section if we need it.
+     Otherwise we waste space in a statically linked executable.  */
+
+  if (! _bfd_elf_create_got_section (dynobj, info))
+    return false;
+  sgot = bfd_get_section_by_name (dynobj, ".got");
+  BFD_ASSERT (sgot != NULL);
+
+  sreloc = NULL;
+
+  rel_end = relocs + sec->reloc_count;
+  for (rel = relocs; rel < rel_end; rel++)
+    {
+      unsigned long r_symndx;
+      struct elf_link_hash_entry *h;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      if (r_symndx < symtab_hdr->sh_info)
+	h = NULL;
+      else
+	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+
+      switch (ELF32_R_TYPE (rel->r_info))
+	{
+	/* GOT16 relocations */
+	case R_PPC_GOT16:
+	case R_PPC_GOT16_LO:
+	case R_PPC_GOT16_HI:
+	case R_PPC_GOT16_HA:
+	  if (srelgot == NULL
+	      && (h != NULL || info->shared))
+	    {
+	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+	      if (srelgot == NULL)
+		{
+		  srelgot = bfd_make_section (dynobj, ".rela.got");
+		  if (srelgot == NULL
+		      || ! bfd_set_section_flags (dynobj, srelgot,
+						  (SEC_ALLOC
+						   | SEC_LOAD
+						   | SEC_HAS_CONTENTS
+						   | SEC_IN_MEMORY
+						   | SEC_LINKER_CREATED
+						   | SEC_READONLY))
+		      || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+		    return false;
+		}
+	    }
+
+	  if (h != NULL)
+	    {
+	      if (h->got_offset != (bfd_vma) -1)
+		{
+		  /* We have already allocated space in the .got.  */
+		  break;
+		}
+	      h->got_offset = sgot->_raw_size;
+
+	      /* Make sure this symbol is output as a dynamic symbol.  */
+	      if (h->dynindx == -1)
+		{
+		  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+		    return false;
+		}
+	      BFD_ASSERT(h->dynindx != -1);
+
+	      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	    }
+	  else
+	    {
+	      /* This is a global offset table entry for a local
+                 symbol.  */
+	      if (local_got_offsets == NULL)
+		{
+		  size_t size;
+		  register unsigned int i;
+
+		  size = symtab_hdr->sh_info * sizeof (bfd_vma);
+		  local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
+		  if (local_got_offsets == NULL)
+		    return false;
+		  elf_local_got_offsets (abfd) = local_got_offsets;
+		  for (i = 0; i < symtab_hdr->sh_info; i++)
+		    local_got_offsets[i] = (bfd_vma) -1;
+		}
+	      if (local_got_offsets[r_symndx] != (bfd_vma) -1)
+		{
+		  /* We have already allocated space in the .got.  */
+		  break;
+		}
+	      local_got_offsets[r_symndx] = sgot->_raw_size;
+
+	      if (info->shared)
+		{
+		  /* If we are generating a shared object, we need to
+                     output a R_PPC_RELATIVE reloc so that the
+                     dynamic linker can adjust this GOT entry.  */
+		  srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		}
+	    }
+
+	  sgot->_raw_size += 4;
+
+	  break;
+
+	/* Indirect .sdata relocation */
+	case R_PPC_EMB_SDAI16:
+	  if (info->shared)
+	    {
+	      (*_bfd_error_handler) ("%s: relocation %s cannot be used when making a shared object",
+				     bfd_get_filename (abfd),
+				     "R_PPC_EMB_SDAI16");
+	      ret = false;
+	      break;
+	    }
+
+	  if (srelgot == NULL
+	      && (h != NULL || info->shared))
+	    {
+	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+	      if (srelgot == NULL)
+		{
+		  srelgot = bfd_make_section (dynobj, ".rela.got");
+		  if (srelgot == NULL
+		      || ! bfd_set_section_flags (dynobj, srelgot,
+						  (SEC_ALLOC
+						   | SEC_LOAD
+						   | SEC_HAS_CONTENTS
+						   | SEC_IN_MEMORY
+						   | SEC_LINKER_CREATED
+						   | SEC_READONLY))
+		      || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+		    return false;
+		}
+	    }
+
+	  if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata, h, rel))
+	    ret = false;
+
+	  break;
+
+	/* Indirect .sdata2 relocation */
+	case R_PPC_EMB_SDA2I16:
+	  if (info->shared)
+	    {
+	      (*_bfd_error_handler) ("%s: relocation %s cannot be used when making a shared object",
+				     bfd_get_filename (abfd),
+				     "R_PPC_EMB_SDA2I16");
+	      ret = false;
+	      break;
+	    }
+
+	  if (srelgot == NULL
+	      && (h != NULL || info->shared))
+	    {
+	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+	      if (srelgot == NULL)
+		{
+		  srelgot = bfd_make_section (dynobj, ".rela.got");
+		  if (srelgot == NULL
+		      || ! bfd_set_section_flags (dynobj, srelgot,
+						  (SEC_ALLOC
+						   | SEC_LOAD
+						   | SEC_HAS_CONTENTS
+						   | SEC_IN_MEMORY
+						   | SEC_LINKER_CREATED
+						   | SEC_READONLY))
+		      || ! bfd_set_section_alignment (dynobj, srelgot, 2))
+		    return false;
+		}
+	    }
+
+	  if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata2, h, rel))
+	    return false;
+
+	  break;
+
+	case R_PPC_SDAREL16:
+	case R_PPC_EMB_SDA2REL:
+	case R_PPC_EMB_SDA21:
+	  if (info->shared)
+	    {
+	      (*_bfd_error_handler) ("%s: relocation %s cannot be used when making a shared object",
+				     bfd_get_filename (abfd),
+				     ppc_elf_howto_table[(int)ELF32_R_TYPE (rel->r_info)]->name);
+	      ret = false;
+	    }
+	  break;
+
+	case R_PPC_PLT32:
+	case R_PPC_PLTREL24:
+	case R_PPC_PLT16_LO:
+	case R_PPC_PLT16_HI:
+	case R_PPC_PLT16_HA:
+#ifdef DEBUG
+	  fprintf (stderr, "Reloc requires a PLT entry\n");
+#endif
+	  /* This symbol requires a procedure linkage table entry.  We
+             actually build the entry in adjust_dynamic_symbol,
+             because this might be a case of linking PIC code without
+             linking in any dynamic objects, in which case we don't
+             need to generate a procedure linkage table after all.  */
+
+	  if (h == NULL)
+	    {
+	      /* It does not make sense to have a procedure linkage
+                 table entry for a local symbol.  */
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      break;
+	    }
+
+	  /* Make sure this symbol is output as a dynamic symbol.  */
+	  if (h->dynindx == -1)
+	    {
+	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+		{
+		  ret = false;
+		  break;
+		}
+	    }
+
+	  h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+	  break;
+
+	  /* The following relocations don't need to propagate the
+	     relocation if linking a shared object since they are
+	     section relative.  */
+	case R_PPC_SECTOFF:
+	case R_PPC_SECTOFF_LO:
+	case R_PPC_SECTOFF_HI:
+	case R_PPC_SECTOFF_HA:
+	  break;
+
+	  /* This refers only to functions defined in the shared library */
+	case R_PPC_LOCAL24PC:
+	  break;
+
+	  /* When creating a shared object, we must copy these
+	     relocs into the output file.  We create a reloc
+	     section in dynobj and make room for the reloc.  */
+	case R_PPC_REL24:
+	case R_PPC_REL14:
+	case R_PPC_REL14_BRTAKEN:
+	case R_PPC_REL14_BRNTAKEN:
+	case R_PPC_REL32:
+	  if (h == NULL
+	      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+	    break;
+	  /* fall through */
+
+	default:
+	  if (info->shared)
+	    {
+#ifdef DEBUG
+	      fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n",
+		       (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+#endif
+	      if (sreloc == NULL)
+		{
+		  const char *name;
+
+		  name = (bfd_elf_string_from_elf_section
+			  (abfd,
+			   elf_elfheader (abfd)->e_shstrndx,
+			   elf_section_data (sec)->rel_hdr.sh_name));
+		  if (name == NULL)
+		    {
+		      ret = false;
+		      break;
+		    }
+
+		  BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+			      && strcmp (bfd_get_section_name (abfd, sec),
+					 name + 5) == 0);
+
+		  sreloc = bfd_get_section_by_name (dynobj, name);
+		  if (sreloc == NULL)
+		    {
+		      flagword flags;
+
+		      sreloc = bfd_make_section (dynobj, name);
+		      flags = (SEC_HAS_CONTENTS | SEC_READONLY
+			       | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+		      if ((sec->flags & SEC_ALLOC) != 0)
+			flags |= SEC_ALLOC | SEC_LOAD;
+		      if (sreloc == NULL
+			  || ! bfd_set_section_flags (dynobj, sreloc, flags)
+			  || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+			return false;
+		    }
+		}
+
+	      sreloc->_raw_size += sizeof (Elf32_External_Rela);
+
+	      /* FIXME: We should here do what the m68k and i386
+		 backends do: if the reloc is pc-relative, record it
+		 in case it turns out that the reloc is unnecessary
+		 because the symbol is forced local by versioning or
+		 we are linking with -Bdynamic.  Fortunately this
+		 case is not frequent.  */
+	    }
+
+	  break;
+	}
+    }
+
+  return ret;
+}
+
+
+/* Hook called by the linker routine which adds symbols from an object
+   file.  We use it to put .comm items in .sbss, and not .bss.  */
+
+/*ARGSUSED*/
+static boolean
+ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
+     bfd *abfd;
+     struct bfd_link_info *info;
+     const Elf_Internal_Sym *sym;
+     const char **namep;
+     flagword *flagsp;
+     asection **secp;
+     bfd_vma *valp;
+{
+  if (sym->st_shndx == SHN_COMMON
+      && !info->relocateable
+      && sym->st_size <= (bfd_vma) bfd_get_gp_size (abfd))
+    {
+      /* Common symbols less than or equal to -G nn bytes are automatically
+	 put into .sdata.  */
+      elf_linker_section_t *sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA);
+      if (!sdata->bss_section)
+	{
+	  /* We don't go through bfd_make_section, because we don't
+             want to attach this common section to DYNOBJ.  The linker
+             will move the symbols to the appropriate output section
+             when it defines common symbols.  */
+	  sdata->bss_section = ((asection *)
+				bfd_zalloc (abfd, sizeof (asection)));
+	  if (sdata->bss_section == NULL)
+	    return false;
+	  sdata->bss_section->name = sdata->bss_name;
+	  sdata->bss_section->flags = SEC_IS_COMMON;
+	  sdata->bss_section->output_section = sdata->bss_section;
+	  sdata->bss_section->symbol =
+	    (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
+	  sdata->bss_section->symbol_ptr_ptr =
+	    (asymbol **) bfd_zalloc (abfd, sizeof (asymbol *));
+	  if (sdata->bss_section->symbol == NULL
+	      || sdata->bss_section->symbol_ptr_ptr == NULL)
+	    return false;
+	  sdata->bss_section->symbol->name = sdata->bss_name;
+	  sdata->bss_section->symbol->flags = BSF_SECTION_SYM;
+	  sdata->bss_section->symbol->section = sdata->bss_section;
+	  *sdata->bss_section->symbol_ptr_ptr = sdata->bss_section->symbol;
+	}
+      *secp = sdata->bss_section;
+      *valp = sym->st_size;
+    }
+
+  return true;
+}
+
+
+/* Finish up dynamic symbol handling.  We set the contents of various
+   dynamic sections here.  */
+
+static boolean
+ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+     struct elf_link_hash_entry *h;
+     Elf_Internal_Sym *sym;
+{
+  bfd *dynobj;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s", h->root.root.string);
+#endif
+
+  dynobj = elf_hash_table (info)->dynobj;
+  BFD_ASSERT (dynobj != NULL);
+
+  if (h->plt_offset != (bfd_vma) -1)
+    {
+      asection *splt;
+      asection *srela;
+      Elf_Internal_Rela rela;
+
+#ifdef DEBUG
+      fprintf (stderr, ", plt_offset = %d", h->plt_offset);
+#endif
+
+      /* This symbol has an entry in the procedure linkage table.  Set
+         it up.  */
+
+      BFD_ASSERT (h->dynindx != -1);
+
+      splt = bfd_get_section_by_name (dynobj, ".plt");
+      srela = bfd_get_section_by_name (dynobj, ".rela.plt");
+      BFD_ASSERT (splt != NULL && srela != NULL);
+
+      /* We don't need to fill in the .plt.  The ppc dynamic linker
+	 will fill it in.  */
+
+      /* Fill in the entry in the .rela.plt section.  */
+      rela.r_offset = (splt->output_section->vma
+		       + splt->output_offset
+		       + h->plt_offset);
+      rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT);
+      rela.r_addend = 0;
+      bfd_elf32_swap_reloca_out (output_bfd, &rela,
+				 ((Elf32_External_Rela *) srela->contents
+				  + ((h->plt_offset - PLT_INITIAL_ENTRY_SIZE) / 8)));
+
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+	{
+	  /* Mark the symbol as undefined, rather than as defined in
+	     the .plt section.  Leave the value alone.  */
+	  sym->st_shndx = SHN_UNDEF;
+	}
+    }
+
+  if (h->got_offset != (bfd_vma) -1)
+    {
+      asection *sgot;
+      asection *srela;
+      Elf_Internal_Rela rela;
+
+      /* This symbol has an entry in the global offset table.  Set it
+         up.  */
+
+      sgot = bfd_get_section_by_name (dynobj, ".got");
+      srela = bfd_get_section_by_name (dynobj, ".rela.got");
+      BFD_ASSERT (sgot != NULL && srela != NULL);
+
+      rela.r_offset = (sgot->output_section->vma
+		       + sgot->output_offset
+		       + (h->got_offset &~ 1));
+
+      /* If this is a -Bsymbolic link, and the symbol is defined
+	 locally, we just want to emit a RELATIVE reloc.  The entry in
+	 the global offset table will already have been initialized in
+	 the relocate_section function.  */
+      if (info->shared
+	  && (info->symbolic || h->dynindx == -1)
+	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+	{
+	  rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+	  rela.r_addend = (h->root.u.def.value
+			   + h->root.u.def.section->output_section->vma
+			   + h->root.u.def.section->output_offset);
+	}
+      else
+	{
+	  BFD_ASSERT((h->got_offset & 1) == 0);
+	  bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got_offset);
+	  rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT);
+	  rela.r_addend = 0;
+	}
+
+      bfd_elf32_swap_reloca_out (output_bfd, &rela,
+				 ((Elf32_External_Rela *) srela->contents
+				  + srela->reloc_count));
+      ++srela->reloc_count;
+    }
+
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+    {
+      asection *s;
+      Elf_Internal_Rela rela;
+
+      /* This symbols needs a copy reloc.  Set it up.  */
+
+#ifdef DEBUG
+      fprintf (stderr, ", copy");
+#endif
+
+      BFD_ASSERT (h->dynindx != -1);
+
+      if (h->size <= elf_gp_size (dynobj))
+	s = bfd_get_section_by_name (h->root.u.def.section->owner,
+				     ".rela.sbss");
+      else
+	s = bfd_get_section_by_name (h->root.u.def.section->owner,
+				     ".rela.bss");
+      BFD_ASSERT (s != NULL);
+
+      rela.r_offset = (h->root.u.def.value
+		       + h->root.u.def.section->output_section->vma
+		       + h->root.u.def.section->output_offset);
+      rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_COPY);
+      rela.r_addend = 0;
+      bfd_elf32_swap_reloca_out (output_bfd, &rela,
+				 ((Elf32_External_Rela *) s->contents
+				  + s->reloc_count));
+      ++s->reloc_count;
+    }
+
+#ifdef DEBUG
+  fprintf (stderr, "\n");
+#endif
+
+  /* Mark some specially defined symbols as absolute.  */
+  if (strcmp (h->root.root.string, "_DYNAMIC") == 0
+      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
+      || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
+    sym->st_shndx = SHN_ABS;
+
+  return true;
+}
+
+
+/* Finish up the dynamic sections.  */
+
+static boolean
+ppc_elf_finish_dynamic_sections (output_bfd, info)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+{
+  asection *sdyn;
+  bfd *dynobj = elf_hash_table (info)->dynobj;
+  asection *sgot = bfd_get_section_by_name (dynobj, ".got");
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n");
+#endif
+
+  sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      asection *splt;
+      Elf32_External_Dyn *dyncon, *dynconend;
+
+      splt = bfd_get_section_by_name (dynobj, ".plt");
+      BFD_ASSERT (splt != NULL && sdyn != NULL);
+
+      dyncon = (Elf32_External_Dyn *) sdyn->contents;
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      for (; dyncon < dynconend; dyncon++)
+	{
+	  Elf_Internal_Dyn dyn;
+	  const char *name;
+	  boolean size;
+
+	  bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+	  switch (dyn.d_tag)
+	    {
+	    case DT_PLTGOT:   name = ".plt";	  size = false; break;
+	    case DT_PLTRELSZ: name = ".rela.plt"; size = true;  break;
+	    case DT_JMPREL:   name = ".rela.plt"; size = false; break;
+	    default:	      name = NULL;	  size = false; break;
+	    }
+
+	  if (name != NULL)
+	    {
+	      asection *s;
+
+	      s = bfd_get_section_by_name (output_bfd, name);
+	      if (s == NULL)
+		dyn.d_un.d_val = 0;
+	      else
+		{
+		  if (! size)
+		    dyn.d_un.d_ptr = s->vma;
+		  else
+		    {
+		      if (s->_cooked_size != 0)
+			dyn.d_un.d_val = s->_cooked_size;
+		      else
+			dyn.d_un.d_val = s->_raw_size;
+		    }
+		}
+	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+	    }
+	}
+    }
+
+  /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
+     easily find the address of the _GLOBAL_OFFSET_TABLE_.  */
+  if (sgot)
+    {
+      unsigned char *contents = sgot->contents;
+      bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents);
+
+      if (sdyn == NULL)
+	bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
+      else
+	bfd_put_32 (output_bfd,
+		    sdyn->output_section->vma + sdyn->output_offset,
+		    contents+4);
+
+      elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+    }
+
+  if (info->shared)
+    {
+      asection *sdynsym;
+      asection *s;
+      Elf_Internal_Sym sym;
+      int maxdindx = 0;
+
+      /* Set up the section symbols for the output sections.  */
+
+      sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
+      BFD_ASSERT (sdynsym != NULL);
+
+      sym.st_size = 0;
+      sym.st_name = 0;
+      sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+      sym.st_other = 0;
+
+      for (s = output_bfd->sections; s != NULL; s = s->next)
+	{
+	  int indx, dindx;
+
+	  sym.st_value = s->vma;
+
+	  indx = elf_section_data (s)->this_idx;
+	  dindx = elf_section_data (s)->dynindx;
+	  if (dindx != -1)
+	    {
+	      BFD_ASSERT(indx > 0);
+	      BFD_ASSERT(dindx > 0);
+
+	      if (dindx > maxdindx)
+		maxdindx = dindx;
+
+	      sym.st_shndx = indx;
+
+	      bfd_elf32_swap_symbol_out (output_bfd, &sym,
+					 (PTR) (((Elf32_External_Sym *)
+						 sdynsym->contents)
+						+ dindx));
+	    }
+	}
+
+      /* Set the sh_info field of the output .dynsym section to the
+         index of the first global symbol.  */
+      elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
+	maxdindx + 1;
+    }
+
+  return true;
+}
+
+
+/* The RELOCATE_SECTION function is called by the ELF backend linker
+   to handle the relocations for a section.
+
+   The relocs are always passed as Rela structures; if the section
+   actually uses Rel structures, the r_addend field will always be
+   zero.
+
+   This function is responsible for adjust the section contents as
+   necessary, and (if using Rela relocs and generating a
+   relocateable output file) adjusting the reloc addend as
+   necessary.
+
+   This function does not have to worry about setting the reloc
+   address or the reloc symbol index.
+
+   LOCAL_SYMS is a pointer to the swapped in local symbols.
+
+   LOCAL_SECTIONS is an array giving the section in the input file
+   corresponding to the st_shndx field of each local symbol.
+
+   The global hash table entry for the global symbols can be found
+   via elf_sym_hashes (input_bfd).
+
+   When generating relocateable output, this function must handle
+   STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
+   going to be the section symbol corresponding to the output
+   section, which means that the addend must be adjusted
+   accordingly.  */
+
+static boolean
+ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+			  contents, relocs, local_syms, local_sections)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+     bfd *input_bfd;
+     asection *input_section;
+     bfd_byte *contents;
+     Elf_Internal_Rela *relocs;
+     Elf_Internal_Sym *local_syms;
+     asection **local_sections;
+{
+  Elf_Internal_Shdr *symtab_hdr		  = &elf_tdata (input_bfd)->symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
+  bfd *dynobj				  = elf_hash_table (info)->dynobj;
+  elf_linker_section_t *sdata		  = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA)  : NULL;
+  elf_linker_section_t *sdata2		  = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA2) : NULL;
+  Elf_Internal_Rela *rel		  = relocs;
+  Elf_Internal_Rela *relend		  = relocs + input_section->reloc_count;
+  asection *sreloc			  = NULL;
+  asection *splt                          = NULL;
+  asection *sgot                          = NULL;
+  bfd_vma *local_got_offsets;
+  boolean ret				  = true;
+  long insn;
+  asection *sdata_sec			  = NULL;
+  asection *sbss_sec			  = NULL;
+
+#ifdef DEBUG
+  fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n",
+	   bfd_get_filename (input_bfd),
+	   bfd_section_name(input_bfd, input_section),
+	   (long)input_section->reloc_count,
+	   (info->relocateable) ? " (relocatable)" : "");
+#endif
+
+  if (!ppc_elf_howto_table[ R_PPC_ADDR32 ])	/* Initialize howto table if needed */
+    ppc_elf_howto_init ();
+
+  sdata_sec = bfd_get_section_by_name(output_bfd, ".sdata");
+  if (sdata_sec)
+    sdata_sec = sdata_sec->output_section;
+  sbss_sec = bfd_get_section_by_name(output_bfd, ".sbss");
+  if (sbss_sec)
+    sbss_sec = sbss_sec->output_section;
+
+  local_got_offsets = elf_local_got_offsets (input_bfd);
+
+  for (; rel < relend; rel++)
+    {
+      enum ppc_reloc_type r_type	= (enum ppc_reloc_type)ELF32_R_TYPE (rel->r_info);
+      bfd_vma offset			= rel->r_offset;
+      bfd_vma addend			= rel->r_addend;
+      bfd_reloc_status_type r		= bfd_reloc_other;
+      Elf_Internal_Sym *sym		= (Elf_Internal_Sym *)0;
+      asection *sec			= (asection *)0;
+      struct elf_link_hash_entry *h	= (struct elf_link_hash_entry *)0;
+      const char *sym_name		= (const char *)0;
+      boolean copy			= false;
+      reloc_howto_type *howto;
+      unsigned long r_symndx;
+      bfd_vma relocation;
+
+      /* Unknown relocation handling */
+      if ((unsigned)r_type >= (unsigned)R_PPC_max || !ppc_elf_howto_table[(int)r_type])
+	{
+	  (*_bfd_error_handler) ("%s: unknown relocation type %d",
+				 bfd_get_filename (input_bfd),
+				 (int)r_type);
+
+	  bfd_set_error (bfd_error_bad_value);
+	  ret = false;
+	  continue;
+	}
+
+      howto = ppc_elf_howto_table[(int)r_type];
+      r_symndx = ELF32_R_SYM (rel->r_info);
+
+      if (info->relocateable)
+	{
+	  /* This is a relocateable link.  We don't have to change
+	     anything, unless the reloc is against a section symbol,
+	     in which case we have to adjust according to where the
+	     section symbol winds up in the output section.  */
+	  if (r_symndx < symtab_hdr->sh_info)
+	    {
+	      sym = local_syms + r_symndx;
+	      if ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+		{
+		  sec = local_sections[r_symndx];
+		  addend = rel->r_addend += sec->output_offset + sym->st_value;
+		}
+	    }
+
+#ifdef DEBUG
+	  fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n",
+		   howto->name,
+		   (int)r_type,
+		   r_symndx,
+		   (long)offset,
+		   (long)addend);
+#endif
+	  continue;
+	}
+
+      /* This is a final link.  */
+      if (r_symndx < symtab_hdr->sh_info)
+	{
+	  sym = local_syms + r_symndx;
+	  sec = local_sections[r_symndx];
+	  sym_name = "<local symbol>";
+	  relocation = (sec->output_section->vma
+			+ sec->output_offset
+			+ sym->st_value);
+	  /*printf("local: sec = %s, offset = %x, vma = %x, val = %x\n",
+	      bfd_get_section_name(abbfd, sec),
+	      sec->output_offset, sec->output_section->vma, sym->st_value);*/
+	}
+      else
+	{
+	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	  while (h->root.type == bfd_link_hash_indirect
+		 || h->root.type == bfd_link_hash_warning)
+	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	  sym_name = h->root.root.string;
+	  /*printf("sym = %s, val = %x\n",sym_name, h->root.u.def.value);*/
+	  if (h->root.type == bfd_link_hash_defined
+	      || h->root.type == bfd_link_hash_defweak)
+	    {
+	      sec = h->root.u.def.section;
+	      /*printf("sec = %s, offset = %x, vma = %x\n",
+		bfd_get_section_name(abbfd, sec),
+		sec->output_offset, sec->output_section->vma, sym);*/
+	      if ((r_type == R_PPC_PLT32
+		   && h->plt_offset != (bfd_vma) -1)
+		  || ((r_type == R_PPC_GOT16
+		       || r_type == R_PPC_GOT16_LO
+		       || r_type == R_PPC_GOT16_HI
+		       || r_type == R_PPC_GOT16_HA)
+		      && elf_hash_table (info)->dynamic_sections_created
+		      && (! info->shared
+			  || (! info->symbolic && h->dynindx != -1)
+			  || (h->elf_link_hash_flags
+			      & ELF_LINK_HASH_DEF_REGULAR) == 0))
+		  || (info->shared
+		      && ((! info->symbolic && h->dynindx != -1)
+			  || (h->elf_link_hash_flags
+			      & ELF_LINK_HASH_DEF_REGULAR) == 0)
+		      && (input_section->flags & SEC_ALLOC) != 0
+		      && (r_type == R_PPC_ADDR32
+			  || r_type == R_PPC_ADDR24
+			  || r_type == R_PPC_ADDR16
+			  || r_type == R_PPC_ADDR16_LO
+			  || r_type == R_PPC_ADDR16_HI
+			  || r_type == R_PPC_ADDR16_HA
+			  || r_type == R_PPC_ADDR14
+			  || r_type == R_PPC_ADDR14_BRTAKEN
+			  || r_type == R_PPC_ADDR14_BRNTAKEN
+			  || r_type == R_PPC_PLTREL24
+			  || r_type == R_PPC_COPY
+			  || r_type == R_PPC_GLOB_DAT
+			  || r_type == R_PPC_JMP_SLOT
+			  || r_type == R_PPC_UADDR32
+			  || r_type == R_PPC_UADDR16
+			  || r_type == R_PPC_SDAREL16
+			  || r_type == R_PPC_EMB_NADDR32
+			  || r_type == R_PPC_EMB_NADDR16
+			  || r_type == R_PPC_EMB_NADDR16_LO
+			  || r_type == R_PPC_EMB_NADDR16_HI
+			  || r_type == R_PPC_EMB_NADDR16_HA
+			  || r_type == R_PPC_EMB_SDAI16
+			  || r_type == R_PPC_EMB_SDA2I16
+			  || r_type == R_PPC_EMB_SDA2REL
+			  || r_type == R_PPC_EMB_SDA21
+			  || r_type == R_PPC_EMB_MRKREF
+			  || r_type == R_PPC_EMB_BIT_FLD
+			  || r_type == R_PPC_EMB_RELSDA
+			  || ((r_type == R_PPC_REL24
+			       || r_type == R_PPC_REL32
+			       || r_type == R_PPC_REL14
+			       || r_type == R_PPC_REL14_BRTAKEN
+			       || r_type == R_PPC_REL14_BRNTAKEN
+			       || r_type == R_PPC_RELATIVE)
+			      && strcmp (h->root.root.string,
+					 "_GLOBAL_OFFSET_TABLE_") != 0))))
+		{
+		  /* In these cases, we don't need the relocation
+                     value.  We check specially because in some
+                     obscure cases sec->output_section will be NULL.  */
+		  relocation = 0;
+		}
+	      else
+		relocation = (h->root.u.def.value
+			      + sec->output_section->vma
+			      + sec->output_offset);
+	    }
+	  else if (h->root.type == bfd_link_hash_undefweak)
+	    relocation = 0;
+	  else if (info->shared)
+	    relocation = 0;
+	  else
+	    {
+	      (*info->callbacks->undefined_symbol)(info,
+						   h->root.root.string,
+						   input_bfd,
+						   input_section,
+						   rel->r_offset);
+	      ret = false;
+	      continue;
+	    }
+	}
+
+      switch ((int)r_type)
+	{
+	default:
+	  (*_bfd_error_handler) ("%s: unknown relocation type %d for symbol %s",
+				 bfd_get_filename (input_bfd),
+				 (int)r_type, sym_name);
+
+	  bfd_set_error (bfd_error_bad_value);
+	  ret = false;
+	  continue;
+
+	/* relocations that need no special processing */
+	case (int)R_PPC_LOCAL24PC:
+	  break;
+
+	/* Relocations that may need to be propagated if this is a shared
+           object.  */
+	case (int)R_PPC_REL24:
+	case (int)R_PPC_REL32:
+	case (int)R_PPC_REL14:
+	  /* If these relocations are not to a named symbol, they can be
+	     handled right here, no need to bother the dynamic linker.  */
+	  if (info->shared && (h == NULL
+	      || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0))
+	    break;
+	/* fall through */
+
+	/* Relocations that always need to be propagated if this is a shared
+           object.  */
+	case (int)R_PPC_NONE:
+	case (int)R_PPC_ADDR32:
+	case (int)R_PPC_ADDR24:
+	case (int)R_PPC_ADDR16:
+	case (int)R_PPC_ADDR16_LO:
+	case (int)R_PPC_ADDR16_HI:
+	case (int)R_PPC_ADDR16_HA:
+	case (int)R_PPC_ADDR14:
+	case (int)R_PPC_UADDR32:
+	case (int)R_PPC_UADDR16:
+	  if (info->shared)
+	    {
+	      Elf_Internal_Rela outrel;
+	      boolean skip;
+
+#ifdef DEBUG
+	      fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n",
+		       (h && h->root.root.string) ? h->root.root.string : "<unknown>");
+#endif
+
+	      /* When generating a shared object, these relocations
+                 are copied into the output file to be resolved at run
+                 time.  */
+
+	      if (sreloc == NULL)
+		{
+		  const char *name;
+
+		  name = (bfd_elf_string_from_elf_section
+			  (input_bfd,
+			   elf_elfheader (input_bfd)->e_shstrndx,
+			   elf_section_data (input_section)->rel_hdr.sh_name));
+		  if (name == NULL)
+		    return false;
+
+		  BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+			      && strcmp (bfd_get_section_name (input_bfd,
+							       input_section),
+					 name + 5) == 0);
+
+		  sreloc = bfd_get_section_by_name (dynobj, name);
+		  BFD_ASSERT (sreloc != NULL);
+		}
+
+	      skip = false;
+
+	      if (elf_section_data (input_section)->stab_info == NULL)
+		outrel.r_offset = rel->r_offset;
+	      else
+		{
+		  bfd_vma off;
+
+		  off = (_bfd_stab_section_offset
+			 (output_bfd, &elf_hash_table (info)->stab_info,
+			  input_section,
+			  &elf_section_data (input_section)->stab_info,
+			  rel->r_offset));
+		  if (off == (bfd_vma) -1)
+		    skip = true;
+		  outrel.r_offset = off;
+		}
+
+	      outrel.r_offset += (input_section->output_section->vma
+				  + input_section->output_offset);
+
+	      if (skip)
+		memset (&outrel, 0, sizeof outrel);
+	      /* h->dynindx may be -1 if this symbol was marked to
+                 become local.  */
+	      else if (h != NULL
+		       && ((! info->symbolic && h->dynindx != -1)
+			   || (h->elf_link_hash_flags
+			       & ELF_LINK_HASH_DEF_REGULAR) == 0))
+		{
+		  BFD_ASSERT (h->dynindx != -1);
+		  outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+		  outrel.r_addend = rel->r_addend;
+		}
+	      else
+		{
+		  if (r_type == R_PPC_ADDR32)
+		    {
+		      outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+		      outrel.r_addend = relocation + rel->r_addend;
+		    }
+		  else
+		    {
+		      long indx;
+
+		      if (h == NULL)
+			sec = local_sections[r_symndx];
+		      else
+			{
+			  BFD_ASSERT (h->root.type == bfd_link_hash_defined
+				      || (h->root.type
+					  == bfd_link_hash_defweak));
+			  sec = h->root.u.def.section;
+			}
+		      if (sec != NULL && bfd_is_abs_section (sec))
+			indx = 0;
+		      else if (sec == NULL || sec->owner == NULL)
+			{
+			  bfd_set_error (bfd_error_bad_value);
+			  return false;
+			}
+		      else
+			{
+			  asection *osec;
+
+			  osec = sec->output_section;
+			  indx = elf_section_data (osec)->dynindx;
+			  BFD_ASSERT(indx > 0);
+#ifdef DEBUG
+			  if (indx <= 0)
+			    {
+			      printf("indx=%d section=%s flags=%08x name=%s\n",
+				     indx, osec->name, osec->flags,
+				     h->root.root.string);
+			    }
+#endif
+			}
+
+		      outrel.r_info = ELF32_R_INFO (indx, r_type);
+		      outrel.r_addend = relocation + rel->r_addend;
+		    }
+		}
+
+	      bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+					 (((Elf32_External_Rela *)
+					   sreloc->contents)
+					  + sreloc->reloc_count));
+	      ++sreloc->reloc_count;
+
+	      /* This reloc will be computed at runtime, so there's no
+                 need to do anything now, unless this is a RELATIVE
+                 reloc in an unallocated section.  */
+	      if (skip
+		  || (input_section->flags & SEC_ALLOC) != 0
+		  || ELF32_R_TYPE (outrel.r_info) != R_PPC_RELATIVE)
+		continue;
+	    }
+	  else if (r_type == R_PPC_REL24 || r_type == R_PPC_REL14)
+	    {
+	      if (sec->output_section != input_section->output_section)
+		{
+		  (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+					 bfd_get_filename (input_bfd),
+					 sym_name,
+					 ppc_elf_howto_table[ (int)r_type ]->name,
+					 bfd_get_section_name (abfd, sec));
+		  bfd_set_error (bfd_error_bad_value);
+		  ret = false;
+		  continue;
+		}
+	      break;
+	    }
+	  else if (r_type == R_PPC_REL32)
+	    {
+	      if (sec->output_section != input_section->output_section)
+		copy = true;
+	      else
+		break;
+	    }
+	  else if (ddr_ptr && sec && r_type == R_PPC_ADDR32 &&
+		   (sec->output_section == sdata_sec ||
+		    sec->output_section == sbss_sec /*||
+		    !strcmp(bfd_get_section_name(abfd, sec), "COMMON") ||
+		    !strcmp(bfd_get_section_name(abfd, sec), ".data") ||
+		    !strcmp(bfd_get_section_name(abfd, sec), ".bss")*/) &&
+		   (input_section->output_section == sdata_sec ||
+		    input_section->output_section == sbss_sec /*||
+		    !strcmp(bfd_get_section_name(abfd, input_section), "COMMON") ||
+		    !strcmp(bfd_get_section_name(abfd, input_section), ".data") ||
+		    !strcmp(bfd_get_section_name(abfd, input_section), ".bss")*/))
+	    {
+	      int tmp = input_section->output_offset + offset;
+	      ++ddr_count;
+	      ddr_ptr[0] = (bfd_byte)(tmp >> 24);
+	      ddr_ptr[1] = (bfd_byte)(tmp >> 16);
+	      ddr_ptr[2] = (bfd_byte)(tmp >> 8);
+	      ddr_ptr[3] = (bfd_byte)tmp;
+	      ddr_ptr += 4;
+	      copy = true;
+/*if (sec->output_section != sdata_sec && sec->output_section != sbss_sec)
+{
+	if (sdata_sec)
+		printf("sdata %p output %p ", sdata_sec, sdata_sec->output_section);
+	if (sbss_sec)
+		printf("sbss %p output %p ", sbss_sec, sbss_sec->output_section);
+	printf("*** sec %p output %p <%s> <%s>\n", sec, sec->output_section,
+			bfd_get_section_name(abfd, sec), bfd_get_section_name(abfd, input_section));
+}*/
+	      break;
+	    }
+	  else if (sec && !bfd_is_abs_section(sec))
+	    {
+	      copy = true;
+	      break;
+	    }
+
+	  if (copy && ddr_ptr && sec &&
+	      strcmp(bfd_get_section_name(abfd, input_section), "lnkdata") &&
+	      (sec->output_section == sdata_sec ||
+	       sec->output_section == sbss_sec ||
+	       !strcmp(bfd_get_section_name(abfd, sec), "COMMON") ||
+	       !strcmp(bfd_get_section_name(abfd, sec), ".data") ||
+	       !strcmp(bfd_get_section_name(abfd, sec), ".bss") ||
+	       !strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.s.", 16) ||
+	       !strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.b.", 16) ||
+	       !strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.sb.", 17))
+ /*&&
+	      (r_type != R_PPC_ADDR32 ||
+	       !(input_section->output_section == sdata_sec->output_section ||
+		 input_section->output_section == sbss_sec->output_section ||
+		 !strcmp(bfd_get_section_name(abfd, input_section), "COMMON") ||
+		 !strcmp(bfd_get_section_name(abfd, input_section), ".data") ||
+		 !strcmp(bfd_get_section_name(abfd, input_section), ".bss")))*/)
+	    {
+	      (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				     bfd_get_filename (input_bfd),
+				     sym_name,
+				     ppc_elf_howto_table[ (int)r_type ]->name,
+				     bfd_get_section_name (abfd, sec));
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      continue;
+	    }
+
+	  /* Arithmetic adjust relocations that aren't going into a
+	     shared object.  */
+	  if (r_type == R_PPC_ADDR16_HA
+	      /* It's just possible that this symbol is a weak symbol
+		 that's not actually defined anywhere. In that case,
+		 'sec' would be NULL, and we should leave the symbol
+		 alone (it will be set to zero elsewhere in the link).  */
+	      && sec != NULL)
+	    {
+	      addend += ((relocation + addend) & 0x8000) << 1;
+	    }
+	  break;
+
+	/* branch taken prediction relocations */
+	case (int)R_PPC_ADDR14_BRTAKEN:
+	case (int)R_PPC_REL14_BRTAKEN:
+	  insn = bfd_get_32 (output_bfd, contents + offset);
+	  if ((relocation - offset) & 0x8000)
+	    insn &= ~BRANCH_PREDICT_BIT;
+	  else
+	    insn |= BRANCH_PREDICT_BIT;
+	  bfd_put_32 (output_bfd, insn, contents + offset);
+	  break;
+
+	/* branch not taken predicition relocations */
+	case (int)R_PPC_ADDR14_BRNTAKEN:
+	case (int)R_PPC_REL14_BRNTAKEN:
+	  insn = bfd_get_32 (output_bfd, contents + offset);
+	  if ((relocation - offset) & 0x8000)
+	    insn |= BRANCH_PREDICT_BIT;
+	  else
+	    insn &= ~BRANCH_PREDICT_BIT;
+	  bfd_put_32 (output_bfd, insn, contents + offset);
+	  break;
+
+	/* GOT16 relocations */
+	case (int)R_PPC_GOT16:
+	case (int)R_PPC_GOT16_LO:
+	case (int)R_PPC_GOT16_HI:
+	case (int)R_PPC_GOT16_HA:
+	  /* Relocation is to the entry for this symbol in the global
+             offset table.  */
+	  if (sgot == NULL)
+	    {
+	      sgot = bfd_get_section_by_name (dynobj, ".got");
+	      BFD_ASSERT (sgot != NULL);
+	    }
+
+	  if (h != NULL)
+	    {
+	      bfd_vma off;
+
+	      off = h->got_offset;
+	      BFD_ASSERT (off != (bfd_vma) -1);
+
+	      if (! elf_hash_table (info)->dynamic_sections_created
+		  || (info->shared
+		      && (info->symbolic || h->dynindx == -1)
+		      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+		{
+		  /* This is actually a static link, or it is a
+                     -Bsymbolic link and the symbol is defined
+                     locally.  We must initialize this entry in the
+                     global offset table.  Since the offset must
+                     always be a multiple of 4, we use the least
+                     significant bit to record whether we have
+                     initialized it already.
+
+		     When doing a dynamic link, we create a .rela.got
+		     relocation entry to initialize the value.  This
+		     is done in the finish_dynamic_symbol routine.  */
+		  if ((off & 1) != 0)
+		    off &= ~1;
+		  else
+		    {
+		      bfd_put_32 (output_bfd, relocation,
+				  sgot->contents + off);
+		      h->got_offset |= 1;
+		    }
+		}
+
+	      relocation = sgot->output_offset + off - 4;
+	    }
+	  else
+	    {
+	      bfd_vma off;
+
+	      BFD_ASSERT (local_got_offsets != NULL
+			  && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+	      off = local_got_offsets[r_symndx];
+
+	      /* The offset must always be a multiple of 4.  We use
+		 the least significant bit to record whether we have
+		 already processed this entry.  */
+	      if ((off & 1) != 0)
+		off &= ~1;
+	      else
+		{
+		  bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+		  if (info->shared)
+		    {
+		      asection *srelgot;
+		      Elf_Internal_Rela outrel;
+
+		      /* We need to generate a R_PPC_RELATIVE reloc
+			 for the dynamic linker.  */
+		      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+		      BFD_ASSERT (srelgot != NULL);
+
+		      outrel.r_offset = (sgot->output_section->vma
+					 + sgot->output_offset
+					 + off);
+		      outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
+		      outrel.r_addend = relocation;
+		      bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+						 (((Elf32_External_Rela *)
+						   srelgot->contents)
+						  + srelgot->reloc_count));
+		      ++srelgot->reloc_count;
+		    }
+
+		  local_got_offsets[r_symndx] |= 1;
+		}
+
+	      relocation = sgot->output_offset + off - 4;
+	    }
+	  break;
+
+	/* Indirect .sdata relocation */
+	case (int)R_PPC_EMB_SDAI16:
+	  BFD_ASSERT (sdata != NULL);
+	  relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
+								sdata, h, relocation, rel,
+								R_PPC_RELATIVE);
+	  break;
+
+	/* Indirect .sdata2 relocation */
+	case (int)R_PPC_EMB_SDA2I16:
+	  BFD_ASSERT (sdata2 != NULL);
+	  relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
+								sdata2, h, relocation, rel,
+								R_PPC_RELATIVE);
+	  break;
+
+	/* Handle the TOC16 reloc.  We want to use the offset within the .got
+	   section, not the actual VMA.  This is appropriate when generating
+	   an embedded ELF object, for which the .got section acts like the
+	   AIX .toc section.  */
+	case (int)R_PPC_TOC16:			/* phony GOT16 relocations */
+	  BFD_ASSERT (sec != (asection *)0);
+	  BFD_ASSERT (bfd_is_und_section (sec)
+		      || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0
+		      || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0)
+
+	  addend -= sec->output_section->vma + sec->output_offset + 0x8000;
+	  break;
+
+	case (int)R_PPC_PLTREL24:
+	  /* Relocation is to the entry for this symbol in the
+             procedure linkage table.  */
+	  BFD_ASSERT (h != NULL);
+
+	  if (h->plt_offset == (bfd_vma) -1)
+	    {
+	      /* We didn't make a PLT entry for this symbol.  This
+                 happens when statically linking PIC code, or when
+                 using -Bsymbolic.  */
+	      break;
+	    }
+
+	  if (splt == NULL)
+	    {
+	      splt = bfd_get_section_by_name (dynobj, ".plt");
+	      BFD_ASSERT (splt != NULL);
+	    }
+
+	  relocation = (splt->output_section->vma
+			+ splt->output_offset
+			+ h->plt_offset);
+	  break;
+
+	/* relocate against _SDA_BASE_ */
+	case (int)R_PPC_SDAREL16:
+	  BFD_ASSERT (sec != (asection *)0);
+	  if (strcmp (bfd_get_section_name (abfd, sec), ".sdata") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".dynsbss") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".sbss") != 0)
+	    {
+	      (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				     bfd_get_filename (input_bfd),
+				     sym_name,
+				     ppc_elf_howto_table[ (int)r_type ]->name,
+				     bfd_get_section_name (abfd, sec));
+
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      continue;
+	    }
+	  /*printf("SDAREL: addend = %x, sdata->val = %x, vma = %x, output_offset = %x\n",
+	    addend, sdata->sym_hash->root.u.def.value,
+	    sdata->sym_hash->root.u.def.section->output_section->vma,
+	    sdata->sym_hash->root.u.def.section->output_offset);*/
+	  addend -= (sdata->sym_hash->root.u.def.value
+		     + sdata->sym_hash->root.u.def.section->output_section->vma
+		     /*+ sdata->sym_hash->root.u.def.section->output_offset*/);
+	  break;
+
+	/* relocate against _SDA_BASE_, in large data mode */
+	case (int)R_PPC_MORPHOS_DREL:
+	case (int)R_PPC_MORPHOS_DREL_LO:
+	case (int)R_PPC_MORPHOS_DREL_HI:
+	case (int)R_PPC_MORPHOS_DREL_HA: {
+#if 1
+	  const char *name = bfd_get_section_name (abfd, sec->output_section);
+	  if(strcmp(name, ".sdata") != 0
+	     && strcmp(name, ".sbss") != 0
+	     && strcmp(name, ".data") != 0
+	     && strcmp(name, ".bss") != 0
+	     && strncmp(name, ".ctors", 6) != 0
+	     && strncmp(name, ".dtors", 6) != 0)
+	   {
+	      (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				     bfd_get_filename (input_bfd),
+				     sym_name,
+				     ppc_elf_howto_table[ (int)r_type ]->name,
+				     name);
+
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      continue;
+	   }
+#else
+	  BFD_ASSERT (sec != (asection *)0);
+	  if (strcmp (bfd_get_section_name (abfd, sec), ".sdata") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".data") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".data1") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".data.rel") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".data.rel.local") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".bss") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".sbss") != 0
+	      && strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.s.", 16) != 0
+	      && strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.b.", 16) != 0
+	      && strncmp(bfd_get_section_name(abfd, sec), ".gnu.linkonce.sb.", 16) != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), "COMMON") != 0)
+	    {
+	      (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				     bfd_get_filename (input_bfd),
+				     sym_name,
+				     ppc_elf_howto_table[ (int)r_type ]->name,
+				     bfd_get_section_name (abfd, sec));
+
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      continue;
+	    }
+#endif
+	  /*printf("DREL: addend = %x, sdata->val = %x, vma = %x, output_offset = %x\n",
+		 addend, sdata->sym_hash->root.u.def.value,
+		 sdata->sym_hash->root.u.def.section->output_section->vma,
+		 sdata->sym_hash->root.u.def.section->output_offset);*/
+	  addend -= (sdata->sym_hash->root.u.def.value
+		     + sdata->sym_hash->root.u.def.section->output_section->vma
+		     /*+ sdata->sym_hash->root.u.def.section->output_offset*/);
+	  if (r_type == R_PPC_MORPHOS_DREL_HA)
+	    addend += ((relocation + addend) & 0x8000) << 1;
+	  break;
+	  }
+	/* relocate against _SDA2_BASE_ */
+	case (int)R_PPC_EMB_SDA2REL:
+	  BFD_ASSERT (sec != (asection *)0);
+	  if (strcmp (bfd_get_section_name (abfd, sec), ".sdata2") != 0
+	      && strcmp (bfd_get_section_name (abfd, sec), ".sbss2") != 0)
+	    {
+	      (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				     bfd_get_filename (input_bfd),
+				     sym_name,
+				     ppc_elf_howto_table[ (int)r_type ]->name,
+				     bfd_get_section_name (abfd, sec));
+
+	      bfd_set_error (bfd_error_bad_value);
+	      ret = false;
+	      continue;
+	    }
+	  addend -= (sdata2->sym_hash->root.u.def.value
+		     + sdata2->sym_hash->root.u.def.section->output_section->vma
+		     + sdata2->sym_hash->root.u.def.section->output_offset);
+	  break;
+
+	/* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */
+	case (int)R_PPC_EMB_SDA21:
+	case (int)R_PPC_EMB_RELSDA:
+	  {
+	    const char *name = bfd_get_section_name (abfd, sec);
+	    int reg;
+
+	    BFD_ASSERT (sec != (asection *)0);
+	    if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0)
+	      {
+		reg = 13;
+		addend -= (sdata->sym_hash->root.u.def.value
+			   + sdata->sym_hash->root.u.def.section->output_section->vma
+			   + sdata->sym_hash->root.u.def.section->output_offset);
+	      }
+
+	    else if (strcmp (name, ".sdata2") == 0 || strcmp (name, ".sbss2") == 0)
+	      {
+		reg = 2;
+		addend -= (sdata2->sym_hash->root.u.def.value
+			   + sdata2->sym_hash->root.u.def.section->output_section->vma
+			   + sdata2->sym_hash->root.u.def.section->output_offset);
+	      }
+
+	    else if (strcmp (name, ".PPC.EMB.sdata0") == 0 || strcmp (name, ".PPC.EMB.sbss0") == 0)
+	      {
+		reg = 0;
+	      }
+
+	    else
+	      {
+		(*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
+				       bfd_get_filename (input_bfd),
+				       sym_name,
+				       ppc_elf_howto_table[ (int)r_type ]->name,
+				       bfd_get_section_name (abfd, sec));
+
+		bfd_set_error (bfd_error_bad_value);
+		ret = false;
+		continue;
+	      }
+
+	    if (r_type == R_PPC_EMB_SDA21)
+	      {			/* fill in register field */
+		insn = bfd_get_32 (output_bfd, contents + offset);
+		insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT);
+		bfd_put_32 (output_bfd, insn, contents + offset);
+	      }
+	  }
+	  break;
+
+	/* Relocate against the beginning of the section */
+	case (int)R_PPC_SECTOFF:
+	case (int)R_PPC_SECTOFF_LO:
+	case (int)R_PPC_SECTOFF_HI:
+	  BFD_ASSERT (sec != (asection *)0);
+	  addend -= sec->output_section->vma;
+	  break;
+
+	case (int)R_PPC_SECTOFF_HA:
+	  BFD_ASSERT (sec != (asection *)0);
+	  addend -= sec->output_section->vma;
+	  addend += ((relocation + addend) & 0x8000) << 1;
+	  break;
+
+	/* Negative relocations */
+	case (int)R_PPC_EMB_NADDR32:
+	case (int)R_PPC_EMB_NADDR16:
+	case (int)R_PPC_EMB_NADDR16_LO:
+	case (int)R_PPC_EMB_NADDR16_HI:
+	  addend -= 2*relocation;
+	  break;
+
+	case (int)R_PPC_EMB_NADDR16_HA:
+	  addend -= 2*relocation;
+	  addend += ((relocation + addend) & 0x8000) << 1;
+	  break;
+
+	/* NOP relocation that prevents garbage collecting linkers from omitting a
+	   reference.  */
+	case (int)R_PPC_EMB_MRKREF:
+	  continue;
+
+	case (int)R_PPC_COPY:
+	case (int)R_PPC_GLOB_DAT:
+	case (int)R_PPC_JMP_SLOT:
+	case (int)R_PPC_RELATIVE:
+	case (int)R_PPC_PLT32:
+	case (int)R_PPC_PLTREL32:
+	case (int)R_PPC_PLT16_LO:
+	case (int)R_PPC_PLT16_HI:
+	case (int)R_PPC_PLT16_HA:
+	case (int)R_PPC_EMB_RELSEC16:
+	case (int)R_PPC_EMB_RELST_LO:
+	case (int)R_PPC_EMB_RELST_HI:
+	case (int)R_PPC_EMB_RELST_HA:
+	case (int)R_PPC_EMB_BIT_FLD:
+	  (*_bfd_error_handler) ("%s: Relocation %s is not yet supported for symbol %s.",
+				 bfd_get_filename (input_bfd),
+				 ppc_elf_howto_table[ (int)r_type ]->name,
+				 sym_name);
+
+	  bfd_set_error (bfd_error_invalid_operation);
+	  ret = false;
+	  continue;
+	}
+
+
+#ifdef DEBUG
+      fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
+	       howto->name,
+	       (int)r_type,
+	       sym_name,
+	       r_symndx,
+	       (long)offset,
+	       (long)addend);
+#endif
+
+      if (copy)
+	{
+	  Elf_Internal_Rela outrel;
+
+	  if (sec == NULL) /* Don't know if it is possible... */
+	    abort();
+
+	  /*printf("copying reloc %d, addend=%x, rel=%x, indx=%d, offset=%x, sec_vma=%x\n",
+		 r_type,addend,relocation,sec->output_section->target_index,
+		 sec->output_offset,sec->output_section->vma);*/
+
+	  outrel.r_info = ELF32_R_INFO(sec->output_section->target_index, r_type);
+	  outrel.r_addend = relocation + addend - sec->output_section->vma;
+	  outrel.r_offset = input_section->output_offset + offset;
+
+	  bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+				     (((Elf32_External_Rela *)
+				       elf_section_data(input_section->output_section)->
+				       rel_hdr.contents)
+				      + input_section->output_section->reloc_count));
+	  ++input_section->output_section->reloc_count;
+	}
+      else
+	{
+	  /*printf("applying reloc %d, sym=%s addend=%x, rel=%x, indx=%d, offset=%x, sec_vma=%x\n",
+		 r_type,sym_name,addend,relocation,sec->output_section->target_index,
+		 sec->output_offset,sec->output_section->vma);*/
+	  r = _bfd_final_link_relocate (howto,
+					input_bfd,
+					input_section,
+					contents,
+					offset,
+					relocation,
+					addend);
+
+	  if (r != bfd_reloc_ok)
+	    {
+	      ret = false;
+	      switch (r)
+		{
+		default:
+		  break;
+
+		case bfd_reloc_overflow:
+		  {
+		    const char *name;
+
+		    if (h != NULL)
+		      name = h->root.root.string;
+		    else
+		      {
+			name = bfd_elf_string_from_elf_section (input_bfd,
+								symtab_hdr->sh_link,
+								sym->st_name);
+			if (name == NULL)
+			  break;
+
+			if (*name == '\0')
+			  name = bfd_section_name (input_bfd, sec);
+		      }
+
+		    (*info->callbacks->reloc_overflow)(info,
+						       name,
+						       howto->name,
+						       (bfd_vma) 0,
+						       input_bfd,
+						       input_section,
+						       offset);
+		  }
+		  break;
+
+		}
+	    }
+	}
+    }
+
+#ifdef DEBUG
+  fprintf (stderr, "\n");
+#endif
+
+  return ret;
+}
+
+
+/* Special MorphOS final link routine.  */
+/* This is almost the same as the elf one, except for the hanling of relocations */
+
+/* A structure we use to avoid passing large numbers of arguments.  */
+
+struct elf_final_link_info
+{
+  /* General link information.  */
+  struct bfd_link_info *info;
+  /* Output BFD.  */
+  bfd *output_bfd;
+  /* Symbol string table.  */
+  struct bfd_strtab_hash *symstrtab;
+  /* .dynsym section.  */
+  asection *dynsym_sec;
+  /* .hash section.  */
+  asection *hash_sec;
+  /* symbol version section (.gnu.version).  */
+  asection *symver_sec;
+  /* Buffer large enough to hold contents of any section.  */
+  bfd_byte *contents;
+  /* Buffer large enough to hold external relocs of any section.  */
+  PTR external_relocs;
+  /* Buffer large enough to hold internal relocs of any section.  */
+  Elf_Internal_Rela *internal_relocs;
+  /* Buffer large enough to hold external local symbols of any input
+     BFD.  */
+  Elf_External_Sym *external_syms;
+  /* Buffer large enough to hold internal local symbols of any input
+     BFD.  */
+  Elf_Internal_Sym *internal_syms;
+  /* Array large enough to hold a symbol index for each local symbol
+     of any input BFD.  */
+  long *indices;
+  /* Array large enough to hold a section pointer for each local
+     symbol of any input BFD.  */
+  asection **sections;
+  /* Buffer to hold swapped out symbols.  */
+  Elf_External_Sym *symbuf;
+  /* Number of swapped out symbols in buffer.  */
+  size_t symbuf_count;
+  /* Number of symbols which fit in symbuf.  */
+  size_t symbuf_size;
+};
+
+static boolean elf_link_output_sym
+  PARAMS ((struct elf_final_link_info *, const char *,
+	   Elf_Internal_Sym *, asection *));
+static boolean elf_link_flush_output_syms
+  PARAMS ((struct elf_final_link_info *));
+static boolean elf_link_output_extsym
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+static boolean elf_link_input_bfd
+  PARAMS ((struct elf_final_link_info *, bfd *));
+static boolean elf_reloc_link_order
+  PARAMS ((bfd *, struct bfd_link_info *, asection *,
+	   struct bfd_link_order *));
+
+/* This struct is used to pass information to elf_link_output_extsym.  */
+
+struct elf_outext_info
+{
+  boolean failed;
+  boolean localsyms;
+  struct elf_final_link_info *finfo;
+};
+
+/* Do the final step of an ELF link.  */
+
+boolean
+ppc_elf_final_link (abfd, info)
+     bfd *abfd;
+     struct bfd_link_info *info;
+{
+  boolean dynamic;
+  bfd *dynobj;
+  struct elf_final_link_info finfo;
+  register asection *o;
+  register struct bfd_link_order *p;
+  register bfd *sub;
+  size_t max_contents_size;
+  size_t max_external_reloc_size;
+  size_t max_internal_reloc_count;
+  size_t max_sym_count;
+  size_t max_datadata_reloc_count;
+  file_ptr off;
+  Elf_Internal_Sym elfsym;
+  unsigned int i;
+  Elf_Internal_Shdr *symtab_hdr;
+  Elf_Internal_Shdr *symstrtab_hdr;
+  struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  struct elf_outext_info eoinfo;
+  asection *ddr_sec;
+  asection *sdata_sec = NULL;
+  asection *sbss_sec = NULL;
+
+  if (info->shared)
+    abfd->flags |= DYNAMIC;
+
+  bfd_set_start_address(abfd, 0);
+
+  dynamic = elf_hash_table (info)->dynamic_sections_created;
+  dynobj = elf_hash_table (info)->dynobj;
+
+  finfo.info = info;
+  finfo.output_bfd = abfd;
+  finfo.symstrtab = elf_stringtab_init ();
+  if (finfo.symstrtab == NULL)
+    return false;
+
+  if (! dynamic)
+    {
+      finfo.dynsym_sec = NULL;
+      finfo.hash_sec = NULL;
+      finfo.symver_sec = NULL;
+    }
+  else
+    {
+      finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
+      finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
+      BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
+      finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
+      /* Note that it is OK if symver_sec is NULL.  */
+    }
+
+  finfo.contents = NULL;
+  finfo.external_relocs = NULL;
+  finfo.internal_relocs = NULL;
+  finfo.external_syms = NULL;
+  finfo.internal_syms = NULL;
+  finfo.indices = NULL;
+  finfo.sections = NULL;
+  finfo.symbuf = NULL;
+  finfo.symbuf_count = 0;
+
+  ddr_sec = bfd_get_section_by_name(abfd, "ddrelocs");
+
+  /* Count up the number of relocations we will output for each output
+     section, so that we know the sizes of the reloc sections.  We
+     also figure out some maximum sizes.  */
+  max_contents_size = 0;
+  max_external_reloc_size = 0;
+  max_internal_reloc_count = 0;
+  max_sym_count = 0;
+  max_datadata_reloc_count = 0;
+  for (o = abfd->sections; o != (asection *) NULL; o = o->next)
+    {
+      /*bfd_set_section_vma(abfd, o, 0);*/
+
+      o->reloc_count = 0;
+
+      for (p = o->link_order_head; p != NULL; p = p->next)
+	{
+	  if (p->type == bfd_section_reloc_link_order
+	      || p->type == bfd_symbol_reloc_link_order)
+	    ++o->reloc_count;
+	  else if (p->type == bfd_indirect_link_order)
+	    {
+	      asection *sec;
+
+	      sec = p->u.indirect.section;
+
+	      /* Mark all sections which are to be included in the
+		 link.  This will normally be every section.  We need
+		 to do this so that we can identify any sections which
+		 the linker has decided to not include.  */
+	      sec->linker_mark = true;
+
+	      /* Maximum number of relocations */
+	      o->reloc_count += sec->reloc_count;
+
+	      if (sec->_raw_size > max_contents_size)
+		max_contents_size = sec->_raw_size;
+	      if (sec->_cooked_size > max_contents_size)
+		max_contents_size = sec->_cooked_size;
+
+	      /* We are interested in just local symbols, not all
+		 symbols.  */
+	      if (bfd_get_flavour (sec->owner) == bfd_target_elf_flavour
+		  && (sec->owner->flags & DYNAMIC) == 0)
+		{
+		  size_t sym_count;
+
+		  if (elf_bad_symtab (sec->owner))
+		    sym_count = (elf_tdata (sec->owner)->symtab_hdr.sh_size
+				 / sizeof (Elf_External_Sym));
+		  else
+		    sym_count = elf_tdata (sec->owner)->symtab_hdr.sh_info;
+
+		  if (sym_count > max_sym_count)
+		    max_sym_count = sym_count;
+
+		  if ((sec->flags & SEC_RELOC) != 0)
+		    {
+		      size_t ext_size;
+
+		      ext_size = elf_section_data (sec)->rel_hdr.sh_size;
+		      if (ext_size > max_external_reloc_size)
+			max_external_reloc_size = ext_size;
+		      if (sec->reloc_count > max_internal_reloc_count)
+			max_internal_reloc_count = sec->reloc_count;
+		    }
+		}
+	    }
+	}
+
+      if (!strcmp(bfd_section_name(abfd, o), ".sdata"))
+	sdata_sec = o;
+      else if(!strcmp(bfd_section_name(abfd, o), ".sbss"))
+	sbss_sec = o;
+      else
+	bfd_set_section_vma(abfd, o, 0);
+
+      if (o->reloc_count > 0)
+	{
+	  o->flags |= SEC_RELOC;
+	  if (o == sdata_sec || o == sbss_sec)
+	    max_datadata_reloc_count += o->reloc_count;
+	}
+      else
+	{
+	  /* Explicitly clear the SEC_RELOC flag.  The linker tends to
+	     set it (this is probably a bug) and if it is set
+	     assign_section_numbers will create a reloc section.  */
+	  o->flags &=~ SEC_RELOC;
+	}
+
+      /* If the SEC_ALLOC flag is not set, force the section VMA to
+	 zero.  This is done in elf_fake_sections as well, but forcing
+	 the VMA to 0 here will ensure that relocs against these
+	 sections are handled correctly.  */
+      if ((o->flags & SEC_ALLOC) == 0
+	  && ! o->user_set_vma)
+	o->vma = 0;
+    }
+
+  if (sdata_sec)
+    {
+      if (sbss_sec)
+	{
+	  /* Emm: all this is pretty hackish and I'm not sure it's 100% safe. There is probably
+	   * a better place to do that too.
+	   */
+	  int align1 = bfd_get_section_alignment(abfd, sdata_sec);
+	  int align = bfd_get_section_alignment(abfd, sbss_sec);
+	  int mask = (1 << align) - 1;
+//printf("align1 %d align %d\n", align1, align);
+	  if (align > align1)
+	    bfd_set_section_alignment(abfd, sdata_sec, align);
+//printf("data_size 0x%x\n", sbss_sec->vma - sdata_sec->vma);
+//printf("-> 0x%x\n", (sbss_sec->vma - sdata_sec->vma + mask) & ~mask);
+//printf("section_size : 0x%x\n",sdata_sec->_raw_size);
+	  sdata_sec->_raw_size = (sdata_sec->_raw_size + mask) & ~mask;
+//printf("section_size : 0x%x\n",sdata_sec->_raw_size);
+	  //bfd_set_section_vma(abfd, sbss_sec, (sbss_sec->vma - sdata_sec->vma + mask) & ~mask);
+	  bfd_set_section_vma(abfd, sbss_sec, sdata_sec->_raw_size);
+	  //sdata_sec->_raw_size = sbss_sec->vma;
+//printf("section_size : 0x%x\n",sdata_sec->_raw_size);
+	}
+      bfd_set_section_vma(abfd, sdata_sec, 0);
+    }
+
+  /* Figure out the file positions for everything but the symbol table
+     and the relocs.  We set symcount to force assign_section_numbers
+     to create a symbol table.  */
+  abfd->symcount = 1;
+  BFD_ASSERT (! abfd->output_has_begun);
+  if (! _bfd_elf_compute_section_file_positions (abfd, info))
+    goto error_return;
+
+  /* That created the reloc sections.  Set their sizes, and assign
+     them file positions, and allocate some buffers.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0)
+	{
+	  Elf_Internal_Shdr *rel_hdr;
+	  register struct elf_link_hash_entry **p, **pend;
+
+	  rel_hdr = &elf_section_data (o)->rel_hdr;
+
+	  rel_hdr->sh_size = rel_hdr->sh_entsize * o->reloc_count;
+
+	  /* The contents field must last into write_object_contents,
+	     so we allocate it with bfd_alloc rather than malloc.  */
+	  rel_hdr->contents = (PTR) bfd_alloc (abfd, rel_hdr->sh_size);
+	  if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0)
+	    goto error_return;
+
+	  p = ((struct elf_link_hash_entry **)
+	       bfd_malloc (o->reloc_count
+			   * sizeof (struct elf_link_hash_entry *)));
+	  if (p == NULL && o->reloc_count != 0)
+	    goto error_return;
+	  elf_section_data (o)->rel_hashes = p;
+	  pend = p + o->reloc_count;
+	  for (; p < pend; p++)
+	    *p = NULL;
+
+	  /* Use the reloc_count field as an index when outputting the
+	     relocs.  */
+	  o->reloc_count = 0;
+	}
+    }
+
+  /* We have now assigned file positions for all the sections except
+     relocations, .symtab, and .strtab.  We start the .symtab section
+     at the current file position, and write directly to it.  We build
+     the .strtab section in memory.  */
+  abfd->symcount = 0;
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  /* sh_name is set in prep_headers.  */
+  symtab_hdr->sh_type = SHT_SYMTAB;
+  symtab_hdr->sh_flags = 0;
+  symtab_hdr->sh_addr = 0;
+  symtab_hdr->sh_size = 0;
+  symtab_hdr->sh_entsize = sizeof (Elf_External_Sym);
+  /* sh_link is set in assign_section_numbers.  */
+  /* sh_info is set below.  */
+  /* sh_offset is set just below.  */
+  symtab_hdr->sh_addralign = 4;  /* FIXME: system dependent?  */
+
+  off = elf_tdata (abfd)->next_file_pos;
+  off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, true);
+
+  /* Note that at this point elf_tdata (abfd)->next_file_pos is
+     incorrect.  We do not yet know the size of the .symtab section.
+     We correct next_file_pos below, after we do know the size.  */
+
+  /* Allocate a buffer to hold swapped out symbols.  This is to avoid
+     continuously seeking to the right position in the file.  */
+  if (! info->keep_memory || max_sym_count < 20)
+    finfo.symbuf_size = 20;
+  else
+    finfo.symbuf_size = max_sym_count;
+  finfo.symbuf = ((Elf_External_Sym *)
+		  bfd_malloc (finfo.symbuf_size * sizeof (Elf_External_Sym)));
+  if (finfo.symbuf == NULL)
+    goto error_return;
+
+  /* Start writing out the symbol table.  The first symbol is always a
+     dummy symbol.  */
+  elfsym.st_value = 0;
+  elfsym.st_size = 0;
+  elfsym.st_info = 0;
+  elfsym.st_other = 0;
+  elfsym.st_shndx = SHN_UNDEF;
+  if (! elf_link_output_sym (&finfo, (const char *) NULL,
+			     &elfsym, bfd_und_section_ptr))
+    goto error_return;
+
+#if 0
+  /* Some standard ELF linkers do this, but we don't because it causes
+     bootstrap comparison failures.  */
+  /* Output a file symbol for the output file as the second symbol.
+     We output this even if we are discarding local symbols, although
+     I'm not sure if this is correct.  */
+  elfsym.st_value = 0;
+  elfsym.st_size = 0;
+  elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
+  elfsym.st_other = 0;
+  elfsym.st_shndx = SHN_ABS;
+  if (! elf_link_output_sym (&finfo, bfd_get_filename (abfd),
+			     &elfsym, bfd_abs_section_ptr))
+    goto error_return;
+#endif
+
+  /* Output a symbol for each section.  We output these even if we are
+     discarding local symbols, since they are used for relocs.  These
+     symbols have no names.  We store the index of each one in the
+     index field of the section, so that we can find it again when
+     outputting relocs.  */
+  elfsym.st_size = 0;
+  elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+  elfsym.st_other = 0;
+  for (i = 1; i < elf_elfheader (abfd)->e_shnum; i++)
+    {
+      o = section_from_elf_index (abfd, i);
+      if (o != NULL)
+	o->target_index = abfd->symcount;
+      elfsym.st_shndx = i;
+      elfsym.st_value = 0;
+      if (! elf_link_output_sym (&finfo, (const char *) NULL,
+				 &elfsym, o))
+	goto error_return;
+    }
+
+  /* Allocate some memory to hold information read in from the input
+     files.  */
+  finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
+  finfo.external_relocs = (PTR) bfd_malloc (max_external_reloc_size);
+  finfo.internal_relocs = ((Elf_Internal_Rela *)
+			   bfd_malloc (max_internal_reloc_count
+				       * sizeof (Elf_Internal_Rela)));
+  finfo.external_syms = ((Elf_External_Sym *)
+			 bfd_malloc (max_sym_count
+				     * sizeof (Elf_External_Sym)));
+  finfo.internal_syms = ((Elf_Internal_Sym *)
+			 bfd_malloc (max_sym_count
+				     * sizeof (Elf_Internal_Sym)));
+  finfo.indices = (long *) bfd_malloc (max_sym_count * sizeof (long));
+  finfo.sections = ((asection **)
+		    bfd_malloc (max_sym_count * sizeof (asection *)));
+  if ((finfo.contents == NULL && max_contents_size != 0)
+      || (finfo.external_relocs == NULL && max_external_reloc_size != 0)
+      || (finfo.internal_relocs == NULL && max_internal_reloc_count != 0)
+      || (finfo.external_syms == NULL && max_sym_count != 0)
+      || (finfo.internal_syms == NULL && max_sym_count != 0)
+      || (finfo.indices == NULL && max_sym_count != 0)
+      || (finfo.sections == NULL && max_sym_count != 0))
+    goto error_return;
+
+  if (ddr_sec)
+    {
+      ddr_count = 0;
+      ddr_ptr = (bfd_byte *)bfd_alloc(abfd, 4 * max_datadata_reloc_count + 4);
+      if (ddr_ptr)
+	ddr_ptr += 4;
+      else
+	goto error_return;
+    }
+  else
+    ddr_ptr = NULL;
+
+  /* Since ELF permits relocations to be against local symbols, we
+     must have the local symbols available when we do the relocations.
+     Since we would rather only read the local symbols once, and we
+     would rather not keep them in memory, we handle all the
+     relocations for a single input file at the same time.
+
+     Unfortunately, there is no way to know the total number of local
+     symbols until we have seen all of them, and the local symbol
+     indices precede the global symbol indices.  This means that when
+     we are generating relocateable output, and we see a reloc against
+     a global symbol, we can not know the symbol index until we have
+     finished examining all the local symbols to see which ones we are
+     going to output.  To deal with this, we keep the relocations in
+     memory, and don't output them until the end of the link.  This is
+     an unfortunate waste of memory, but I don't see a good way around
+     it.  Fortunately, it only happens when performing a relocateable
+     link, which is not the common case.  FIXME: If keep_memory is set
+     we could write the relocs out and then read them again; I don't
+     know how bad the memory loss will be.  */
+
+  for (sub = info->input_bfds; sub != NULL; sub = sub->next)
+    sub->output_has_begun = false;
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      for (p = o->link_order_head; p != NULL; p = p->next)
+	{
+	  if (p->type == bfd_indirect_link_order
+	      && (bfd_get_flavour (p->u.indirect.section->owner)
+		  == bfd_target_elf_flavour))
+	    {
+	      sub = p->u.indirect.section->owner;
+	      if (! sub->output_has_begun)
+		{
+		  if (! elf_link_input_bfd (&finfo, sub))
+		    goto error_return;
+		  sub->output_has_begun = true;
+		}
+	    }
+	  else if (p->type == bfd_section_reloc_link_order
+		   || p->type == bfd_symbol_reloc_link_order)
+	    {
+	      if (! elf_reloc_link_order (abfd, info, o, p))
+		goto error_return;
+	    }
+	  else
+	    {
+	      if (! _bfd_default_link_order (abfd, info, o, p))
+		goto error_return;
+	    }
+	}
+    }
+
+  /* Set the vma of the sections to 0. We can't do that before, otherwise the
+     relocation doesn't work properly for .sbss. */
+  {
+    int n = elf_elfheader(abfd)->e_shnum;
+    Elf_Internal_Shdr **hdr = elf_elfsections(abfd);
+    for (i = 1; i < n; ++i, ++hdr)
+      (*hdr)->sh_addr = 0;
+  }
+
+  /* That wrote out all the local symbols.  Finish up the symbol table
+     with the global symbols.  */
+
+  if (info->strip != strip_all && info->shared)
+    {
+      /* Output any global symbols that got converted to local in a
+         version script.  We do this in a separate step since ELF
+         requires all local symbols to appear prior to any global
+         symbols.  FIXME: We should only do this if some global
+         symbols were, in fact, converted to become local.  FIXME:
+         Will this work correctly with the Irix 5 linker?  */
+      eoinfo.failed = false;
+      eoinfo.finfo = &finfo;
+      eoinfo.localsyms = true;
+      elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
+			      (PTR) &eoinfo);
+      if (eoinfo.failed)
+	return false;
+    }
+
+  /* The sh_info field records the index of the first non local
+     symbol.  */
+  symtab_hdr->sh_info = abfd->symcount;
+  if (dynamic)
+    elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info = 1;
+
+  /* We get the global symbols from the hash table.  */
+  eoinfo.failed = false;
+  eoinfo.localsyms = false;
+  eoinfo.finfo = &finfo;
+  elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
+			  (PTR) &eoinfo);
+  if (eoinfo.failed)
+    return false;
+
+  /* Flush all symbols to the file.  */
+  if (! elf_link_flush_output_syms (&finfo))
+    return false;
+
+  /* Now we know the size of the symtab section.  */
+  off += symtab_hdr->sh_size;
+
+  /* Add the __datadata_relocs table. */
+  if (ddr_sec)
+    {
+      int tmp = ddr_count ? ddr_count : -1;
+      Elf_Internal_Shdr *hdr = elf_elfsections(abfd)[_bfd_elf_section_from_bfd_section(abfd, ddr_sec)];
+      ddr_sec->_cooked_size = ddr_sec->_raw_size = hdr->sh_size = 4 * ddr_count + 4;
+      hdr->sh_addralign = 4;
+      off = _bfd_elf_assign_file_position_for_section (hdr, off, true);
+      ddr_ptr -= (ddr_count + 1) * 4;
+      ddr_ptr[0] = (bfd_byte)(tmp >> 24);
+      ddr_ptr[1] = (bfd_byte)(tmp >> 16);
+      ddr_ptr[2] = (bfd_byte)(tmp >> 8);
+      ddr_ptr[3] = (bfd_byte)tmp;
+      bfd_set_section_contents(abfd, ddr_sec, ddr_ptr, 0, hdr->sh_size);
+    }
+
+  /* Finish up and write out the symbol string table (.strtab)
+     section.  */
+  symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
+  /* sh_name was set in prep_headers.  */
+  symstrtab_hdr->sh_type = SHT_STRTAB;
+  symstrtab_hdr->sh_flags = 0;
+  symstrtab_hdr->sh_addr = 0;
+  symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab);
+  symstrtab_hdr->sh_entsize = 0;
+  symstrtab_hdr->sh_link = 0;
+  symstrtab_hdr->sh_info = 0;
+  /* sh_offset is set just below.  */
+  symstrtab_hdr->sh_addralign = 1;
+
+  off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, true);
+  elf_tdata (abfd)->next_file_pos = off;
+
+  if (abfd->symcount > 0)
+    {
+      if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0
+	  || ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
+	return false;
+    }
+
+  /* Adjust the relocs to have the correct symbol indices.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      struct elf_link_hash_entry **rel_hash;
+      Elf_Internal_Shdr *rel_hdr;
+      /*printf("section %p\n",o);*/
+
+      if ((o->flags & SEC_RELOC) == 0)
+	continue;
+
+      /*printf("adjusting %d relocs\n",o->reloc_count);*/
+      rel_hash = elf_section_data (o)->rel_hashes;
+      rel_hdr = &elf_section_data (o)->rel_hdr;
+      for (i = 0; i < o->reloc_count; i++, rel_hash++)
+	{
+	  if (*rel_hash == NULL)
+	    continue;
+
+	  BFD_ASSERT ((*rel_hash)->indx >= 0);
+
+	  if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+	    {
+	      Elf_External_Rel *erel;
+	      Elf_Internal_Rel irel;
+
+	      erel = (Elf_External_Rel *) rel_hdr->contents + i;
+	      elf_swap_reloc_in (abfd, erel, &irel);
+	      irel.r_info = ELF_R_INFO ((*rel_hash)->indx,
+					ELF_R_TYPE (irel.r_info));
+	      elf_swap_reloc_out (abfd, &irel, erel);
+	    }
+	  else
+	    {
+	      Elf_External_Rela *erela;
+	      Elf_Internal_Rela irela;
+
+	      BFD_ASSERT (rel_hdr->sh_entsize
+			  == sizeof (Elf_External_Rela));
+
+	      erela = (Elf_External_Rela *) rel_hdr->contents + i;
+	      elf_swap_reloca_in (abfd, erela, &irela);
+	      /*printf("%x -> ",irela.r_info);*/
+	      irela.r_info = ELF_R_INFO ((*rel_hash)->indx,
+					 ELF_R_TYPE (irela.r_info));
+	      /*printf("%x\n",irela.r_info);*/
+	      elf_swap_reloca_out (abfd, &irela, erela);
+	    }
+	}
+
+      rel_hdr->sh_size = o->reloc_count * rel_hdr->sh_entsize;
+
+      /* Set the reloc_count field to 0 to prevent write_relocs from
+	 trying to swap the relocs out itself.  */
+      o->reloc_count = 0;
+    }
+
+  _bfd_elf_assign_file_positions_for_relocs (abfd);
+
+  /* If we are linking against a dynamic object, or generating a
+     shared library, finish up the dynamic linking information.  */
+  if (dynamic)
+    {
+      Elf_External_Dyn *dyncon, *dynconend;
+
+      /* Fix up .dynamic entries.  */
+      o = bfd_get_section_by_name (dynobj, ".dynamic");
+      BFD_ASSERT (o != NULL);
+
+      dyncon = (Elf_External_Dyn *) o->contents;
+      dynconend = (Elf_External_Dyn *) (o->contents + o->_raw_size);
+      for (; dyncon < dynconend; dyncon++)
+	{
+	  Elf_Internal_Dyn dyn;
+	  const char *name;
+	  unsigned int type;
+
+	  elf_swap_dyn_in (dynobj, dyncon, &dyn);
+
+	  switch (dyn.d_tag)
+	    {
+	    default:
+	      break;
+
+	      /* SVR4 linkers seem to set DT_INIT and DT_FINI based on
+                 magic _init and _fini symbols.  This is pretty ugly,
+                 but we are compatible.  */
+	    case DT_INIT:
+	      name = "_init";
+	      goto get_sym;
+	    case DT_FINI:
+	      name = "_fini";
+	    get_sym:
+	      {
+		struct elf_link_hash_entry *h;
+
+		h = elf_link_hash_lookup (elf_hash_table (info), name,
+					  false, false, true);
+		if (h != NULL
+		    && (h->root.type == bfd_link_hash_defined
+			|| h->root.type == bfd_link_hash_defweak))
+		  {
+		    dyn.d_un.d_val = h->root.u.def.value;
+		    o = h->root.u.def.section;
+		    if (o->output_section != NULL)
+		      dyn.d_un.d_val += (o->output_section->vma
+					 + o->output_offset);
+		    else
+		      {
+			/* The symbol is imported from another shared
+			   library and does not apply to this one.  */
+			dyn.d_un.d_val = 0;
+		      }
+
+		    elf_swap_dyn_out (dynobj, &dyn, dyncon);
+		  }
+	      }
+	      break;
+
+	    case DT_HASH:
+	      name = ".hash";
+	      goto get_vma;
+	    case DT_STRTAB:
+	      name = ".dynstr";
+	      goto get_vma;
+	    case DT_SYMTAB:
+	      name = ".dynsym";
+	      goto get_vma;
+	    case DT_VERDEF:
+	      name = ".gnu.version_d";
+	      goto get_vma;
+	    case DT_VERNEED:
+	      name = ".gnu.version_r";
+	      goto get_vma;
+	    case DT_VERSYM:
+	      name = ".gnu.version";
+	    get_vma:
+	      o = bfd_get_section_by_name (abfd, name);
+	      BFD_ASSERT (o != NULL);
+	      dyn.d_un.d_ptr = o->vma;
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+
+	    case DT_REL:
+	    case DT_RELA:
+	    case DT_RELSZ:
+	    case DT_RELASZ:
+	      if (dyn.d_tag == DT_REL || dyn.d_tag == DT_RELSZ)
+		type = SHT_REL;
+	      else
+		type = SHT_RELA;
+	      dyn.d_un.d_val = 0;
+	      for (i = 1; i < elf_elfheader (abfd)->e_shnum; i++)
+		{
+		  Elf_Internal_Shdr *hdr;
+
+		  hdr = elf_elfsections (abfd)[i];
+		  if (hdr->sh_type == type
+		      && (hdr->sh_flags & SHF_ALLOC) != 0)
+		    {
+		      if (dyn.d_tag == DT_RELSZ || dyn.d_tag == DT_RELASZ)
+			dyn.d_un.d_val += hdr->sh_size;
+		      else
+			{
+			  if (dyn.d_un.d_val == 0
+			      || hdr->sh_addr < dyn.d_un.d_val)
+			    dyn.d_un.d_val = hdr->sh_addr;
+			}
+		    }
+		}
+	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
+	      break;
+	    }
+	}
+    }
+
+  /* If we have created any dynamic sections, then output them.  */
+  if (dynobj != NULL)
+    {
+      if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info))
+	goto error_return;
+
+      for (o = dynobj->sections; o != NULL; o = o->next)
+	{
+	  if ((o->flags & SEC_HAS_CONTENTS) == 0
+	      || o->_raw_size == 0)
+	    continue;
+	  if ((o->flags & SEC_LINKER_CREATED) == 0)
+	    {
+	      /* At this point, we are only interested in sections
+                 created by elf_link_create_dynamic_sections.  */
+	      continue;
+	    }
+	  if ((elf_section_data (o->output_section)->this_hdr.sh_type
+	       != SHT_STRTAB)
+	      || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0)
+	    {
+	      if (! bfd_set_section_contents (abfd, o->output_section,
+					      o->contents, o->output_offset,
+					      o->_raw_size))
+		goto error_return;
+	    }
+	  else
+	    {
+	      file_ptr off;
+
+	      /* The contents of the .dynstr section are actually in a
+                 stringtab.  */
+	      off = elf_section_data (o->output_section)->this_hdr.sh_offset;
+	      if (bfd_seek (abfd, off, SEEK_SET) != 0
+		  || ! _bfd_stringtab_emit (abfd,
+					    elf_hash_table (info)->dynstr))
+		goto error_return;
+	    }
+	}
+    }
+
+  /* If we have optimized stabs strings, output them.  */
+  if (elf_hash_table (info)->stab_info != NULL)
+    {
+      if (! _bfd_write_stab_strings (abfd, &elf_hash_table (info)->stab_info))
+	goto error_return;
+    }
+
+  if (finfo.symstrtab != NULL)
+    _bfd_stringtab_free (finfo.symstrtab);
+  if (finfo.contents != NULL)
+    free (finfo.contents);
+  if (finfo.external_relocs != NULL)
+    free (finfo.external_relocs);
+  if (finfo.internal_relocs != NULL)
+    free (finfo.internal_relocs);
+  if (finfo.external_syms != NULL)
+    free (finfo.external_syms);
+  if (finfo.internal_syms != NULL)
+    free (finfo.internal_syms);
+  if (finfo.indices != NULL)
+    free (finfo.indices);
+  if (finfo.sections != NULL)
+    free (finfo.sections);
+  if (finfo.symbuf != NULL)
+    free (finfo.symbuf);
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0
+	  && elf_section_data (o)->rel_hashes != NULL)
+	free (elf_section_data (o)->rel_hashes);
+    }
+
+  elf_tdata (abfd)->linker = true;
+
+  return true;
+
+ error_return:
+  if (finfo.symstrtab != NULL)
+    _bfd_stringtab_free (finfo.symstrtab);
+  if (finfo.contents != NULL)
+    free (finfo.contents);
+  if (finfo.external_relocs != NULL)
+    free (finfo.external_relocs);
+  if (finfo.internal_relocs != NULL)
+    free (finfo.internal_relocs);
+  if (finfo.external_syms != NULL)
+    free (finfo.external_syms);
+  if (finfo.internal_syms != NULL)
+    free (finfo.internal_syms);
+  if (finfo.indices != NULL)
+    free (finfo.indices);
+  if (finfo.sections != NULL)
+    free (finfo.sections);
+  if (finfo.symbuf != NULL)
+    free (finfo.symbuf);
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0
+	  && elf_section_data (o)->rel_hashes != NULL)
+	free (elf_section_data (o)->rel_hashes);
+    }
+
+  return false;
+}
+
+/* Add a symbol to the output symbol table.  */
+
+static boolean
+elf_link_output_sym (finfo, name, elfsym, input_sec)
+     struct elf_final_link_info *finfo;
+     const char *name;
+     Elf_Internal_Sym *elfsym;
+     asection *input_sec;
+{
+  boolean (*output_symbol_hook) PARAMS ((bfd *,
+					 struct bfd_link_info *info,
+					 const char *,
+					 Elf_Internal_Sym *,
+					 asection *));
+
+  output_symbol_hook = get_elf_backend_data (finfo->output_bfd)->
+    elf_backend_link_output_symbol_hook;
+  if (output_symbol_hook != NULL)
+    {
+      if (! ((*output_symbol_hook)
+	     (finfo->output_bfd, finfo->info, name, elfsym, input_sec)))
+	return false;
+    }
+
+  if (name == (const char *) NULL || *name == '\0')
+    elfsym->st_name = 0;
+  else
+    {
+      elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
+							    name, true,
+							    false);
+      if (elfsym->st_name == (unsigned long) -1)
+	return false;
+    }
+
+  if (finfo->symbuf_count >= finfo->symbuf_size)
+    {
+      if (! elf_link_flush_output_syms (finfo))
+	return false;
+    }
+
+  elf_swap_symbol_out (finfo->output_bfd, elfsym,
+		       (PTR) (finfo->symbuf + finfo->symbuf_count));
+  ++finfo->symbuf_count;
+
+  ++finfo->output_bfd->symcount;
+
+  return true;
+}
+
+/* Flush the output symbols to the file.  */
+
+static boolean
+elf_link_flush_output_syms (finfo)
+     struct elf_final_link_info *finfo;
+{
+  if (finfo->symbuf_count > 0)
+    {
+      Elf_Internal_Shdr *symtab;
+
+      symtab = &elf_tdata (finfo->output_bfd)->symtab_hdr;
+
+      if (bfd_seek (finfo->output_bfd, symtab->sh_offset + symtab->sh_size,
+		    SEEK_SET) != 0
+	  || (bfd_write ((PTR) finfo->symbuf, finfo->symbuf_count,
+			 sizeof (Elf_External_Sym), finfo->output_bfd)
+	      != finfo->symbuf_count * sizeof (Elf_External_Sym)))
+	return false;
+
+      symtab->sh_size += finfo->symbuf_count * sizeof (Elf_External_Sym);
+
+      finfo->symbuf_count = 0;
+    }
+
+  return true;
+}
+
+/* Add an external symbol to the symbol table.  This is called from
+   the hash table traversal routine.  When generating a shared object,
+   we go through the symbol table twice.  The first time we output
+   anything that might have been forced to local scope in a version
+   script.  The second time we output the symbols that are still
+   global symbols.  */
+
+static boolean
+elf_link_output_extsym (h, data)
+     struct elf_link_hash_entry *h;
+     PTR data;
+{
+  struct elf_outext_info *eoinfo = (struct elf_outext_info *) data;
+  struct elf_final_link_info *finfo = eoinfo->finfo;
+  boolean strip;
+  Elf_Internal_Sym sym;
+  asection *input_sec;
+
+  /* Decide whether to output this symbol in this pass.  */
+  if (eoinfo->localsyms)
+    {
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+	return true;
+    }
+  else
+    {
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+	return true;
+    }
+
+  /* If we are not creating a shared library, and this symbol is
+     referenced by a shared library but is not defined anywhere, then
+     warn that it is undefined.  If we do not do this, the runtime
+     linker will complain that the symbol is undefined when the
+     program is run.  We don't have to worry about symbols that are
+     referenced by regular files, because we will already have issued
+     warnings for them.  */
+  if (! finfo->info->relocateable
+	&& ! finfo->info->shared
+      && h->root.type == bfd_link_hash_undefined
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
+    {
+      if (! ((*finfo->info->callbacks->undefined_symbol)
+	     (finfo->info, h->root.root.string, h->root.u.undef.abfd,
+	      (asection *) NULL, 0)))
+	{
+	  eoinfo->failed = true;
+	  return false;
+	}
+    }
+
+  /* We don't want to output symbols that have never been mentioned by
+     a regular file, or that we have been told to strip.  However, if
+     h->indx is set to -2, the symbol is used by a reloc and we must
+     output it.  */
+  if (h->indx == -2)
+    strip = false;
+  else if (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+	    || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+	   && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+	   && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
+    strip = true;
+  else if (finfo->info->strip == strip_all
+	   || (finfo->info->strip == strip_some
+	       && bfd_hash_lookup (finfo->info->keep_hash,
+				   h->root.root.string,
+				   false, false) == NULL))
+    strip = true;
+  else
+    strip = false;
+
+  /* If we're stripping it, and it's not a dynamic symbol, there's
+     nothing else to do.  */
+  if (strip && h->dynindx == -1)
+    return true;
+
+  sym.st_value = 0;
+  sym.st_size = h->size;
+  sym.st_other = h->other;
+  if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+    sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
+  else if (h->root.type == bfd_link_hash_undefweak
+	   || h->root.type == bfd_link_hash_defweak)
+    sym.st_info = ELF_ST_INFO (STB_WEAK, h->type);
+  else
+    sym.st_info = ELF_ST_INFO (STB_GLOBAL, h->type);
+
+  switch (h->root.type)
+    {
+    default:
+    case bfd_link_hash_new:
+      abort ();
+      return false;
+
+    case bfd_link_hash_undefined:
+      input_sec = bfd_und_section_ptr;
+      sym.st_shndx = SHN_UNDEF;
+      break;
+
+    case bfd_link_hash_undefweak:
+      input_sec = bfd_und_section_ptr;
+      sym.st_shndx = SHN_UNDEF;
+      break;
+
+    case bfd_link_hash_defined:
+    case bfd_link_hash_defweak:
+      {
+	input_sec = h->root.u.def.section;
+	if (input_sec->output_section != NULL)
+	  {
+	    sym.st_shndx =
+	      _bfd_elf_section_from_bfd_section (finfo->output_bfd,
+						 input_sec->output_section);
+	    if (sym.st_shndx == (unsigned short) -1)
+	      {
+		eoinfo->failed = true;
+		return false;
+	      }
+
+	    /* ELF symbols in relocateable files are section relative,
+	       but in nonrelocateable files they are virtual
+	       addresses.  */
+	    sym.st_value = h->root.u.def.value + input_sec->output_offset;
+	    /*if (! finfo->info->relocateable)
+	      sym.st_value += input_sec->output_section->vma;*/
+	    /*sym.st_value -= input_sec->output_section->vma;*/
+	  }
+	else
+	  {
+	    BFD_ASSERT (input_sec->owner == NULL
+			|| (input_sec->owner->flags & DYNAMIC) != 0);
+	    sym.st_shndx = SHN_UNDEF;
+	    input_sec = bfd_und_section_ptr;
+	  }
+      }
+      break;
+
+    case bfd_link_hash_common:
+      input_sec = h->root.u.c.p->section;
+      sym.st_shndx = SHN_COMMON;
+      sym.st_value = 1 << h->root.u.c.p->alignment_power;
+      break;
+
+    case bfd_link_hash_indirect:
+      /* These symbols are created by symbol versioning.  They point
+         to the decorated version of the name.  For example, if the
+         symbol foo@@GNU_1.2 is the default, which should be used when
+         foo is used with no version, then we add an indirect symbol
+         foo which points to foo@@GNU_1.2.  We ignore these symbols,
+         since the indirected symbol is already in the hash table.  If
+         the indirect symbol is non-ELF, fall through and output it.  */
+      if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) == 0)
+	return true;
+
+      /* Fall through.  */
+    case bfd_link_hash_warning:
+      /* We can't represent these symbols in ELF, although a warning
+         symbol may have come from a .gnu.warning.SYMBOL section.  We
+         just put the target symbol in the hash table.  If the target
+         symbol does not really exist, don't do anything.  */
+      if (h->root.u.i.link->type == bfd_link_hash_new)
+	return true;
+      return (elf_link_output_extsym
+	      ((struct elf_link_hash_entry *) h->root.u.i.link, data));
+    }
+
+  /* Give the processor backend a chance to tweak the symbol value,
+     and also to finish up anything that needs to be done for this
+     symbol.  */
+  if ((h->dynindx != -1
+       || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+      && elf_hash_table (finfo->info)->dynamic_sections_created)
+    {
+      struct elf_backend_data *bed;
+
+      bed = get_elf_backend_data (finfo->output_bfd);
+      if (! ((*bed->elf_backend_finish_dynamic_symbol)
+	     (finfo->output_bfd, finfo->info, h, &sym)))
+	{
+	  eoinfo->failed = true;
+	  return false;
+	}
+    }
+
+  /* If this symbol should be put in the .dynsym section, then put it
+     there now.  We have already know the symbol index.  We also fill
+     in the entry in the .hash section.  */
+  if (h->dynindx != -1
+      && elf_hash_table (finfo->info)->dynamic_sections_created)
+    {
+      char *p, *copy;
+      const char *name;
+      size_t bucketcount;
+      size_t bucket;
+      bfd_byte *bucketpos;
+      bfd_vma chain;
+
+      sym.st_name = h->dynstr_index;
+
+      elf_swap_symbol_out (finfo->output_bfd, &sym,
+			   (PTR) (((Elf_External_Sym *)
+				   finfo->dynsym_sec->contents)
+				  + h->dynindx));
+
+      /* We didn't include the version string in the dynamic string
+         table, so we must not consider it in the hash table.  */
+      name = h->root.root.string;
+      p = strchr (name, ELF_VER_CHR);
+      if (p == NULL)
+	copy = NULL;
+      else
+	{
+	  copy = bfd_alloc (finfo->output_bfd, p - name + 1);
+	  strncpy (copy, name, p - name);
+	  copy[p - name] = '\0';
+	  name = copy;
+	}
+
+      bucketcount = elf_hash_table (finfo->info)->bucketcount;
+      bucket = bfd_elf_hash ((const unsigned char *) name) % bucketcount;
+      bucketpos = ((bfd_byte *) finfo->hash_sec->contents
+		   + (bucket + 2) * (ARCH_SIZE / 8));
+      chain = get_word (finfo->output_bfd, bucketpos);
+      put_word (finfo->output_bfd, h->dynindx, bucketpos);
+      put_word (finfo->output_bfd, chain,
+		((bfd_byte *) finfo->hash_sec->contents
+		 + (bucketcount + 2 + h->dynindx) * (ARCH_SIZE / 8)));
+
+      if (copy != NULL)
+	bfd_release (finfo->output_bfd, copy);
+
+      if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL)
+	{
+	  Elf_Internal_Versym iversym;
+
+	  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+	    {
+	      if (h->verinfo.verdef == NULL)
+		iversym.vs_vers = 0;
+	      else
+		iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1;
+	    }
+	  else
+	    {
+	      if (h->verinfo.vertree == NULL)
+		iversym.vs_vers = 1;
+	      else
+		iversym.vs_vers = h->verinfo.vertree->vernum + 1;
+	    }
+
+	  if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0)
+	    iversym.vs_vers |= VERSYM_HIDDEN;
+
+	  _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym,
+				    (((Elf_External_Versym *)
+				      finfo->symver_sec->contents)
+				     + h->dynindx));
+	}
+    }
+
+  /* If we're stripping it, then it was just a dynamic symbol, and
+     there's nothing else to do.  */
+  if (strip)
+    return true;
+
+  h->indx = finfo->output_bfd->symcount;
+
+  if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec))
+    {
+      eoinfo->failed = true;
+      return false;
+    }
+
+  return true;
+}
+
+/* Link an input file into the linker output file.  This function
+   handles all the sections and relocations of the input file at once.
+   This is so that we only have to read the local symbols once, and
+   don't have to keep them in memory.  */
+
+static boolean
+elf_link_input_bfd (finfo, input_bfd)
+     struct elf_final_link_info *finfo;
+     bfd *input_bfd;
+{
+  boolean (*relocate_section) PARAMS ((bfd *, struct bfd_link_info *,
+				       bfd *, asection *, bfd_byte *,
+				       Elf_Internal_Rela *,
+				       Elf_Internal_Sym *, asection **));
+  bfd *output_bfd;
+  Elf_Internal_Shdr *symtab_hdr;
+  size_t locsymcount;
+  size_t extsymoff;
+  Elf_External_Sym *external_syms;
+  Elf_External_Sym *esym;
+  Elf_External_Sym *esymend;
+  Elf_Internal_Sym *isym;
+  long *pindex;
+  asection **ppsection;
+  asection *o;
+
+  output_bfd = finfo->output_bfd;
+  relocate_section =
+    get_elf_backend_data (output_bfd)->elf_backend_relocate_section;
+
+  /* If this is a dynamic object, we don't want to do anything here:
+     we don't want the local symbols, and we don't want the section
+     contents.  */
+  if ((input_bfd->flags & DYNAMIC) != 0)
+    return true;
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  if (elf_bad_symtab (input_bfd))
+    {
+      locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
+      extsymoff = 0;
+    }
+  else
+    {
+      locsymcount = symtab_hdr->sh_info;
+      extsymoff = symtab_hdr->sh_info;
+    }
+
+  /* Read the local symbols.  */
+  if (symtab_hdr->contents != NULL)
+    external_syms = (Elf_External_Sym *) symtab_hdr->contents;
+  else if (locsymcount == 0)
+    external_syms = NULL;
+  else
+    {
+      external_syms = finfo->external_syms;
+      if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
+	  || (bfd_read (external_syms, sizeof (Elf_External_Sym),
+			locsymcount, input_bfd)
+	      != locsymcount * sizeof (Elf_External_Sym)))
+	return false;
+    }
+
+  /* Swap in the local symbols and write out the ones which we know
+     are going into the output file.  */
+  esym = external_syms;
+  esymend = esym + locsymcount;
+  isym = finfo->internal_syms;
+  pindex = finfo->indices;
+  ppsection = finfo->sections;
+  for (; esym < esymend; esym++, isym++, pindex++, ppsection++)
+    {
+      asection *isec;
+      const char *name;
+      Elf_Internal_Sym osym;
+
+      elf_swap_symbol_in (input_bfd, esym, isym);
+      *pindex = -1;
+
+      if (elf_bad_symtab (input_bfd))
+	{
+	  if (ELF_ST_BIND (isym->st_info) != STB_LOCAL)
+	    {
+	      *ppsection = NULL;
+	      continue;
+	    }
+	}
+
+      if (isym->st_shndx == SHN_UNDEF)
+	isec = bfd_und_section_ptr;
+      else if (isym->st_shndx > 0 && isym->st_shndx < SHN_LORESERVE)
+	isec = section_from_elf_index (input_bfd, isym->st_shndx);
+      else if (isym->st_shndx == SHN_ABS)
+	isec = bfd_abs_section_ptr;
+      else if (isym->st_shndx == SHN_COMMON)
+	isec = bfd_com_section_ptr;
+      else
+	{
+	  /* Who knows?  */
+	  isec = NULL;
+	}
+
+      *ppsection = isec;
+
+      /* Don't output the first, undefined, symbol.  */
+      if (esym == external_syms)
+	continue;
+
+      /* If we are stripping all symbols, we don't want to output this
+	 one.  */
+      if (finfo->info->strip == strip_all)
+	continue;
+
+      /* We never output section symbols.  Instead, we use the section
+	 symbol of the corresponding section in the output file.  */
+      if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
+	continue;
+
+      /* If we are discarding all local symbols, we don't want to
+	 output this one.  If we are generating a relocateable output
+	 file, then some of the local symbols may be required by
+	 relocs; we output them below as we discover that they are
+	 needed.  */
+      if (finfo->info->discard == discard_all)
+	continue;
+
+      /* If this symbol is defined in a section which we are
+         discarding, we don't need to keep it, but note that
+         linker_mark is only reliable for sections that have contents.
+         For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
+         as well as linker_mark.  */
+      if (isym->st_shndx > 0
+	  && isym->st_shndx < SHN_LORESERVE
+	  && isec != NULL
+	  && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
+	      || (! finfo->info->relocateable
+		&& (isec->flags & SEC_EXCLUDE) != 0)))
+	continue;
+
+      /* Get the name of the symbol.  */
+      name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link,
+					      isym->st_name);
+      if (name == NULL)
+	return false;
+
+      /* See if we are discarding symbols with this name.  */
+      if ((finfo->info->strip == strip_some
+	   && (bfd_hash_lookup (finfo->info->keep_hash, name, false, false)
+	       == NULL))
+	  || (finfo->info->discard == discard_l
+	      && bfd_is_local_label_name (input_bfd, name)))
+	continue;
+
+      /* If we get here, we are going to output this symbol.  */
+
+      osym = *isym;
+
+      /* Adjust the section index for the output file.  */
+      osym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
+							 isec->output_section);
+      if (osym.st_shndx == (unsigned short) -1)
+	return false;
+
+      *pindex = output_bfd->symcount;
+
+      /* ELF symbols in relocateable files are section relative, but
+	 in executable files they are virtual addresses.  Note that
+	 this code assumes that all ELF sections have an associated
+	 BFD section with a reasonable value for output_offset; below
+	 we assume that they also have a reasonable value for
+	 output_section.  Any special sections must be set up to meet
+	 these requirements.  */
+      osym.st_value += isec->output_offset;
+      /*if (! finfo->info->relocateable)
+        osym.st_value += isec->output_section->vma;*/
+
+      if (! elf_link_output_sym (finfo, name, &osym, isec))
+	return false;
+    }
+
+  /* Relocate the contents of each section.  */
+  for (o = input_bfd->sections; o != NULL; o = o->next)
+    {
+      bfd_byte *contents;
+
+      if (! o->linker_mark)
+	{
+	  /* This section was omitted from the link.  */
+	  continue;
+	}
+
+      if ((o->flags & SEC_HAS_CONTENTS) == 0
+	  || (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0))
+	continue;
+
+      if ((o->flags & SEC_LINKER_CREATED) != 0)
+	{
+	  /* Section was created by elf_link_create_dynamic_sections
+	     or somesuch.  */
+	  continue;
+	}
+
+      /* Get the contents of the section.  They have been cached by a
+         relaxation routine.  Note that o is a section in an input
+         file, so the contents field will not have been set by any of
+         the routines which work on output files.  */
+      if (elf_section_data (o)->this_hdr.contents != NULL)
+	contents = elf_section_data (o)->this_hdr.contents;
+      else
+	{
+	  contents = finfo->contents;
+	  if (! bfd_get_section_contents (input_bfd, o, contents,
+					  (file_ptr) 0, o->_raw_size))
+	    return false;
+	}
+
+      if ((o->flags & SEC_RELOC) != 0)
+	{
+	  Elf_Internal_Rela *internal_relocs;
+
+	  /* Get the swapped relocs.  */
+	  internal_relocs = (NAME(_bfd_elf,link_read_relocs)
+			     (input_bfd, o, finfo->external_relocs,
+			      finfo->internal_relocs, false));
+	  if (internal_relocs == NULL
+	      && o->reloc_count > 0)
+	    return false;
+
+	  /* Relocate the section by invoking a back end routine.
+
+	     The back end routine is responsible for adjusting the
+	     section contents as necessary, and (if using Rela relocs
+	     and generating a relocateable output file) adjusting the
+	     reloc addend as necessary.
+
+	     The back end routine does not have to worry about setting
+	     the reloc address or the reloc symbol index.
+
+	     The back end routine is given a pointer to the swapped in
+	     internal symbols, and can access the hash table entries
+	     for the external symbols via elf_sym_hashes (input_bfd).
+
+	     When generating relocateable output, the back end routine
+	     must handle STB_LOCAL/STT_SECTION symbols specially.  The
+	     output symbol is going to be a section symbol
+	     corresponding to the output section, which will require
+	     the addend to be adjusted.  */
+
+	  if (! (*relocate_section) (output_bfd, finfo->info,
+				     input_bfd, o, contents,
+				     internal_relocs,
+				     finfo->internal_syms,
+				     finfo->sections))
+	    return false;
+
+	  if (finfo->info->relocateable)
+	    {
+	      Elf_Internal_Rela *irela;
+	      Elf_Internal_Rela *irelaend;
+	      struct elf_link_hash_entry **rel_hash;
+	      Elf_Internal_Shdr *input_rel_hdr;
+	      Elf_Internal_Shdr *output_rel_hdr;
+
+	      /* Adjust the reloc addresses and symbol indices.  */
+
+	      irela = internal_relocs;
+	      irelaend = irela + o->reloc_count;
+	      rel_hash = (elf_section_data (o->output_section)->rel_hashes
+			  + o->output_section->reloc_count);
+	      for (; irela < irelaend; irela++, rel_hash++)
+		{
+		  unsigned long r_symndx;
+		  Elf_Internal_Sym *isym;
+		  asection *sec;
+
+		  irela->r_offset += o->output_offset;
+
+		  r_symndx = ELF_R_SYM (irela->r_info);
+
+		  if (r_symndx == 0)
+		    continue;
+
+		  if (r_symndx >= locsymcount
+		      || (elf_bad_symtab (input_bfd)
+			  && finfo->sections[r_symndx] == NULL))
+		    {
+		      struct elf_link_hash_entry *rh;
+		      long indx;
+
+		      /* This is a reloc against a global symbol.  We
+			 have not yet output all the local symbols, so
+			 we do not know the symbol index of any global
+			 symbol.  We set the rel_hash entry for this
+			 reloc to point to the global hash table entry
+			 for this symbol.  The symbol index is then
+			 set at the end of elf_bfd_final_link.  */
+		      indx = r_symndx - extsymoff;
+		      rh = elf_sym_hashes (input_bfd)[indx];
+		      while (rh->root.type == bfd_link_hash_indirect
+			     || rh->root.type == bfd_link_hash_warning)
+			rh = (struct elf_link_hash_entry *) rh->root.u.i.link;
+
+		      /* Setting the index to -2 tells
+			 elf_link_output_extsym that this symbol is
+			 used by a reloc.  */
+		      BFD_ASSERT (rh->indx < 0);
+		      rh->indx = -2;
+
+		      *rel_hash = rh;
+
+		      continue;
+		    }
+
+		  /* This is a reloc against a local symbol. */
+
+		  *rel_hash = NULL;
+		  isym = finfo->internal_syms + r_symndx;
+		  sec = finfo->sections[r_symndx];
+		  if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
+		    {
+		      /* I suppose the backend ought to fill in the
+			 section of any STT_SECTION symbol against a
+			 processor specific section.  If we have
+			 discarded a section, the output_section will
+			 be the absolute section.  */
+		      if (sec != NULL
+			  && (bfd_is_abs_section (sec)
+			      || (sec->output_section != NULL
+				  && bfd_is_abs_section (sec->output_section))))
+			r_symndx = 0;
+		      else if (sec == NULL || sec->owner == NULL)
+			{
+			  bfd_set_error (bfd_error_bad_value);
+			  return false;
+			}
+		      else
+			{
+			  r_symndx = sec->output_section->target_index;
+			  BFD_ASSERT (r_symndx != 0);
+			}
+		    }
+		  else
+		    {
+		      if (finfo->indices[r_symndx] == -1)
+			{
+			  unsigned long link;
+			  const char *name;
+			  asection *osec;
+
+			  if (finfo->info->strip == strip_all)
+			    {
+			      /* You can't do ld -r -s.  */
+			      bfd_set_error (bfd_error_invalid_operation);
+			      return false;
+			    }
+
+			  /* This symbol was skipped earlier, but
+			     since it is needed by a reloc, we
+			     must output it now.  */
+			  link = symtab_hdr->sh_link;
+			  name = bfd_elf_string_from_elf_section (input_bfd,
+								  link,
+								  isym->st_name);
+			  if (name == NULL)
+			    return false;
+
+			  osec = sec->output_section;
+			  isym->st_shndx =
+			    _bfd_elf_section_from_bfd_section (output_bfd,
+							       osec);
+			  if (isym->st_shndx == (unsigned short) -1)
+			    return false;
+
+			  isym->st_value += sec->output_offset;
+			  /*if (! finfo->info->relocateable)
+			    isym->st_value += osec->vma;*/
+
+			  finfo->indices[r_symndx] = output_bfd->symcount;
+
+			  if (! elf_link_output_sym (finfo, name, isym, sec))
+			    return false;
+			}
+
+		      r_symndx = finfo->indices[r_symndx];
+		    }
+
+		  irela->r_info = ELF_R_INFO (r_symndx,
+					      ELF_R_TYPE (irela->r_info));
+		}
+
+	      /* Swap out the relocs.  */
+	      input_rel_hdr = &elf_section_data (o)->rel_hdr;
+	      output_rel_hdr = &elf_section_data (o->output_section)->rel_hdr;
+	      BFD_ASSERT (output_rel_hdr->sh_entsize
+			  == input_rel_hdr->sh_entsize);
+	      irela = internal_relocs;
+	      irelaend = irela + o->reloc_count;
+	      if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
+		{
+		  Elf_External_Rel *erel;
+
+		  erel = ((Elf_External_Rel *) output_rel_hdr->contents
+			  + o->output_section->reloc_count);
+		  for (; irela < irelaend; irela++, erel++)
+		    {
+		      Elf_Internal_Rel irel;
+
+		      irel.r_offset = irela->r_offset;
+		      irel.r_info = irela->r_info;
+		      BFD_ASSERT (irela->r_addend == 0);
+		      elf_swap_reloc_out (output_bfd, &irel, erel);
+		    }
+		}
+	      else
+		{
+		  Elf_External_Rela *erela;
+
+		  BFD_ASSERT (input_rel_hdr->sh_entsize
+			      == sizeof (Elf_External_Rela));
+		  erela = ((Elf_External_Rela *) output_rel_hdr->contents
+			   + o->output_section->reloc_count);
+		  for (; irela < irelaend; irela++, erela++)
+		    elf_swap_reloca_out (output_bfd, irela, erela);
+		}
+
+	      o->output_section->reloc_count += o->reloc_count;
+	    }
+	}
+
+      /* Write out the modified section contents.  */
+      if (elf_section_data (o)->stab_info == NULL)
+	{
+	  if (! bfd_set_section_contents (output_bfd, o->output_section,
+					  contents, o->output_offset,
+					  (o->_cooked_size != 0
+					   ? o->_cooked_size
+					   : o->_raw_size)))
+	    return false;
+	}
+      else
+	{
+	  if (! (_bfd_write_section_stabs
+		 (output_bfd, &elf_hash_table (finfo->info)->stab_info,
+		  o, &elf_section_data (o)->stab_info, contents)))
+	    return false;
+	}
+    }
+
+  return true;
+}
+
+/* Generate a reloc when linking an ELF file.  This is a reloc
+   requested by the linker, and does come from any input file.  This
+   is used to build constructor and destructor tables when linking
+   with -Ur.  */
+
+static boolean
+elf_reloc_link_order (output_bfd, info, output_section, link_order)
+     bfd *output_bfd;
+     struct bfd_link_info *info;
+     asection *output_section;
+     struct bfd_link_order *link_order;
+{
+  reloc_howto_type *howto;
+  long indx;
+  bfd_vma offset;
+  bfd_vma addend;
+  struct elf_link_hash_entry **rel_hash_ptr;
+  Elf_Internal_Shdr *rel_hdr;
+
+  howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc);
+  if (howto == NULL)
+    {
+      bfd_set_error (bfd_error_bad_value);
+      return false;
+    }
+
+  addend = link_order->u.reloc.p->addend;
+
+  /* Figure out the symbol index.  */
+  rel_hash_ptr = (elf_section_data (output_section)->rel_hashes
+		  + output_section->reloc_count);
+  if (link_order->type == bfd_section_reloc_link_order)
+    {
+      indx = link_order->u.reloc.p->u.section->target_index;
+      BFD_ASSERT (indx != 0);
+      *rel_hash_ptr = NULL;
+    }
+  else
+    {
+      struct elf_link_hash_entry *h;
+
+      /* Treat a reloc against a defined symbol as though it were
+         actually against the section.  */
+      h = ((struct elf_link_hash_entry *)
+	   bfd_wrapped_link_hash_lookup (output_bfd, info,
+					 link_order->u.reloc.p->u.name,
+					 false, false, true));
+      if (h != NULL
+	  && (h->root.type == bfd_link_hash_defined
+	      || h->root.type == bfd_link_hash_defweak))
+	{
+	  asection *section;
+
+	  section = h->root.u.def.section;
+	  indx = section->output_section->target_index;
+	  *rel_hash_ptr = NULL;
+	  /* It seems that we ought to add the symbol value to the
+             addend here, but in practice it has already been added
+             because it was passed to constructor_callback.  */
+	  addend += section->output_section->vma + section->output_offset;
+	}
+      else if (h != NULL)
+	{
+	  /* Setting the index to -2 tells elf_link_output_extsym that
+	     this symbol is used by a reloc.  */
+	  h->indx = -2;
+	  *rel_hash_ptr = h;
+	  indx = 0;
+	}
+      else
+	{
+	  if (! ((*info->callbacks->unattached_reloc)
+		 (info, link_order->u.reloc.p->u.name, (bfd *) NULL,
+		  (asection *) NULL, (bfd_vma) 0)))
+	    return false;
+	  indx = 0;
+	}
+    }
+
+  /* If this is an inplace reloc, we must write the addend into the
+     object file.  */
+  if (howto->partial_inplace && addend != 0)
+    {
+      bfd_size_type size;
+      bfd_reloc_status_type rstat;
+      bfd_byte *buf;
+      boolean ok;
+
+      size = bfd_get_reloc_size (howto);
+      buf = (bfd_byte *) bfd_zmalloc (size);
+      if (buf == (bfd_byte *) NULL)
+	return false;
+      rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf);
+      switch (rstat)
+	{
+	case bfd_reloc_ok:
+	  break;
+	default:
+	case bfd_reloc_outofrange:
+	  abort ();
+	case bfd_reloc_overflow:
+	  if (! ((*info->callbacks->reloc_overflow)
+		 (info,
+		  (link_order->type == bfd_section_reloc_link_order
+		   ? bfd_section_name (output_bfd,
+				       link_order->u.reloc.p->u.section)
+		   : link_order->u.reloc.p->u.name),
+		  howto->name, addend, (bfd *) NULL, (asection *) NULL,
+		  (bfd_vma) 0)))
+	    {
+	      free (buf);
+	      return false;
+	    }
+	  break;
+	}
+      ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf,
+				     (file_ptr) link_order->offset, size);
+      free (buf);
+      if (! ok)
+	return false;
+    }
+
+  /* The address of a reloc is relative to the section in a
+     relocateable file, and is a virtual address in an executable
+     file.  */
+  offset = link_order->offset;
+  if (! info->relocateable)
+    offset += output_section->vma;
+
+  rel_hdr = &elf_section_data (output_section)->rel_hdr;
+
+  if (rel_hdr->sh_type == SHT_REL)
+    {
+      Elf_Internal_Rel irel;
+      Elf_External_Rel *erel;
+
+      irel.r_offset = offset;
+      irel.r_info = ELF_R_INFO (indx, howto->type);
+      erel = ((Elf_External_Rel *) rel_hdr->contents
+	      + output_section->reloc_count);
+      elf_swap_reloc_out (output_bfd, &irel, erel);
+    }
+  else
+    {
+      Elf_Internal_Rela irela;
+      Elf_External_Rela *erela;
+
+      irela.r_offset = offset;
+      irela.r_info = ELF_R_INFO (indx, howto->type);
+      irela.r_addend = addend;
+      erela = ((Elf_External_Rela *) rel_hdr->contents
+	       + output_section->reloc_count);
+      elf_swap_reloca_out (output_bfd, &irela, erela);
+    }
+
+  ++output_section->reloc_count;
+
+  return true;
+}
+
+
+
+#define TARGET_BIG_SYM		bfd_elf32_morphos_vec
+#define TARGET_BIG_NAME		"elf32-morphos"
+#define ELF_ARCH		bfd_arch_powerpc
+#define ELF_MACHINE_CODE	EM_PPC
+#if 0	/* HACK - fnf */
+#define ELF_MAXPAGESIZE		0x10000
+#else
+#define ELF_MAXPAGESIZE		0x1000
+#endif
+#define elf_info_to_howto	ppc_elf_info_to_howto
+
+#ifdef  EM_CYGNUS_POWERPC
+#define ELF_MACHINE_ALT1	EM_CYGNUS_POWERPC
+#endif
+
+#ifdef EM_PPC_OLD
+#define ELF_MACHINE_ALT2	EM_PPC_OLD
+#endif
+
+#define elf_backend_plt_not_loaded 1
+#define elf_backend_got_symbol_offset 4
+
+#define bfd_elf32_bfd_copy_private_bfd_data	ppc_elf_copy_private_bfd_data
+#define bfd_elf32_bfd_merge_private_bfd_data	ppc_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_set_private_flags		ppc_elf_set_private_flags
+#define bfd_elf32_bfd_reloc_type_lookup		ppc_elf_reloc_type_lookup
+#define bfd_elf32_bfd_final_link		ppc_elf_final_link
+#define elf_backend_section_from_shdr		ppc_elf_section_from_shdr
+#define elf_backend_relocate_section		ppc_elf_relocate_section
+#define elf_backend_create_dynamic_sections	ppc_elf_create_dynamic_sections
+#define elf_backend_check_relocs		ppc_elf_check_relocs
+#define elf_backend_adjust_dynamic_symbol	ppc_elf_adjust_dynamic_symbol
+/*#define elf_backend_add_symbol_hook		ppc_elf_add_symbol_hook*/
+#define elf_backend_size_dynamic_sections	ppc_elf_size_dynamic_sections
+#define elf_backend_finish_dynamic_symbol	ppc_elf_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_sections	ppc_elf_finish_dynamic_sections
+#define elf_backend_fake_sections		ppc_elf_fake_sections
+#define elf_backend_additional_program_headers	ppc_elf_additional_program_headers
+#define elf_backend_modify_segment_map		ppc_elf_modify_segment_map
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index fdbf196..dcc8c34 100644
--- binutils-2.9.1.orig/bfd/elf32-ppc.c
+++ binutils-2.9.1/bfd/elf32-ppc.c
@@ -3358,7 +3358,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 #define TARGET_BIG_NAME		"elf32-powerpc"
 #define ELF_ARCH		bfd_arch_powerpc
 #define ELF_MACHINE_CODE	EM_PPC
+#if 0	/* HACK - fnf */
 #define ELF_MAXPAGESIZE		0x10000
+#else
+#define ELF_MAXPAGESIZE		0x1000
+#endif
 #define elf_info_to_howto	ppc_elf_info_to_howto
 
 #ifdef  EM_CYGNUS_POWERPC
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 4591e5f..e3c78dd 100644
--- binutils-2.9.1.orig/bfd/elfcode.h
+++ binutils-2.9.1/bfd/elfcode.h
@@ -1272,10 +1272,10 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
 	  s = *ps;
 
 	  /* Canonicalize ELF section symbols.  FIXME: Why?  */
-	  if ((s->flags & BSF_SECTION_SYM) == 0)
+	  /*if ((s->flags & BSF_SECTION_SYM) == 0)*/
 	    relent->sym_ptr_ptr = ps;
-	  else
-	    relent->sym_ptr_ptr = s->section->symbol_ptr_ptr;
+	    /*else
+	      relent->sym_ptr_ptr = s->section->symbol_ptr_ptr;*/
 	}
 
       relent->addend = rela.r_addend;
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 21bd270..d03b430 100644
--- binutils-2.9.1.orig/bfd/elflink.h
+++ binutils-2.9.1/bfd/elflink.h
@@ -4207,7 +4207,7 @@ elf_link_output_extsym (h, data)
      referenced by regular files, because we will already have issued
      warnings for them.  */
   if (! finfo->info->relocateable
-      && ! finfo->info->shared
+	&& ! finfo->info->shared
       && h->root.type == bfd_link_hash_undefined
       && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
       && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
diff --git a/bfd/hash.c b/bfd/hash.c
index 4c6e987..0973040 100644
--- binutils-2.9.1.orig/bfd/hash.c
+++ binutils-2.9.1/bfd/hash.c
@@ -73,7 +73,7 @@ SUBSECTION
 	The function <<bfd_hash_table_init>> take as an argument a
 	function to use to create new entries.  For a basic hash
 	table, use the function <<bfd_hash_newfunc>>.  @xref{Deriving
-	a New Hash Table Type} for why you would want to use a
+	a New Hash Table Type}, for why you would want to use a
 	different value for this argument.
 
 @findex bfd_hash_allocate
diff --git a/bfd/hosts/amigaos.h b/bfd/hosts/amigaos.h
new file mode 100644
index 0000000..dc62d7f
--- /dev/null
+++ binutils-2.9.1/bfd/hosts/amigaos.h
@@ -0,0 +1,5 @@
+/* Host configuration for AmigaOS */
+#ifndef hosts_amigaos_h
+#define hosts_amigaos_h
+#include "hosts/std-host.h"
+#endif /* hosts_amigaos_h */
diff --git a/bfd/hosts/morphos.h b/bfd/hosts/morphos.h
new file mode 100644
index 0000000..d3c60ea
--- /dev/null
+++ binutils-2.9.1/bfd/hosts/morphos.h
@@ -0,0 +1,5 @@
+/* Host configuration for MorphOS */
+#ifndef hosts_morphos_h
+#define hosts_morphos_h
+#include "hosts/std-host.h"
+#endif /* hosts_morphos_h */
diff --git a/bfd/libamiga.h b/bfd/libamiga.h
new file mode 100644
index 0000000..fef587a
--- /dev/null
+++ binutils-2.9.1/bfd/libamiga.h
@@ -0,0 +1,224 @@
+/* BFD back-end data structures for AmigaOS.
+   Copyright (C) 1992-1994 Free Software Foundation, Inc.
+   Contributed by Leonard Norrgard.
+   Extended by Stephan Thesing Nov 94
+
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#ifdef __STDC__
+#define CAT3(a,b,c) a##b##c
+#else
+#define CAT3(a,b,c) a/**/b/**/c
+#endif
+
+#define GET_WORD bfd_h_get_32
+#define GET_SWORD (int32_type)GET_WORD
+#define PUT_WORD bfd_h_put_32
+#define NAME(x,y) CAT3(x,_32_,y)
+#define JNAME(x) CAT(x,_32)
+#define BYTES_IN_WORD 4
+
+/* Hunk ID numbers.*/  
+#define HUNK_UNIT		999
+#define HUNK_NAME		1000
+#define HUNK_CODE		1001
+#define HUNK_DATA		1002
+#define HUNK_BSS		1003
+#define HUNK_RELOC32		1004
+#define HUNK_ABSRELOC32		HUNK_RELOC32
+#define HUNK_RELOC16		1005
+#define HUNK_RELRELOC16		HUNK_RELOC16
+#define HUNK_RELOC8		1006
+#define HUNK_RELRELOC8		HUNK_RELOC8
+#define HUNK_EXT		1007
+#define HUNK_SYMBOL		1008
+#define HUNK_DEBUG		1009
+#define HUNK_END		1010
+#define HUNK_HEADER		1011
+#define HUNK_HEADER_POS		(0x00001000 | 1011)
+#define HUNK_OVERLAY		1013
+#define HUNK_BREAK		1014
+#define HUNK_DREL32		1015
+#define HUNK_DREL16		1016
+#define HUNK_DREL8		1017
+#define HUNK_LIB		1018
+#define HUNK_INDEX		1019
+#define HUNK_RELOC32SHORT	1020
+#define HUNK_RELRELOC32		1021
+#define HUNK_ABSRELOC16		1022
+
+/* The hunk ID part.  */
+
+#define HUNK_VALUE(hunk_id)	((hunk_id) & 0x3fffffff)
+
+/* Attributes of a hunk.  */
+
+#define HUNK_ATTRIBUTE(hunk_id)	((hunk_id) >> 30)
+#define HUNK_ATTR_CHIP 		0x01	/* Hunk contents must go into chip ram.  */
+#define HUNK_ATTR_FAST		0x02	/* fast */
+#define HUNK_ATTR_FOLLOWS	0x03	/* Mem id follows */
+
+#define EXT_SYMB		0
+#define EXT_DEF			1
+#define EXT_ABS			2
+#define EXT_RES			3
+#define EXT_REF32		129
+#define EXT_ABSREF32		EXT_REF32
+#define EXT_COMMON		130
+#define EXT_ABSCOMMON		EXT_COMMON
+#define EXT_REF16		131
+#define EXT_RELREF16		EXT_REF16
+#define EXT_REF8		132
+#define EXT_RELREF8		EXT_REF8
+#define EXT_DEXT32		133
+#define EXT_DREF32		EXT_DEXT32
+#define EXT_DEXT16		134
+#define EXT_DREF16		EXT_DEXT16
+#define EXT_DEXT8		135
+#define EXT_DREF8		EXT_DEXT8
+#define EXT_RELREF32		136
+#define EXT_RELCOMMON		137
+#define EXT_ABSREF16		138
+#define EXT_ABSREF8		139
+
+
+typedef struct amiga_reloc {
+  arelent relent;
+  struct amiga_reloc *next;
+  struct amiga_symbol *symbol;
+  long target_hunk;
+} amiga_reloc_type;
+
+typedef struct amiga_symbol {
+  asymbol symbol;
+/*  struct amiga_symbol *next;*/
+  unsigned short hunk_number;
+  long index;
+  /* these come from a.out. Not used yet, but needed to compile */
+  short desc;
+  char other;
+  unsigned char type;
+} amiga_symbol_type;
+
+struct amiga_raw_symbol {
+  struct amiga_raw_symbol *next;
+  unsigned long data[1];
+};
+
+typedef struct amiga_per_section
+{
+  amiga_reloc_type *reloc_tail; /* last reloc */ /* first is in section->relocation */
+  int attribute; /* Memory type required by this section */
+  unsigned long disk_size;	/* Section size on disk. _raw_size may be larger than this */
+  int max_raw_relocs; /* Size of array */
+  unsigned long int num_raw_relocs8, num_raw_relocs16, num_raw_relocs32;
+  unsigned long  raw_relocs8, raw_relocs16, raw_relocs32;
+  struct amiga_raw_symbol *first;
+  struct amiga_raw_symbol *last; /* tail */
+
+  /* the symbols for this section */
+  amiga_symbol_type *amiga_symbols;
+
+  unsigned long hunk_ext_pos;	/* offset of hunk_ext in the bfd file */
+  unsigned long hunk_symbol_pos; /* offset of hunk_symbol in the bfd file */
+} amiga_per_section_type;
+#define amiga_per_section(x) ((amiga_per_section_type *)((x)->used_by_bfd))
+
+/* The `tdata' struct for all a.out-like object file formats.
+   Various things depend on this struct being around any time an a.out
+   file is being handled.  An example is dbxread.c in GDB.  */
+
+struct amiga_data {
+  struct internal_exec *hdr;		/* exec file header */
+  amiga_symbol_type *symbols;		/* symtab for input bfd */
+
+  /* Filler, so we can pretend to be an a.out to GDB.  */
+  asection *textsec;
+  asection *datasec;
+  asection *bsssec;
+  int nb_hunks;			/* number of hunks in the file */
+  /* The positions of the string table and symbol table.  */
+  file_ptr sym_filepos;
+  file_ptr str_filepos;
+
+  unsigned int n_symbols;               /* number of symbols */
+
+  /* Size of a relocation entry in external form */
+  unsigned dummy_reloc_entry_size;
+
+  /* Size of a symbol table entry in external form */
+  unsigned symbol_entry_size;
+
+  unsigned exec_bytes_size;
+  unsigned vma_adjusted : 1;
+};
+
+typedef struct  amiga_data_struct {
+  struct amiga_data a;
+
+  unsigned long symtab_size;
+  unsigned long stringtab_size;
+
+  unsigned long *first_byte;
+  unsigned long *file_end;
+  unsigned long *file_pointer;
+  amiga_symbol_type *symbols;
+  amiga_symbol_type *symbol_tail;
+  boolean IsLoadFile; /* If true, this is a load file (for output bfd only) */
+  int maxsymbols;     /* Used by final_link routine to add symbols to output bfd.
+                         This is the # of entries, allocated in abdfd->osymbols */
+  int nb_hunks;
+  /* The next two fields are set at final_link time
+     for the output bfd only */
+  boolean baserel;    /* true if there is ___init_a4 in the global hash table */
+  bfd_vma a4init;     /* cache the value for efficiency */
+} amiga_data_type;
+
+struct arch_syms {
+  unsigned long offset;		/* disk offset in the archive */
+  unsigned long size;		/* size of the block of symbols */
+  unsigned long unit_offset;	/* start of unit on disk */
+  struct arch_syms *next;	/* linked list */
+};
+
+#define	adata(bfd)		((bfd)->tdata.amiga_data->a)
+
+/* We take the address of the first element of an asymbol to ensure that the
+   macro is only ever applied to an asymbol */
+#define amiga_symbol(asymbol) ((amiga_symbol_type *)(&(asymbol)->the_bfd))
+
+#define AMIGA_DATA(abfd) ((abfd)->tdata.amiga_data)
+
+#define HUNKB_ADVISORY		29
+#define HUNKB_CHIP		30
+#define HUNKB_FAST		31
+#define HUNKF_ADVISORY		(1L << HUNKB_ADVISORY)
+#define HUNKF_CHIP		(1L << HUNKB_CHIP)
+#define HUNKF_FAST		(1L << HUNKB_FAST)
+
+#define MEMF_ANY		(0L)
+#define MEMF_PUBLIC		(1L << 0)
+#define MEMF_CHIP		(1L << 1)
+#define MEMF_FAST		(1L << 2)
+#define MEMF_LOCAL		(1L << 8)
+#define MEMF_24BITDMA		(1L << 9)
+#define	MEMF_KICK		(1L << 10)
+#define MEMF_CLEAR		(1L << 16)
+#define MEMF_LARGEST		(1L << 17)
+#define MEMF_REVERSE		(1L << 18)
+#define MEMF_TOTAL		(1L << 19)
+#define	MEMF_NO_EXPUNGE		(1L << 31)
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 296bf41..861a413 100644
--- binutils-2.9.1.orig/bfd/libbfd.h
+++ binutils-2.9.1/bfd/libbfd.h
@@ -720,6 +720,10 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_PPC_EMB_RELST_HA",
   "BFD_RELOC_PPC_EMB_BIT_FLD",
   "BFD_RELOC_PPC_EMB_RELSDA",
+  "BFD_RELOC_PPC_MORPHOS_DREL",
+  "BFD_RELOC_PPC_MORPHOS_DREL_LO",
+  "BFD_RELOC_PPC_MORPHOS_DREL_HI",
+  "BFD_RELOC_PPC_MORPHOS_DREL_HA",
   "BFD_RELOC_CTOR",
   "BFD_RELOC_ARM_PCREL_BRANCH",
   "BFD_RELOC_ARM_IMMEDIATE",
diff --git a/bfd/linker.c b/bfd/linker.c
index 1c3c9a2..5bf9107 100644
--- binutils-2.9.1.orig/bfd/linker.c
+++ binutils-2.9.1/bfd/linker.c
@@ -74,7 +74,7 @@ SUBSECTION
 @cindex target vector (_bfd_link_hash_table_create)
 	The linker routines must create a hash table, which must be
 	derived from <<struct bfd_link_hash_table>> described in
-	<<bfdlink.c>>.  @xref{Hash Tables} for information on how to
+	<<bfdlink.c>>.  @xref{Hash Tables}, for information on how to
 	create a derived hash table.  This entry point is called using
 	the target vector of the linker output file.
 
@@ -428,7 +428,8 @@ static boolean generic_add_output_symbol
 static boolean default_fill_link_order
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
 	   struct bfd_link_order *));
-static boolean default_indirect_link_order
+/*Amiga hack - used in amigaoslink.c so must be global */
+/*static*/ boolean default_indirect_link_order
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
 	   struct bfd_link_order *, boolean));
 
@@ -1196,8 +1197,17 @@ generic_link_check_archive_element (abfd, info, pneeded, collect)
 	  h->u.c.size = size;
 
 	  power = bfd_log2 (size);
-	  if (power > 4)
-	    power = 4;
+	  /* For the amiga, we don't want an alignment bigger than
+	     2**2. Doing this here is a horribly kludgy, but IMHO the
+	     max power alignment really should be target-dependant so
+	     that we wouldn't have to do this -- daniel */
+	  if (bfd_get_flavour(abfd) == bfd_target_amiga_flavour) {
+	    if (power > 2)
+	      power = 2;
+	  }
+	  else
+	    if (power > 4)
+	      power = 4;
 	  h->u.c.p->alignment_power = power;
 
 	  if (p->section == bfd_com_section_ptr)
@@ -1658,8 +1668,18 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
 	    unsigned int power;
 
 	    power = bfd_log2 (value);
-	    if (power > 4)
-	      power = 4;
+	    /* For the amiga, we don't want an alignment bigger than
+               2**2. Doing this here is a horribly kludgy, but IMHO
+               the max power alignment really should be
+               target-dependant so that we wouldn't have to do this --
+               daniel */
+	    if (bfd_get_flavour(abfd) == bfd_target_amiga_flavour) {
+	      if (power > 2)
+		power = 2;
+	    }
+	    else
+	      if (power > 4)
+		power = 4;
 	    h->u.c.p->alignment_power = power;
 	  }
 
@@ -2626,7 +2646,7 @@ default_fill_link_order (abfd, info, sec, link_order)
 
 /* Default routine to handle a bfd_indirect_link_order.  */
 
-static boolean
+/*static*/ boolean
 default_indirect_link_order (output_bfd, info, output_section, link_order,
 			     generic_linker)
      bfd *output_bfd;
diff --git a/bfd/opncls.c b/bfd/opncls.c
index c58173c..9c1e549 100644
--- binutils-2.9.1.orig/bfd/opncls.c
+++ binutils-2.9.1/bfd/opncls.c
@@ -422,7 +422,12 @@ bfd_close (abfd)
      make it so */
   if (ret
       && abfd->direction == write_direction
-      && abfd->flags & EXEC_P)
+//#ifndef __MORPHOS__
+#if 0
+	/* We want exec attribute in MorphOS, but without EXEC_P (ldmain.c) */
+      && abfd->flags & EXEC_P
+#endif /* __MORPHOS__ */
+     )
     {
       struct stat buf;
 
diff --git a/bfd/pei-i386.c b/bfd/pei-i386.c
index 8b52968..344f045 100644
--- binutils-2.9.1.orig/bfd/pei-i386.c
+++ binutils-2.9.1/bfd/pei-i386.c
@@ -30,6 +30,56 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define COFF_LONG_SECTION_NAMES
 
 #include "coff-i386.c"
+#include <ctype.h>
 
+/* Routine to get the comdat symbol or associated section
+     for a section, used by the linker to determine if sections are
+     duplicates. needs the asection passed to it */
 
+void pei_get_comdat_info PARAMS ((asection *));
 
+void pei_get_comdat_info(sec)
+asection *sec;
+{
+const char *nosym = "none";
+bfd_size_type symesz;
+bfd_byte *esym;
+bfd_byte *esym_end;
+
+comdat_info *comdat;
+
+comdat = (comdat_info *) bfd_alloc (sec->owner, sizeof(comdat_info));
+
+memcpy (comdat->name_buf, nosym, 5);
+comdat->asoc_sec = (int)NULL;
+symesz = bfd_coff_symesz (sec->owner);
+esym = (bfd_byte *) obj_coff_external_syms (sec->owner);
+esym_end = esym + obj_raw_syment_count (sec->owner) * symesz;
+
+
+/* walk the native table looking for the section symbol */
+  while (esym < esym_end)
+    {
+      struct internal_syment sym;
+      bfd_coff_swap_sym_in (sec->owner, (PTR) esym, (PTR) &sym);
+	/* FIXME add ISSYM() ISWEAK()? to function symbols ISFCN( sym.n_type )) would make things MUCH easier*/
+	/* every comdat has either another comdat that it is addociated with
+	   or a comdat symbol of it's own. if a symbol it isn't associated */
+      if ((sym.n_scnum == sec->index + 1) && !isalpha(sym.n_name[0]) && !sym.n_numaux )
+         {
+	  comdat->comdat_sym = _bfd_coff_internal_syment_name(sec->owner, &sym, comdat->name_buf);
+		break;
+	 }
+      if (!isalpha(sym.n_name[0]) && (sym.n_scnum == sec->index + 1) && sym.n_numaux)
+         {
+          union internal_auxent aux;
+          bfd_coff_swap_aux_in(sec->owner, (PTR) (esym + symesz)
+		,sym.n_type, sym.n_sclass, 0, sym.n_numaux, (PTR) &aux);
+          comdat->asoc_sec = aux.x_scn.x_associated;
+	  if (comdat->asoc_sec)
+            break;
+         }
+      esym += (sym.n_numaux + 1) * symesz;
+    }
+sec->pe_comdat_info = comdat;
+}
diff --git a/bfd/peicode.h b/bfd/peicode.h
index f78b384..3b766ca 100644
--- binutils-2.9.1.orig/bfd/peicode.h
+++ binutils-2.9.1/bfd/peicode.h
@@ -494,11 +494,17 @@ coff_swap_sym_in (abfd, ext1, in1)
      documentation indicates is a section symbol.  The problem is that the
      value field in the symbol is simply a copy of the .idata section's flags
      rather than something useful.  When these symbols are encountered, change
-     the value to 0 and the section number to 1 so that they will be handled
-     somewhat correctly in the bfd code. */
-  if (in->n_sclass == 0x68) {
+     the value to 0 so that they will be handled somewhat correctly in the 
+     bfd code. */
+  if (in->n_sclass == C_SECTION) {
     in->n_value = 0x0;
-    in->n_scnum = 1;
+    if(strcmp (in->_n._n_name, ".idata$2") == 0)
+      in->n_sclass = 1; /* not used for anything that I know of. */
+/* can't hash more than 1 sub-section symbol with the same name. */
+    if(strcmp (in->_n._n_name, ".idata$4") == 0)
+      sprintf(in->_n._n_name, "i4%x",((int)abfd & ~0xff000000));
+    if(strcmp (in->_n._n_name, ".idata$5") == 0)
+      sprintf(in->_n._n_name, "i5%x",((int)abfd & ~0xff000000));
     /* I have tried setting the class to 3 and using the following to set
        the section number.  This will put the address of the pointer to the
        string kernel32.dll at addresses 0 and 0x10 off start of idata section
@@ -1394,14 +1400,14 @@ pe_print_idata(abfd, vfile)
 	  fprintf (file, "\tvma:  Hint/Ord Member-Name\n");
 
 	  idx = hint_addr + adj;
-
+#define IMPORTED_BY_ORDINAL 0x80000000 /* FIXME should be in a REAL header */
 	  for (j = 0; j < stop; j += 4)
 	    {
 	      unsigned long member = bfd_get_32 (abfd, data + idx + j);
 
 	      if (member == 0)
 		break;
-	      if (member & 0x80000000)
+	      if (member & IMPORTED_BY_ORDINAL)
 		fprintf (file, "\t%04lx\t %4lu", member,
 			 member & 0x7fffffff);
 	      else
@@ -1464,10 +1470,19 @@ pe_print_idata(abfd, vfile)
 		    }
 		  else 
 		    {
+		      if (!(iat_member & IMPORTED_BY_ORDINAL))
+                        {
 		      ordinal = bfd_get_16(abfd,
 					   data + iat_member + adj);
 		      member_name = (char *) data + iat_member + adj + 2;
-		      fprintf(file, "\t%04lx\t %4d  %s\n",
+                        }
+                      else
+			{              
+			  ordinal = (iat_member & 0x0000ffff);
+			  iat_member = first_thunk + j;
+              		  member_name = (char *)"Imported By Ordinal";
+			}
+		      fprintf(file, "\t%04lx\t %4x  %s\n",
 			      iat_member, ordinal, member_name);
 		    }
 		}
diff --git a/bfd/reloc.c b/bfd/reloc.c
index dda7624..f89385e 100644
--- binutils-2.9.1.orig/bfd/reloc.c
+++ binutils-2.9.1/bfd/reloc.c
@@ -2119,6 +2119,14 @@ ENUMX
   BFD_RELOC_PPC_EMB_BIT_FLD
 ENUMX
   BFD_RELOC_PPC_EMB_RELSDA
+ENUMX
+  BFD_RELOC_PPC_MORPHOS_DREL
+ENUMX
+  BFD_RELOC_PPC_MORPHOS_DREL_LO
+ENUMX
+  BFD_RELOC_PPC_MORPHOS_DREL_HI
+ENUMX
+  BFD_RELOC_PPC_MORPHOS_DREL_HA
 ENUMDOC
   Power(rs6000) and PowerPC relocations.
 
diff --git a/bfd/section.c b/bfd/section.c
index 787855c..f38c316 100644
--- binutils-2.9.1.orig/bfd/section.c
+++ binutils-2.9.1/bfd/section.c
@@ -150,6 +150,13 @@ SUBSECTION
 
 CODE_FRAGMENT
 .
+.typedef struct _comdat_info
+.{
+.  int asoc_sec;
+.  char name_buf[9];
+.  const char * comdat_sym;
+.} comdat_info;
+.
 .typedef struct sec
 .{
 .        {* The name of the section; the name isn't a copy, the pointer is
@@ -431,6 +438,8 @@ CODE_FRAGMENT
 .   struct symbol_cache_entry *symbol;
 .   struct symbol_cache_entry **symbol_ptr_ptr;
 .
+.   comdat_info *pe_comdat_info;
+.
 .   struct bfd_link_order *link_order_head;
 .   struct bfd_link_order *link_order_tail;
 .} asection ;
@@ -487,7 +496,7 @@ static const asymbol global_syms[] =
   const asection SEC = \
     { NAME, 0, 0, FLAGS, 0, 0, 0, 0, 0, 0, 0, 0, (asection *) &SEC, \
       0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, \
-      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0 }
+      (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0, 0 }
 
 STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol,
 	     BFD_COM_SECTION_NAME, 0);
diff --git a/bfd/syms.c b/bfd/syms.c
index d39e7d8..3972bbc 100644
--- binutils-2.9.1.orig/bfd/syms.c
+++ binutils-2.9.1/bfd/syms.c
@@ -1062,7 +1062,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
     {
       stab = info->cached_stab;
       indexentry = info->cached_indexentry;
-      file_name = info->cached_file_name;
+      file_name = (char *) info->cached_file_name;
     }
   else
 #endif
@@ -1097,10 +1097,10 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
 	return true;
 
       stab = indexentry->stab + STABSIZE;
-      file_name = indexentry->file_name;
+      file_name = (char *) indexentry->file_name;
     }
 
-  directory_name = indexentry->directory_name;
+  directory_name = (char *) indexentry->directory_name;
   str = indexentry->str;
 
   for (; stab < (indexentry+1)->stab; stab += STABSIZE)
@@ -1188,11 +1188,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
          to clobber the colon.  It's OK to change the name, since the
          string is in our own local storage anyhow.  */
 
-      s = strchr (indexentry->function_name, ':');
+      s = strchr ((const char *) indexentry->function_name, ':');
       if (s != NULL)
 	*s = '\0';
 
-      *pfnname = indexentry->function_name;
+      *pfnname = (const char *) indexentry->function_name;
     }
 
   return true;
diff --git a/bfd/targets.c b/bfd/targets.c
index a6c61bb..5fd9803 100644
--- binutils-2.9.1.orig/bfd/targets.c
+++ binutils-2.9.1/bfd/targets.c
@@ -138,6 +138,7 @@ DESCRIPTION
 
 .enum bfd_flavour {
 .  bfd_target_unknown_flavour,
+.  bfd_target_amiga_flavour,
 .  bfd_target_aout_flavour,
 .  bfd_target_coff_flavour,
 .  bfd_target_ecoff_flavour,
@@ -469,6 +470,8 @@ in this structure.
    we can't intermix extern's and initializers.  */
 extern const bfd_target a29kcoff_big_vec;
 extern const bfd_target a_out_adobe_vec;
+extern const bfd_target amiga_vec;
+extern const bfd_target aout_amiga_vec;
 extern const bfd_target aout_arm_big_vec;
 extern const bfd_target aout_arm_little_vec;
 extern const bfd_target aout_mips_big_vec;
@@ -501,6 +504,7 @@ extern const bfd_target bfd_elf32_m68k_vec;
 extern const bfd_target bfd_elf32_m88k_vec;
 extern const bfd_target bfd_elf32_mn10200_vec;
 extern const bfd_target bfd_elf32_mn10300_vec;
+extern const bfd_target bfd_elf32_morphos_vec;
 extern const bfd_target bfd_elf32_powerpc_vec;
 extern const bfd_target bfd_elf32_powerpcle_vec;
 extern const bfd_target bfd_elf32_sh_vec;
@@ -630,6 +634,8 @@ const bfd_target * const bfd_target_vector[] = {
 	   it wasn't omitted by mistake.  */
 	&a29kcoff_big_vec,
 	&a_out_adobe_vec,
+	&amiga_vec,
+	&aout_amiga_vec,
 #if 0				/* No one seems to use this.  */
 	&aout_mips_big_vec,
 #endif
@@ -663,6 +669,7 @@ const bfd_target * const bfd_target_vector[] = {
 	&bfd_elf32_m32r_vec,
 	&bfd_elf32_mn10200_vec,
 	&bfd_elf32_mn10300_vec,
+	&bfd_elf32_morphos_vec,
 	&bfd_elf32_m68k_vec,
 	&bfd_elf32_m88k_vec,
 	&bfd_elf32_sparc_vec,
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 3382f90..e99e5ea 100644
--- binutils-2.9.1.orig/bfd/xcofflink.c
+++ binutils-2.9.1/bfd/xcofflink.c
@@ -721,7 +721,7 @@ _bfd_xcoff_canonicalize_dynamic_symtab (abfd, psyms)
 	    if (ldsym._l._l_name[i] == '\0')
 	      break;
 	  if (i < SYMNMLEN)
-	    symbuf->symbol.name = (char *) elsym->_l._l_name;
+	    symbuf->symbol.name = (const char *) elsym->_l._l_name;
 	  else
 	    {
 	      char *c;
@@ -3824,7 +3824,7 @@ xcoff_build_ldsyms (h, p)
 
       bfd_put_16 (ldinfo->output_bfd, len + 1,
 		  ldinfo->strings + ldinfo->string_size);
-      strcpy (ldinfo->strings + ldinfo->string_size + 2, h->root.root.string);
+      strcpy ((char *) ldinfo->strings + ldinfo->string_size + 2, h->root.root.string);
       h->ldsym->_l._l_l._l_zeroes = 0;
       h->ldsym->_l._l_l._l_offset = ldinfo->string_size + 2;
       ldinfo->string_size += len + 3;
@@ -3953,7 +3953,7 @@ _bfd_xcoff_bfd_final_link (abfd, info)
       if (file_align != 0)
 	{
 	  boolean saw_contents;
-	  int indx;
+	  int indx = 0;
 	  asection **op;
 	  file_ptr sofar;
 
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 8c27a77..fc2edb5 100644
--- binutils-2.9.1.orig/binutils/ChangeLog
+++ binutils-2.9.1/binutils/ChangeLog
@@ -1,10 +1,38 @@
+Fri Jun 19 13:30:06 1998  Mumit Khan  <khan@dhaka.xraylith.wisc.edu>
+
+	* dlltool.c (gen_exp_file): Revert Mikey patch and add back
+	exporting of both _imp__ and __imp_ names per binutils 2.9.1.
+	(make_one_lib_file): Likewise.
+
+Thu Jun 18 09:50:39 1998  Mumit Khan  <khan@dhaka.xraylith.wisc.edu>
+
+	pei-i386 changes from Mikey <jeffdb@goodnet.com>.
+
+	* dlltool.c (ppc_jtab): Change __imp_xxx to _imp__xxx.
+	(gen_exp_file): Likewise.
+	(make_one_lib_file): Likewise.
+
+	* objdump.c (dump_section_header): Add associated section/comdat
+	symbol info to --section-header output.
+
+Fri Jun 12 16:41:56 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (BUILD_DLLTOOL, DLLTOOL_DEFS, BUILD_WINDRES):
+	Initialize these for i*86-*-beos*, like for pe and cygwin32.
+	* configure: Regenerated.
+
+Mon Jun  1 21:01:51 1998  Fred Fish  <fnf@ninemoons.com>
+
+	Integrated patch from jeffdb@goodnet.com:
+	* objdump.c (dump_section_header):  Add associated section/comdat
+ 	symbol info to output from "--section-header" command.
+
 Mon Apr 27 13:45:26 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.in: Set version number to 2.9.1.
 	* configure: Rebuild.
 
 Tue Apr  7 15:41:15 1998  Ian Lance Taylor  <ian@cygnus.com>
-
 	* Makefile.am (DISTSTUFF): Add defparse.h, defparse.c, rclex.c,
 	rcparse.h, and rcparse.c
 	* Makefile.in: Rebuild.
@@ -109,6 +137,12 @@ Tue Feb 24 13:07:50 1998  Doug Evans  <devans@canuck.cygnus.com>
 	find_symbol_for_address.  Set disasm_info.symbols to array of
 	symbols at the current address.
 
+Sat Feb 21 16:09:13 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* bucomm.h: Only use gcc's builtin alloca if C_ALLOCA is
+	not defined.  Only include <alloca.h> if C_ALLOCA is not
+	defined.
+
 Wed Feb 18 23:39:46 1998  Richard Henderson  <rth@cygnus.com>
 
 	* Makefile.am (install-exec-local): Install properly when ln
@@ -300,10 +334,20 @@ Sun Nov  2 14:49:56 1997  Ian Lance Taylor  <ian@cygnus.com>
 	declarations.  Add prototype declarations for add_specific_symbol
 	and is_specified_symbol.
 
+Tue Oct 28 09:01:02 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (BFDLIB,OPCODES): For BeOS hosts, directly
+ 	include libraries rather than using -L search paths.
+	* configure: Regenerated.
+	
 Mon Oct 20 15:31:43 1997  Klaus K"ampf  <kkaempf@progis.de>
 
 	* configure.com (HAVE_SBRK): Undefine.
 
+Mon Oct 20 11:09:00 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* Makefile.in (AR, ARFLAGS): Remove, not used.
+
 Tue Oct 14 16:14:35 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* objdump.c (objdump_symbol_at_address): New function.  Returns
@@ -374,6 +418,12 @@ Wed Sep 24 11:34:05 1997  Ian Lance Taylor  <ian@cygnus.com>
 	* aclocal.m4: Rebuild with new libtool.
 	* configure: Rebuild.
 
+Mon Sep 22 14:49:19 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* wrstabs.c (write_stabs_in_sections_debugging_info):
+	Cast args to strcpy and strlen from unsigned char * to
+	just char *, for picky compilers.
+
 Tue Aug 26 17:48:34 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* Makefile.am (EXEEXT_FOR_BUILD): New variable.  Use it in all
@@ -1147,6 +1197,10 @@ Mon Jul 22 08:46:15 1996  Stu Grossman  (grossman@lisa.cygnus.com)
 	ending with numbers.  This fixes a problem with .stab being
 	confused with .stab.index.
 
+Thu Jul 18 16:58:11 1996  Daniel Verite <daniel@brainstorm.eu.org>
+
+	* objdump.c (disassemble_data): Added a sanity check.
+
 Wed Jul 10 13:32:28 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* stabs.c (stab_demangle_fund_type): Return a void * for a
@@ -2606,7 +2660,7 @@ Thu Jul 13 10:43:59 1995  Ian Lance Taylor  <ian@cygnus.com>
 	* nlmconv.c (powerpc_mangle_relocs): Cast memset arg to size_t.
 	* objcopy.c (copy_object): Likewise.
 
-	* nm.c (HAVE_SBRK): Define execpt on amigados and WINDOWS_NT.
+	* nm.c (HAVE_SBRK): Define execpt on amigaos and WINDOWS_NT.
 	(struct size_sym): Define.
 	(show_stats): New static variable.
 	(long_options): Add undocumented option "stats".
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
index 34475de..4aaa4c1 100644
--- binutils-2.9.1.orig/binutils/Makefile.in
+++ binutils-2.9.1/binutils/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -70,17 +76,10 @@ CC = @CC@
 DLLTOOL_DEFS = @DLLTOOL_DEFS@
 EXEEXT = @EXEEXT@
 HDEFINES = @HDEFINES@
-LD = @LD@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
 NLMCONV_DEFS = @NLMCONV_DEFS@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 UNDERSCORE = @UNDERSCORE@
-VERSION = @VERSION@
 
 AUTOMAKE_OPTIONS = cygnus dejagnu
 
@@ -335,13 +334,20 @@ CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then echo $(top_builddir)/../texinfo/makeinfo/makeinfo; else echo makeinfo; fi`
 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
 TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = binutils.info
 DVIS = binutils.dvi
 TEXINFOS = binutils.texi
-MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 	addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
-
+GUIDES = binutils.guide
+GUIDE_DEPS = binutils.guide
+HTMLS = binutils.html
+HTML_DEPS = binutils.html
+PS_S = binutils.ps
+PS_DEPS = binutils.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  README ChangeLog Makefile.am Makefile.in NEWS acconfig.h \
@@ -350,21 +356,24 @@ configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c \
 stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(c__filt_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES)
 OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(c__filt_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) config.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .l .lo .o .ps .s .texi .texinfo .txi .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -408,18 +417,18 @@ maintainer-clean-binPROGRAMS:
 
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(bindir)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
 uninstall-binPROGRAMS:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	done
 
 mostlyclean-noinstPROGRAMS:
@@ -543,6 +552,9 @@ nlmheader.h: nlmheader.c
 	$(SHELL) $(YLWRAP) "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(LFLAGS)
 
 binutils.info: binutils.texi
+binutils.guide: binutils.texi
+binutils.html: binutils.texi
+binutils.ps: binutils.dvi
 binutils.dvi: binutils.texi
 
 
@@ -550,7 +562,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -558,39 +570,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -601,11 +625,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -618,12 +642,155 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
+	  binutils.fns binutils.ky binutils.kys binutils.ps \
+	  binutils.log binutils.pg binutils.toc binutils.tp \
+	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
 	  binutils.fns binutils.ky binutils.kys binutils.ps \
 	  binutils.log binutils.pg binutils.toc binutils.tp \
 	  binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
-	  binutils.cv binutils.cn
+	  binutils.cv binutils.cn binutils.guide binutils.html \
+	  binutils.ps
 
 clean-aminfo:
 
@@ -637,101 +804,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "ar" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ar.1; then file=$(srcdir)/ar.1; \
-	else file=ar.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "nlmconv" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/nlmconv.1; then file=$(srcdir)/nlmconv.1; \
-	else file=nlmconv.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/$(DEMANGLER_PROG).1; then file=$(srcdir)/$(DEMANGLER_PROG).1; \
-	else file=$(DEMANGLER_PROG).1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "nm" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/nm.1; then file=$(srcdir)/nm.1; \
-	else file=nm.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "objdump" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/objdump.1; then file=$(srcdir)/objdump.1; \
-	else file=objdump.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "ranlib" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ranlib.1; then file=$(srcdir)/ranlib.1; \
-	else file=ranlib.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "size" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/size.1; then file=$(srcdir)/size.1; \
-	else file=size.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "strings" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/strings.1; then file=$(srcdir)/strings.1; \
-	else file=strings.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "strip" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/strip.1; then file=$(srcdir)/strip.1; \
-	else file=strip.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "objcopy" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/objcopy.1; then file=$(srcdir)/objcopy.1; \
-	else file=objcopy.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
-	@sect=1;				\
-	inst=`echo "addr2line" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/addr2line.1; then file=$(srcdir)/addr2line.1; \
-	else file=addr2line.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "ar" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "nlmconv" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "nm" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "objdump" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "ranlib" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "size" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "strings" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "strip" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "objcopy" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
-	-inst=`echo "addr2line" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -827,6 +938,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE) check-DEJAGNU
@@ -843,12 +957,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-binPROGRAMS uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(bindir) $(mandir)/man1
+	$(mkinstalldirs)  $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -867,40 +979,51 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-binPROGRAMS \
 		mostlyclean-noinstPROGRAMS mostlyclean-compile \
-		mostlyclean-libtool mostlyclean-aminfo mostlyclean-tags \
-		mostlyclean-generic mostlyclean-local
+		mostlyclean-libtool mostlyclean-aminfo \
+		mostlyclean-guide mostlyclean-html mostlyclean-dvi \
+		mostlyclean-ps mostlyclean-tags mostlyclean-generic \
+		mostlyclean-local
 
 clean:  clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
-		clean-libtool clean-aminfo clean-tags clean-generic \
-		mostlyclean
+		clean-libtool clean-aminfo clean-guide clean-html \
+		clean-dvi clean-ps clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-binPROGRAMS distclean-noinstPROGRAMS \
 		distclean-compile distclean-libtool distclean-aminfo \
-		distclean-tags distclean-generic clean
+		distclean-guide distclean-html distclean-dvi \
+		distclean-ps distclean-tags distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
 		maintainer-clean-noinstPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
 clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
 mostlyclean-compile distclean-compile clean-compile \
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
-info dvi installcheck install-info install-exec install-data install \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir check-DEJAGNU info guide html \
+ps dvi installcheck install-info install-exec install-data install \
 uninstall all installdirs mostlyclean-generic distclean-generic \
 clean-generic maintainer-clean-generic clean mostlyclean distclean \
 maintainer-clean
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index d5f2834..24b94cf 100644
--- binutils-2.9.1.orig/binutils/bucomm.c
+++ binutils-2.9.1/binutils/bucomm.c
@@ -137,7 +137,7 @@ list_supported_targets (name, f)
      const char *name;
      FILE *f;
 {
-  extern bfd_target *bfd_target_vector[];
+  extern const bfd_target * const bfd_target_vector[];
   int t;
 
   if (name == NULL)
diff --git a/binutils/bucomm.h b/binutils/bucomm.h
index 6279a8d..2649c63 100644
--- binutils-2.9.1.orig/binutils/bucomm.h
+++ binutils-2.9.1/binutils/bucomm.h
@@ -96,11 +96,11 @@ extern char *getenv ();
 #define SEEK_END 2
 #endif
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 # undef alloca
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
+# if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #  include <alloca.h>
 # else
 #  ifndef alloca /* predefined by HP cc +Olibcalls */
diff --git a/binutils/configure b/binutils/configure
index 740ec6f..c393fe8 100755
--- binutils-2.9.1.orig/binutils/configure
+++ binutils-2.9.1/binutils/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -653,21 +679,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:662: checking for a BSD compatible install" >&5
+echo "configure:689: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -706,13 +733,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:716: checking whether build environment is sane" >&5
+echo "configure:745: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -769,7 +798,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:802: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -815,7 +844,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:819: checking for working aclocal" >&5
+echo "configure:848: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -828,7 +857,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:832: checking for working autoconf" >&5
+echo "configure:861: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -841,7 +870,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:845: checking for working automake" >&5
+echo "configure:874: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -854,7 +883,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:858: checking for working autoheader" >&5
+echo "configure:887: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -867,7 +896,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:871: checking for working makeinfo" >&5
+echo "configure:900: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -930,15 +959,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:934: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -959,15 +989,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:963: checking for $ac_word" >&5
+echo "configure:993: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -985,19 +1016,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1056: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1085: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1118: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1032,25 +1159,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1170: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1050 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1212 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1064,18 +1227,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1243: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1079: checking whether we are using GNU C" >&5
+echo "configure:1248: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1084,7 +1253,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1095,11 +1264,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1276: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,18 +1287,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1139,7 +1339,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1143: checking for ld used by GCC" >&5
+echo "configure:1343: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1157,10 +1357,10 @@ echo "configure:1143: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1161: checking for GNU ld" >&5
+echo "configure:1361: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1164: checking for non-GNU ld" >&5
+echo "configure:1364: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1196,7 +1396,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1400: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1212,7 +1412,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1216: checking for BSD-compatible nm" >&5
+echo "configure:1416: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1249,7 +1449,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1253: checking whether ln -s works" >&5
+echo "configure:1453: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1259,14 +1459,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1285,8 +1495,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1289 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1499 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1350,15 +1560,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1354: checking for $ac_word" >&5
+echo "configure:1564: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1376,19 +1587,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1594: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1627: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1656: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1383: checking for $ac_word" >&5
+echo "configure:1689: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1423,25 +1730,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1741: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1431: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1441 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1783 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1455,18 +1798,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1465: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1470: checking whether we are using GNU C" >&5
+echo "configure:1819: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1475,7 +1824,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1486,11 +1835,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1494: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1847: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1505,33 +1858,61 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 for ac_prog in 'bison -y' byacc
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1527: checking for $ac_word" >&5
+echo "configure:1907: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -1555,15 +1936,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1559: checking for $ac_word" >&5
+echo "configure:1940: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -1588,7 +1970,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1592: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1974: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1596,7 +1978,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1600 "configure"
+#line 1982 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1607,7 +1989,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1630,7 +2012,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1634: checking how to run the C preprocessor" >&5
+echo "configure:2016: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1645,14 +2027,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1649 "configure"
+#line 2031 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1662,14 +2044,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1666 "configure"
+#line 2048 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2065 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1682,6 +2081,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1691,7 +2092,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1695: checking lex output file root" >&5
+echo "configure:2096: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1712,7 +2113,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:1716: checking whether yytext is a pointer" >&5
+echo "configure:2117: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1724,14 +2125,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 1728 "configure"
+#line 2129 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -1754,7 +2155,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1758: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2159: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1772,19 +2173,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1776: checking for Cygwin32 environment" >&5
+echo "configure:2177: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1781 "configure"
+#line 2182 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1801,19 +2202,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1805: checking for Mingw32 environment" >&5
+echo "configure:2206: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 2211 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1832,7 +2233,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1836: checking for executable suffix" >&5
+echo "configure:2237: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1868,15 +2269,16 @@ AR=${AR-ar}
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1872: checking for $ac_word" >&5
+echo "configure:2273: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1912,7 +2314,7 @@ if test "x$cross_compiling" = "xno"; then
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:1916: checking for build system executable suffix" >&5
+echo "configure:2318: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1937,18 +2339,18 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1941: checking for $ac_hdr" >&5
+echo "configure:2343: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
+#line 2348 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1974,12 +2376,12 @@ fi
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1978: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2380: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1983 "configure"
+#line 2385 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1995,7 +2397,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2018,19 +2420,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2022: checking for working alloca.h" >&5
+echo "configure:2424: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2027 "configure"
+#line 2429 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2050,26 +2452,44 @@ EOF
 
 fi
 
+# Temporary ugly hack for BeOS.  Don't try to run the test for alloca
+# since it will succeed due to finding the version of alloca in the
+# runtime library.  We don't want to use that version, so let's pretend
+# we loaded it from the cache (default to 'no') and thus the package will configure
+# itself to use it's private copy of the C alloca replacement.  When the
+# horribly small default stack size problem is fixed (exists up through
+# at least DR8.2) then we can build gcc to start using it's builtin
+# alloca, we can allow mwcc to use it's builtin alloca, and this hack
+# can go away.
+if test "`uname`" = "BeOS"; then
+  test -z "$ac_cv_func_alloca_works" && ac_cv_func_alloca_works=no
+fi
+
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2055: checking for alloca" >&5
+echo "configure:2470: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2060 "configure"
+#line 2475 "configure"
 #include "confdefs.h"
 
-#ifdef __GNUC__
+#if 0	/* Never do this, it's unnecessary. -fnf */
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
 # else
-#  ifdef _AIX
- #pragma alloca
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
 #  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#    endif
 #   endif
 #  endif
 # endif
@@ -2079,7 +2499,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2104,19 +2524,19 @@ if test $ac_cv_func_alloca_works = no; then
   # that cause trouble.  Some versions do not even contain alloca or
   # contain a buggy version.  If you still want to use their alloca,
   # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.o
+  ALLOCA=alloca.${ac_objext}
   cat >> confdefs.h <<\EOF
 #define C_ALLOCA 1
 EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2115: checking whether alloca needs Cray hooks" >&5
+echo "configure:2535: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2120 "configure"
+#line 2540 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2141,12 +2561,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2145: checking for $ac_func" >&5
+echo "configure:2565: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2150 "configure"
+#line 2570 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2169,7 +2589,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2196,7 +2616,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2200: checking stack direction for C alloca" >&5
+echo "configure:2620: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2204,7 +2624,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2208 "configure"
+#line 2628 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2223,7 +2643,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2247,12 +2667,12 @@ fi
 for ac_func in sbrk utimes
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2251: checking for $ac_func" >&5
+echo "configure:2671: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2256 "configure"
+#line 2676 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2275,7 +2695,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2301,19 +2721,19 @@ done
 
 
 echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
-echo "configure:2305: checking for time_t in time.h" >&5
+echo "configure:2725: checking for time_t in time.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2310 "configure"
+#line 2730 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:2317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_time_h=yes
 else
@@ -2334,19 +2754,19 @@ EOF
 fi
 
 echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2338: checking for time_t in sys/types.h" >&5
+echo "configure:2758: checking for time_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2343 "configure"
+#line 2763 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 time_t i;
 ; return 0; }
 EOF
-if { (eval echo configure:2350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_decl_time_t_types_h=yes
 else
@@ -2369,12 +2789,12 @@ fi
 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
 # by default.
 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
-echo "configure:2373: checking for utime.h" >&5
+echo "configure:2793: checking for utime.h" >&5
 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2378 "configure"
+#line 2798 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_TIME_H
@@ -2385,7 +2805,7 @@ int main() {
 struct utimbuf s;
 ; return 0; }
 EOF
-if { (eval echo configure:2389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bu_cv_header_utime_h=yes
 else
@@ -2406,12 +2826,12 @@ EOF
 fi
 
 echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
-echo "configure:2410: checking whether fprintf must be declared" >&5
+echo "configure:2830: checking whether fprintf must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2415 "configure"
+#line 2835 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2432,7 +2852,7 @@ int main() {
 char *(*pfn) = (char *(*)) fprintf
 ; return 0; }
 EOF
-if { (eval echo configure:2436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_fprintf=no
 else
@@ -2454,12 +2874,12 @@ EOF
 fi
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2458: checking whether strstr must be declared" >&5
+echo "configure:2878: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2463 "configure"
+#line 2883 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2480,7 +2900,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2502,12 +2922,12 @@ EOF
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2506: checking whether sbrk must be declared" >&5
+echo "configure:2926: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2511 "configure"
+#line 2931 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2528,7 +2948,7 @@ int main() {
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:2532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -2550,12 +2970,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2554: checking whether getenv must be declared" >&5
+echo "configure:2974: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2559 "configure"
+#line 2979 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2576,7 +2996,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2666,7 +3086,7 @@ do
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
-	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
+	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32* | i[3-6]86-*-beos* )
   	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
@@ -2724,7 +3144,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2770,7 +3190,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2791,7 +3213,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2815,6 +3237,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2832,6 +3255,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2849,8 +3276,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2861,6 +3288,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -2873,7 +3301,6 @@ s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
 s%@MAINT@%$MAINT%g
 s%@EXEEXT@%$EXEEXT%g
 s%@HDEFINES@%$HDEFINES%g
-s%@AR@%$AR%g
 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
 s%@EXEEXT_FOR_BUILD@%$EXEEXT_FOR_BUILD%g
 s%@ALLOCA@%$ALLOCA%g
@@ -3026,6 +3453,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -3071,6 +3499,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -3102,6 +3531,7 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/binutils/configure.in b/binutils/configure.in
index 8b6dbfb..c5f28c2 100644
--- binutils-2.9.1.orig/binutils/configure.in
+++ binutils-2.9.1/binutils/configure.in
@@ -166,7 +166,7 @@ changequote([,])dnl
 	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
 	 ;;
 changequote(,)dnl
-	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
+	i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32* | i[3-6]86-*-beos* )
 changequote([,])dnl
   	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
 	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 1253f9f..e899d8c 100644
--- binutils-2.9.1.orig/binutils/dlltool.c
+++ binutils-2.9.1/binutils/dlltool.c
@@ -314,7 +314,7 @@ static const unsigned char arm_jtab[] =
 static const unsigned char ppc_jtab[] = 
 { 
   0x00, 0x00, 0x62, 0x81, /* lwz r11,0(r2)               */
-                          /*   Reloc TOCREL16 __imp_xxx  */
+                          /*   Reloc TOCREL16 _imp__xxx  */
   0x00, 0x00, 0x8B, 0x81, /* lwz r12,0(r11)              */
   0x04, 0x00, 0x41, 0x90, /* stw r2,4(r1)                */
   0xA6, 0x03, 0x89, 0x7D, /* mtctr r12                   */
@@ -1292,14 +1292,14 @@ both single and double underscores, for compatibility.
 
 	.text
 	.global	_GetFileVersionInfoSizeW@8
-	.global	__imp_GetFileVersionInfoSizeW@8
+	.global	_imp__GetFileVersionInfoSizeW@8
 _GetFileVersionInfoSizeW@8:
-	jmp *	__imp_GetFileVersionInfoSizeW@8
+	jmp *	_imp__GetFileVersionInfoSizeW@8
 	.section	.idata$7	# To force loading of head
 	.long	__version_a_head
 # Import Address Table
 	.section	.idata$5
-__imp_GetFileVersionInfoSizeW@8:
+_imp__GetFileVersionInfoSizeW@8:
 	.rva	ID2
 
 # Import Lookup Table
@@ -1316,8 +1316,8 @@ For the PowerPC, here's the variation on the above scheme:
 # Rather than a simple "jmp *", the code to get to the dll function 
 # looks like:
          .text
-         lwz	r11,[tocv]__imp_function_name(r2)
-#		   RELOC: 00000000 TOCREL16,TOCDEFN __imp_function_name
+         lwz	r11,[tocv]_imp__function_name(r2)
+#		   RELOC: 00000000 TOCREL16,TOCDEFN _imp__function_name
          lwz	r12,0(r11)
 	 stw	r2,4(r1)
 	 mtctr	r12
@@ -1353,7 +1353,7 @@ make_one_lib_file (exp, i)
       fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
       fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
       fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
-      fprintf (f, "%s%s:\n\t%s\t__imp_%s\n", ASM_PREFIX,
+      fprintf (f, "%s%s:\n\t%s\t_imp__%s\n", ASM_PREFIX,
 	       exp->name, ASM_JUMP, exp->name);
 
       fprintf (f, "\t.section\t.idata$7\t%s To force loading of head\n", ASM_C);
diff --git a/binutils/nm.c b/binutils/nm.c
index 27ae400..4367dba 100644
--- binutils-2.9.1.orig/binutils/nm.c
+++ binutils-2.9.1/binutils/nm.c
@@ -891,10 +891,7 @@ display_rel_file (abfd, archive_bfd)
   if (! dynamic)
     {
       if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
-	{
-	  printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
-	  return;
-	}
+        return;
     }
 
   symcount = bfd_read_minisymbols (abfd, dynamic, &minisyms, &size);
@@ -902,10 +899,7 @@ display_rel_file (abfd, archive_bfd)
     bfd_fatal (bfd_get_filename (abfd));
 
   if (symcount == 0)
-    {
-      fprintf (stderr, "%s: no symbols\n", bfd_get_filename (abfd));
       return;
-    }
 
   /* Discard the symbols we don't want to print.
      It's OK to do this in place; we'll free the storage anyway
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index f054bb9..0e570f7 100644
--- binutils-2.9.1.orig/binutils/objcopy.c
+++ binutils-2.9.1/binutils/objcopy.c
@@ -422,7 +422,7 @@ find_section_list (name, add)
 
 /* Add a symbol to strip_specific_list.  */
 
-static void 
+static void
 add_specific_symbol (name, list)
      const char *name;
      struct symlist **list;
@@ -529,6 +529,8 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
 
       if ((flags & BSF_KEEP) != 0)		/* Used in relocation.  */
 	keep = 1;
+      else if (strip_symbols == strip_all)
+	keep = 0;
       else if ((flags & BSF_GLOBAL) != 0	/* Global symbol.  */
 	       || (flags & BSF_WEAK) != 0
 	       || bfd_is_und_section (bfd_get_section (sym))
@@ -667,7 +669,7 @@ copy_object (ibfd, obfd)
 	  else
 	    {
 	      flagword flags;
-	      
+
 	      if (! bfd_set_section_size (obfd, padd->section, padd->size))
 		nonfatal (bfd_get_filename (obfd));
 
@@ -779,12 +781,12 @@ copy_object (ibfd, obfd)
 
   /* Symbol filtering must happen after the output sections have
      been created, but before their contents are set.  */
-  if (strip_symbols == strip_all)
+  /*if (strip_symbols == strip_all && !keep_specific_list)
     {
       osympp = isympp = NULL;
       symcount = 0;
     }
-  else
+    else*/
     {
       long symsize;
       PTR dhandle = NULL;
@@ -805,7 +807,7 @@ copy_object (ibfd, obfd)
       if (convert_debugging)
 	dhandle = read_debugging_info (ibfd, isympp, symcount);
 
-      if (strip_symbols == strip_debug 
+      /*if (strip_symbols == strip_debug
 	  || strip_symbols == strip_unneeded
 	  || discard_locals != locals_undef
 	  || strip_specific_list != NULL
@@ -816,8 +818,8 @@ copy_object (ibfd, obfd)
 	  || convert_debugging
 	  || change_leading_char
 	  || remove_leading_char
-	  || weaken)
-	{
+	  || weaken)*/
+	  {
 	  /* Mark symbols used in output relocations so that they
 	     are kept, even if they are local labels or static symbols.
 
@@ -1242,9 +1244,10 @@ copy_section (ibfd, isection, obfdarg)
   if (size == 0 || osection == 0)
     return;
 
-  if (strip_symbols == strip_all)
+  /* Never, ever, strip reloc data on the Amiga! */
+  /*if (strip_symbols == strip_all && bfd_get_flavour(obfd) != bfd_target_amiga_flavour)
     bfd_set_reloc (obfd, osection, (arelent **) NULL, 0);
-  else
+    else*/
     {
       long relsize;
 
@@ -1280,7 +1283,7 @@ copy_section (ibfd, isection, obfdarg)
 	  nonfatal (bfd_get_filename (ibfd));
 	}
 
-      if (copy_byte >= 0) 
+      if (copy_byte >= 0)
         {
 	  filter_bytes (memhunk, &size);
               /* The section has gotten smaller. */
@@ -1747,6 +1750,9 @@ strip_main (argc, argv)
   if (show_version)
     print_version ("strip");
 
+  add_specific_symbol("__amigappc__", &keep_specific_list);
+  add_specific_symbol("__abox__", &keep_specific_list);
+
   /* Default is to strip all symbols.  */
   if (strip_symbols == strip_undef
       && discard_locals == locals_undef
@@ -2076,6 +2082,9 @@ copy_main (argc, argv)
   if (show_version)
     print_version ("objcopy");
 
+  add_specific_symbol("__amigappc__", &keep_specific_list);
+  add_specific_symbol("__abox__", &keep_specific_list);
+
   if (copy_byte >= interleave)
     {
       fprintf (stderr, "%s: byte number must be less than interleave\n",
@@ -2116,7 +2125,7 @@ copy_main (argc, argv)
 
       copy_file (input_filename, tmpname, input_target, output_target);
       if (status == 0)
-	{	
+	{
 	  if (preserve_dates)
 	    set_times (tmpname, &statbuf);
 	  smart_rename (tmpname, input_filename);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 65ac410..62969dc 100644
--- binutils-2.9.1.orig/binutils/objdump.c
+++ binutils-2.9.1/binutils/objdump.c
@@ -328,6 +328,7 @@ dump_section_header (abfd, section, ignored)
   if ((section->flags & SEC_LINK_ONCE) != 0)
     {
       const char *ls;
+      pei_get_comdat_info(section);
 
       switch (section->flags & SEC_LINK_DUPLICATES)
 	{
@@ -348,6 +349,10 @@ dump_section_header (abfd, section, ignored)
 	}
       printf ("%s%s", comma, ls);
       comma = ", ";
+      if (section->pe_comdat_info->asoc_sec != (int)NULL)
+        printf ("\n		    Associated with section %d", section->pe_comdat_info->asoc_sec -1);
+      else
+        printf ("\n		    Communal; sym=%s", section->pe_comdat_info->comdat_sym);
     }
 
   printf ("\n");
@@ -376,7 +381,6 @@ slurp_symtab (abfd)
 
   if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
     {
-      printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
       symcount = 0;
       return NULL;
     }
@@ -392,9 +396,6 @@ slurp_symtab (abfd)
   symcount = bfd_canonicalize_symtab (abfd, sy);
   if (symcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
-  if (symcount == 0)
-    fprintf (stderr, "%s: %s: No symbols\n",
-	     program_name, bfd_get_filename (abfd));
   return sy;
 }
 
@@ -428,9 +429,6 @@ slurp_dynamic_symtab (abfd)
   dynsymcount = bfd_canonicalize_dynamic_symtab (abfd, sy);
   if (dynsymcount < 0)
     bfd_fatal (bfd_get_filename (abfd));
-  if (dynsymcount == 0)
-    fprintf (stderr, "%s: %s: No dynamic symbols\n",
-	     program_name, bfd_get_filename (abfd));
   return sy;
 }
 
@@ -2181,19 +2179,18 @@ dump_symbols (abfd, dynamic)
     {
       current = dynsyms;
       max = dynsymcount;
-      if (max == 0)
-	return;
       printf ("DYNAMIC SYMBOL TABLE:\n");
     }
   else
     {
       current = syms;
       max = symcount;
-      if (max == 0)
-	return;
       printf ("SYMBOL TABLE:\n");
     }
 
+  if (max == 0)
+    printf ("no symbols\n");
+
   for (count = 0; count < max; count++)
     {
       if (*current)
@@ -2466,14 +2463,14 @@ endian_string (endian)
 static void
 display_target_list ()
 {
-  extern bfd_target *bfd_target_vector[];
+  extern const bfd_target * const bfd_target_vector[];
   char *dummy_name;
   int t;
 
   dummy_name = choose_temp_base ();
   for (t = 0; bfd_target_vector[t]; t++)
     {
-      bfd_target *p = bfd_target_vector[t];
+      const bfd_target *p = bfd_target_vector[t];
       bfd *abfd = bfd_openw (dummy_name, p->name);
       int a;
 
@@ -2512,7 +2509,7 @@ display_info_table (first, last)
      int first;
      int last;
 {
-  extern bfd_target *bfd_target_vector[];
+  extern const bfd_target * const bfd_target_vector[];
   int t, a;
   char *dummy_name;
 
@@ -2530,7 +2527,7 @@ display_info_table (first, last)
 		bfd_printable_arch_mach (a, 0));
 	for (t = first; t < last && bfd_target_vector[t]; t++)
 	  {
-	    bfd_target *p = bfd_target_vector[t];
+	    const bfd_target *p = bfd_target_vector[t];
 	    boolean ok = true;
 	    bfd *abfd = bfd_openw (dummy_name, p->name);
 
@@ -2579,7 +2576,7 @@ static void
 display_target_tables ()
 {
   int t, columns;
-  extern bfd_target *bfd_target_vector[];
+  extern const bfd_target * const bfd_target_vector[];
   char *colum;
 
   columns = 0;
diff --git a/binutils/rclex.c b/binutils/rclex.c
index 3c9682e..87c82a6 100644
--- binutils-2.9.1.orig/binutils/rclex.c
+++ binutils-2.9.1/binutils/rclex.c
@@ -1,7 +1,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
+ * $Header: /home/cvs/root/morphos/morphoswb/development/binutils/binutils/rclex.c,v 1.1.1.1 2005/03/15 16:00:36 laire Exp $
  */
 
 #define FLEX_SCANNER
diff --git a/config.guess b/config.guess
index 583439e..d0d57f6 100755
--- binutils-2.9.1.orig/config.guess
+++ binutils-2.9.1/config.guess
@@ -1,7 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 93-97, 1998 Free Software Foundation, Inc.
-#
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-09-19'
+
 # This file 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
@@ -14,154 +17,323 @@
 #
 # 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.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
 # The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
     alpha:OSF1:*:*)
-	if test $UNAME_RELEASE = "V4.0"; then
+	case $UNAME_RELEASE in
+	*4.0)
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-	fi
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	cat <<EOF >dummy.s
-	.globl main
-	.ent main
-main:
-	.frame \$30,0,\$26,0
-	.prologue 0
-	.long 0x47e03d80 # implver $0
-	lda \$2,259
-	.long 0x47e20c21 # amask $2,$1
-	srl \$1,8,\$2
-	sll \$2,2,\$2
-	sll \$0,3,\$0
-	addl \$1,\$0,\$0
-	addl \$2,\$0,\$0
-	ret \$31,(\$26),1
-	.end main
-EOF
-	${CC-cc} dummy.s -o dummy 2>/dev/null
-	if test "$?" = 0 ; then
-		./dummy
-		case "$?" in
-			7)
-				UNAME_MACHINE="alpha"
-				;;
-			15)
-				UNAME_MACHINE="alphaev5"
-				;;
-			14)
-				UNAME_MACHINE="alphaev56"
-				;;
-			10)
-				UNAME_MACHINE="alphapca56"
-				;;
-			16)
-				UNAME_MACHINE="alphaev6"
-				;;
-		esac
-	fi
-	rm -f dummy.s dummy
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
-	exit 0 ;;
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit 0 ;;
+	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-cbm-sysv4
-	exit 0;;
-    amiga:NetBSD:*:*)
-      echo m68k-cbm-netbsd${UNAME_RELEASE}
-      exit 0 ;;
-    amiga:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc64:OpenBSD:*:*)
-	echo mips64el-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    arc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hkmips:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    pmax:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sgi:OpenBSD:*:*)
-	echo mips-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-	echo mipsel-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit 0;;
-    arm32:NetBSD:*:*)
-	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
-    SR2?01:HI-UX/MPP:*:*)
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit 0;;
-    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
 		echo pyramid-pyramid-sysv3
 	else
 		echo pyramid-pyramid-bsd
 	fi
-	exit 0 ;;
-    NILE:*:*:dcosx)
+	exit ;;
+    NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit 0 ;;
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
@@ -170,12 +342,12 @@ EOF
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit 0 ;;
+	exit ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
@@ -185,52 +357,63 @@ EOF
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	exit 0 ;;
+	exit ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit 0 ;;
-    atari*:NetBSD:*:*)
-	echo m68k-atari-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    atari*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3*:NetBSD:*:*)
-	echo m68k-sun-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    sun3*:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:NetBSD:*:*)
-	echo m68k-apple-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mac68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-	echo m88k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit 0 ;;
+	exit ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit 0 ;;
-    2020:CLIX:*:*)
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	sed 's/^	//' << EOF >dummy.c
-	int main (argc, argv) int argc; char **argv; {
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
 	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -245,62 +428,83 @@ EOF
 	  exit (-1);
 	}
 EOF
-	${CC-cc} dummy.c -o dummy \
-	  && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-	  && rm dummy.c dummy && exit 0
-	rm -f dummy.c dummy
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit 0 ;;
+	exit ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit 0 ;;
+	exit ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit 0 ;;
+	exit ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
 		echo m88k-dg-dgux${UNAME_RELEASE}
-	else
+	    else
 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
-        else echo i586-dg-dgux${UNAME_RELEASE}
-        fi
- 	exit 0 ;;
+ 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit 0 ;;
+	exit ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit 0 ;;
+	exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit 0 ;;
+	exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit 0 ;;
+	exit ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit 0 ;;
+	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
-    i?86:AIX:*:*)
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit 0 ;;
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		sed 's/^		//' << EOF >dummy.c
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
 		#include <sys/systemcfg.h>
 
 		main()
@@ -311,17 +515,21 @@ EOF
 			exit(0);
 			}
 EOF
-		${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-		rm -f dummy.c dummy
-		echo rs6000-ibm-aix3.2.5
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
-	exit 0 ;;
-    *:AIX:*:4)
-	if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+	exit ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
@@ -329,48 +537,120 @@ EOF
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=4.${UNAME_RELEASE}
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit 0 ;;
+	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit 0 ;;
+	exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit 0 ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit 0 ;;                           # report: romp-ibm BSD 4.3
+	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit 0 ;;
+	exit ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit 0 ;;
+	exit ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit 0 ;;
+	exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit 0 ;;
-    9000/[3478]??:HP-UX:*:*)
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
 	    9000/31? )            HP_ARCH=m68000 ;;
 	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/6?? )		  HP_ARCH=hppa1.0 ;;
-	    9000/78? )		  HP_ARCH=hppa1.1 ;; # FIXME: really hppa2.0
-	    9000/7?? )		  HP_ARCH=hppa1.1 ;;
-	    9000/8[67]1 | 9000/80[24] | 9000/8[78]9 | 9000/893 )
-				  HP_ARCH=hppa1.1 ;; # FIXME: really hppa2.0
-	    9000/8?[13679] )	  HP_ARCH=hppa1.1 ;;
-	    9000/8?? )		  HP_ARCH=hppa1.0 ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
 	esac
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit 0 ;;
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
     3050*:HI-UX:*:*)
-	sed 's/^	//' << EOF >dummy.c
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
 	#include <unistd.h>
 	int
 	main ()
@@ -395,367 +675,447 @@ EOF
 	  exit (0);
 	}
 EOF
-	${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-	rm -f dummy.c dummy
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
-	exit 0 ;;
+	exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit 0 ;;
+	exit ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit 0 ;;
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit 0 ;;
+	exit ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit 0 ;;
-    i?86:OSF1:*:*)
+	exit ;;
+    i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit 0 ;;
+	exit ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit 0 ;;
+	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit 0 ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit 0 ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit 0 ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit 0 ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit 0 ;;
-    CRAY*X-MP:*:*:*)
-	echo xmp-cray-unicos
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE}
-	exit 0 ;;
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
-	exit 0 ;;
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE}
-	exit 0 ;;
-    CRAY-2:*:*:*)
-	echo cray2-cray-unicos
-        exit 0 ;;
-    F300:UNIX_System_V:*:*)
-        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
-    F301:UNIX_System_V:*:*)
-       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
-       exit 0 ;;
-    hp3[0-9][05]:NetBSD:*:*)
-	echo m68k-hp-netbsd${UNAME_RELEASE}
-	exit 0 ;;
-    hp300:OpenBSD:*:*)
-	echo m68k-unknown-openbsd${UNAME_RELEASE}
-	exit 0 ;;
-    i?86:BSD/386:*:* | *:BSD/OS:*:*)
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
     *:FreeBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit 0 ;;
-    *:NetBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
-    *:OpenBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-	exit 0 ;;
+	exit ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin32
-	exit 0 ;;
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
     i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit 0 ;;
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
     p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin32
-	exit 0 ;;
+	echo powerpcle-unknown-cygwin
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit 0 ;;
+	exit ;;
     *:GNU:*:*)
+	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit 0 ;;
-    *:Linux:*:*)
-	# uname on the ARM produces all sorts of strangeness, and we need to
-	# filter it out.
-	case "$UNAME_MACHINE" in
-	  arm* | sa110*)	      UNAME_MACHINE="arm" ;;
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us.
-	ld_help_string=`ld --help 2>&1`
-	ld_supported_emulations=`echo $ld_help_string \
-			 | sed -ne '/supported emulations:/!d
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
 				    s/[ 	][ 	]*/ /g
-				    s/.*supported emulations: *//
+				    s/.*supported targets: *//
 				    s/ .*//
 				    p'`
-        case "$ld_supported_emulations" in
-	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
-	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
-	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-	  elf32ppc)
-		# Determine Lib Version
-		cat >dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#if defined(__GLIBC__)
-  printf("%s %s\n", __libc_version, __libc_release);
-#else
-  printf("unkown\n");
-#endif
-  return 0;
-}
-EOF
-		LIBC=""
-		${CC-cc} dummy.c -o dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./dummy | grep 1\.99 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi	
-		rm -f dummy.c dummy
-		echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit ;;
 	esac
-
-	if test "${UNAME_MACHINE}" = "alpha" ; then
-		sed 's/^	//'  <<EOF >dummy.s
-		.globl main
-		.ent main
-	main:
-		.frame \$30,0,\$26,0
-		.prologue 0
-		.long 0x47e03d80 # implver $0
-		lda \$2,259
-		.long 0x47e20c21 # amask $2,$1
-		srl \$1,8,\$2
-		sll \$2,2,\$2
-		sll \$0,3,\$0
-		addl \$1,\$0,\$0
-		addl \$2,\$0,\$0
-		ret \$31,(\$26),1
-		.end main
-EOF
-		LIBC=""
-		${CC-cc} dummy.s -o dummy 2>/dev/null
-		if test "$?" = 0 ; then
-			./dummy
-			case "$?" in
-			7)
-				UNAME_MACHINE="alpha"
-				;;
-			15)
-				UNAME_MACHINE="alphaev5"
-				;;
-			14)
-				UNAME_MACHINE="alphaev56"
-				;;
-			10)
-				UNAME_MACHINE="alphapca56"
-				;;
-			16)
-				UNAME_MACHINE="alphaev6"
-				;;
-			esac	
-
-			objdump --private-headers dummy | \
-			  grep ld.so.1 > /dev/null
-			if test "$?" = 0 ; then
-				LIBC="libc1"
-			fi
-		fi	
-		rm -f dummy.s dummy
-		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
-	elif test "${UNAME_MACHINE}" = "mips" ; then
-	  cat >dummy.c <<EOF
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#ifdef __MIPSEB__
-  printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
-  printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
-  return 0;
-}
-EOF
-	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-	  rm -f dummy.c dummy
-	else
-	  # Either a pre-BFD a.out linker (linux-gnuoldld)
-	  # or one that does not give us useful --help.
-	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-	  # If ld does not provide *any* "supported emulations:"
-	  # that means it is gnuoldld.
-	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
-	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
-	  case "${UNAME_MACHINE}" in
-	  i?86)
-	    VENDOR=pc;
-	    ;;
-	  *)
-	    VENDOR=unknown;
-	    ;;
-	  esac
-	  # Determine whether the default compiler is a.out or elf
-	  cat >dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#ifdef __ELF__
-# ifdef __GLIBC__
-#  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-#  else
-    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-#  endif
-# else
-   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
-  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
-  return 0;
-}
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
 EOF
-	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-	  rm -f dummy.c dummy
-	fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
-# are messed up and put the nodename in both sysname and nodename.
-    i?86:DYNIX/ptx:4*:*)
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && {
+		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		exit
+	}
+	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit 0 ;;
-    i?86:UNIX_SV:4.2MP:2.*)
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
         # I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit 0 ;;
-    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit 0 ;;
-    i?86:*:5:7)
-       UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-       (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-       (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
-               && UNAME_MACHINE=i586
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
-       exit 0 ;;
-    i?86:*:3.2:*)
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
 			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
 		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 	else
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
-	exit 0 ;;
+	exit ;;
     pc:*:*:*)
+	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
-        exit 0 ;;
+        exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
-	exit 0 ;;
+	exit ;;
     paragon:*:*:*)
 	echo i860-intel-osf1
-	exit 0 ;;
+	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit 0 ;;
+	exit ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit 0 ;;
-    M68*:*:R3V[567]*:*)
-	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
-    m68*:LynxOS:2.*:*)
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit 0 ;;
-    i?86:LynxOS:2.*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
-    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+	exit ;;
+    rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit 0 ;;
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit 0 ;;
+	exit ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -763,45 +1123,153 @@ EOF
 	else
 		echo ns32k-sni-sysv
 	fi
-	exit 0 ;;
-    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit 0 ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes@openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit 0 ;;
+	exit ;;
     *:*:*:FTX*)
 	# From seanf@swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit 0 ;;
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit 0 ;;
-    news*:NEWS-OS:*:6*)
+	exit ;;
+    news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit 0 ;;
-    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit 0 ;;
+        exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit 0 ;;
+	exit ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit 0 ;;
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
-cat >dummy.c <<EOF
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
 # include <sys/utsname.h>
@@ -826,7 +1294,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -839,7 +1307,10 @@ main ()
 #endif
   int version;
   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   exit (0);
 #endif
 
@@ -884,11 +1355,24 @@ main ()
 #endif
 
 #if defined (vax)
-#if !defined (ultrix)
-  printf ("vax-dec-bsd\n"); exit (0);
-#else
-  printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
 #endif
 
 #if defined (alliant) && defined (i860)
@@ -899,12 +1383,12 @@ main ()
 }
 EOF
 
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -913,25 +1397,69 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
 	echo c1-convex-bsd
-	exit 0 ;;
+	exit ;;
     c2*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit 0 ;;
+	exit ;;
     c34*)
 	echo c34-convex-bsd
-	exit 0 ;;
+	exit ;;
     c38*)
 	echo c38-convex-bsd
-	exit 0 ;;
+	exit ;;
     c4*)
 	echo c4-convex-bsd
-	exit 0 ;;
+	exit ;;
     esac
 fi
 
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
 
 exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.sub b/config.sub
index 5d135ab..1c366df 100755
--- binutils-2.9.1.orig/config.sub
+++ binutils-2.9.1/config.sub
@@ -1,6 +1,10 @@
 #! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-#   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+timestamp='2005-07-08'
+
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
@@ -17,14 +21,18 @@
 #
 # 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.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
@@ -45,42 +53,74 @@
 #	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 # It is wrong to echo any other type of specification.
 
-if [ x$1 = x ]
-then
-	echo Configuration name missing. 1>&2
-	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
-	echo "or     $0 ALIAS" 1>&2
-	echo where ALIAS is a recognized configuration type. 1>&2
-	exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
 
-# First pass through any local machine types.
-case $1 in
-	*local*)
-		echo $1
-		exit 0
-		;;
-	*)
-	;;
-esac
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
 
-# CYGNUS LOCAL marketing-names
-# Here we handle any "marketing" names - translating them to
-#  standard triplets
-case $1 in 
-	mips-tx39-elf)
-		set mipstx39-unknown-elf
-                ;;
-	*)
-		;;
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
 esac
-# END CYGNUS LOCAL marketing-names
 
 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  linux-gnu*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -106,25 +146,33 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple)
+	-apple | -axis | -knuth | -cray)
 		os=
 		basic_machine=$1
 		;;
-	-sim | -cisco | -oki | -wec | -winbond )	# CYGNUS LOCAL
+	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
 		;;
-	-scout)						# CYGNUS LOCAL
+	-scout)
 		;;
-	-wrs)						# CYGNUS LOCAL
-		os=vxworks
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
 		basic_machine=$1
 		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
 	-sco5)
-		os=sco3.2v5
+		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
 	-sco4)
@@ -143,6 +191,9 @@ case $os in
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
 	-isc)
 		os=-isc2.2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -165,54 +216,81 @@ case $os in
 	-psos*)
 		os=-psos
 		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
 	# Recognize the basic CPU types without company name.
 	# Some are omitted here because they have special meanings below.
-	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
-		| arme[lb] | pyramid | mn10200 | mn10300 \
-		| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
-		| alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
-		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
-		| 1750a | dsp16xx | pdp11 \
-		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
-		| mipstx39 | mipstx39el \
-		| sparc | sparclet | sparclite | sparc64 | v850)
-		basic_machine=$basic_machine-unknown
-		;;
-	m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| ms1 \
+	| msp430 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
-	thumb)
+	m32c)
 		basic_machine=$basic_machine-unknown
 		;;
-	mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
+		os=-none
 		;;
-	mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
-		basic_machine=$basic_machine-unknown
-		;;
-	mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
-		basic_machine=$basic_machine-unknown
-		;;
-	mips16) # CYGNUS LOCAL krk/mips16
-		basic_machine=$basic_machine-unknown
-		;;
-	tic30) # CYGNUS LOCAL ian/tic30
-		basic_machine=$basic_machine-unknown
-		;;
-	c30) # CYGNUS LOCAL ian/tic30
-		basic_machine=tic30-unknown
-		;;
-	d10v)				# CYGNUS LOCAL meissner/d10v
-		basic_machine=$basic_machine-unknown
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
-	i[3456]86)
+	i*86 | x86_64)
 	  basic_machine=$basic_machine-pc
 	  ;;
 	# Object if more than one company name word.
@@ -221,40 +299,71 @@ case $basic_machine in
 		exit 1
 		;;
 	# Recognize the basic CPU types with company name.
-	vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
-	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
-	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
-	      | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
-	      | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
-	      | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
-	      | xps100-* | clipper-* | orion-* \
-	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-	      | sparc64-* | mips64-* | mipsel-* \
-	      | mips64el-* | mips64orion-* | mips64orionel-* \
-	      | mipstx39-* | mipstx39el-* \
-	      | f301-*)
-		;;
-	m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
-		;;
-	thumb-*) # CYGNUS LOCAL angela/thumb
-		;;
-	v850-*) # CYGNUS LOCAL
-	        ;;
-	mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
-		;;
-	mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
-		;;
-	mips16-*) # CYGNUS LOCAL krk/mips16
-		;;
-	tic30-*) # CYGNUS LOCAL ian/tic30
-		;;
-	c30-*) # CYGNUS LOCAL ian/tic30
-		basic_machine=tic30-unknown
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| ms1-* \
+	| msp430-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	m32c-*)
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)						# CYGNUS LOCAL
+	386bsd)
 		basic_machine=i386-unknown
 		os=-bsd
 		;;
@@ -264,11 +373,14 @@ case $basic_machine in
 	3b*)
 		basic_machine=we32k-att
 		;;
-	a29khif)					# CYGNUS LOCAL
+	a29khif)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-	adobe68k)					# CYGNUS LOCAL
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
 		;;
@@ -282,26 +394,32 @@ case $basic_machine in
 		basic_machine=a29k-none
 		os=-bsd
 		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	amdahl)
 		basic_machine=580-amdahl
 		os=-sysv
 		;;
 	amiga | amiga-*)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		;;
-	amigados)
-		basic_machine=m68k-cbm
-		os=-amigados
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
 		;;
 	amigaunix | amix)
-		basic_machine=m68k-cbm
+		basic_machine=m68k-unknown
 		os=-sysv4
 		;;
 	apollo68)
 		basic_machine=m68k-apollo
 		os=-sysv
 		;;
-	apollo68bsd)					# CYGNUS LOCAL
+	apollo68bsd)
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
@@ -313,6 +431,10 @@ case $basic_machine in
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -333,27 +455,45 @@ case $basic_machine in
 		basic_machine=c38-convex
 		os=-bsd
 		;;
-	cray | ymp)
-		basic_machine=ymp-cray
+	cray | j90)
+		basic_machine=j90-cray
 		os=-unicos
 		;;
-	cray2)
-		basic_machine=cray2-cray
-		os=-unicos
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
 		;;
-	[ctj]90-cray)
-		basic_machine=c90-cray
-		os=-unicos
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
 		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
 		basic_machine=mips-dec
 		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
 	delta | 3300 | motorola-3300 | motorola-delta \
 	      | 3300-motorola | delta-motorola)
 		basic_machine=m68k-motorola
@@ -362,6 +502,10 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
 	dpx20 | dpx20-*)
 		basic_machine=rs6000-bull
 		os=-bosx
@@ -381,7 +525,7 @@ case $basic_machine in
 	encore | umax | mmax)
 		basic_machine=ns32k-encore
 		;;
-	es1800 | OSE68k | ose68k | ose | OSE)		# CYGNUS LOCAL
+	es1800 | OSE68k | ose68k | ose | OSE)
 		basic_machine=m68k-ericsson
 		os=-ose
 		;;
@@ -395,6 +539,10 @@ case $basic_machine in
 		basic_machine=tron-gmicro
 		os=-sysv
 		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
 	h3050r* | hiux*)
 		basic_machine=hppa1.1-hitachi
 		os=-hiuxwe2
@@ -403,11 +551,11 @@ case $basic_machine in
 		basic_machine=h8300-hitachi
 		os=-hms
 		;;
-	h8300xray)					# CYGNUS LOCAL
+	h8300xray)
 		basic_machine=h8300-hitachi
 		os=-xray
 		;;
-	h8500hms)					# CYGNUS LOCAL
+	h8500hms)
 		basic_machine=h8500-hitachi
 		os=-hms
 		;;
@@ -426,44 +574,30 @@ case $basic_machine in
 		basic_machine=m68k-hp
 		os=-hpux
 		;;
-        w89k-*)						# CYGNUS LOCAL
-                basic_machine=hppa1.1-winbond
-                os=-proelf
-                ;;
-        op50n-*)					# CYGNUS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        op60c-*)					# CYGNUS LOCAL
-                basic_machine=hppa1.1-oki
-                os=-proelf
-                ;;
-        hppro)						# CYGNUS LOCAL
-                basic_machine=hppa1.1-hp
-                os=-proelf
-                ;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
 	hp9k2[0-9][0-9] | hp9k31[0-9])
 		basic_machine=m68000-hp
 		;;
 	hp9k3[2-9][0-9])
 		basic_machine=m68k-hp
 		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9] )
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9] )
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k78[0-9] | hp78[0-9] )
+	hp9k78[0-9] | hp78[0-9])
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
-	hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
 		# FIXME: really hppa2.0-hp
 		basic_machine=hppa1.1-hp
 		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679] )
+	hp9k8[0-9][13679] | hp8[0-9][13679])
 		basic_machine=hppa1.1-hp
 		;;
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -472,47 +606,42 @@ case $basic_machine in
 	hppa-next)
 		os=-nextstep3
 		;;
-	hppaosf)					# CYGNUS LOCAL
+	hppaosf)
 		basic_machine=hppa1.1-hp
 		os=-osf
 		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
-		os=-mvs
 		;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-	i[3456]86v32)
+	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
 		;;
-	i[3456]86v4*)
+	i*86v4*)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv4
 		;;
-	i[3456]86v)
+	i*86v)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv
 		;;
-	i[3456]86sol2)
+	i*86sol2)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-solaris2
 		;;
-	i386mach)					# CYGNUS LOCAL
+	i386mach)
 		basic_machine=i386-mach
 		os=-mach
 		;;
-	i386-vsta | vsta)				# CYGNUS LOCAL
+	i386-vsta | vsta)
 		basic_machine=i386-unknown
 		os=-vsta
 		;;
-	i386-go32 | go32)				# CYGNUS LOCAL
-		basic_machine=i386-unknown
-		os=-go32
-		;;
-	i386-mingw32 | mingw32)
-		basic_machine=i386-unknown
-		os=-mingw32
-		;;
 	iris | iris4d)
 		basic_machine=mips-sgi
 		case $os in
@@ -538,16 +667,16 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
-	mipsel*-linux*)
-		basic_machine=mipsel-unknown
-		os=-linux-gnu
-		;;
-	mips*-linux*)
-		basic_machine=mips-unknown
-		os=-linux-gnu
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
 		;;
 	mips3*-*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
@@ -555,22 +684,34 @@ case $basic_machine in
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
-	monitor)					# CYGNUS LOCAL
+	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
-	msdos)						# CYGNUS LOCAL
-		basic_machine=i386-unknown	
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
 		os=-msdos
 		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
 		;;
 	netbsd386)
-		basic_machine=i386-unknown		# CYGNUS LOCAL
+		basic_machine=i386-unknown
 		os=-netbsd
 		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
 	news | news700 | news800 | news900)
 		basic_machine=m68k-sony
 		os=-newsos
@@ -583,7 +724,7 @@ case $basic_machine in
 		basic_machine=mips-sony
 		os=-newsos
 		;;
-	necv70)						# CYGNUS LOCAL
+	necv70)
 		basic_machine=v70-nec
 		os=-sysv
 		;;
@@ -612,18 +753,36 @@ case $basic_machine in
 		basic_machine=i960-intel
 		os=-nindy
 		;;
-	mon960)						# CYGNUS LOCAL
+	mon960)
 		basic_machine=i960-intel
 		os=-mon960
 		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
 	np1)
 		basic_machine=np1-gould
 		;;
-	OSE68000 | ose68000)				# CYGNUS LOCAL
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
 		os=-ose
 		;;
-	os68k)						# CYGNUS LOCAL
+	os68k)
 		basic_machine=m68k-none
 		os=-os68k
 		;;
@@ -641,48 +800,66 @@ case $basic_machine in
 	pbb)
 		basic_machine=m68k-tti
 		;;
-        pc532 | pc532-*)
+	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
-	pentium | p5)
-		basic_machine=i586-intel
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
 		;;
-	pentiumpro | p6)
-		basic_machine=i686-intel
+	pentium4)
+		basic_machine=i786-pc
 		;;
-	pentium-* | p5-*)
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	pentiumpro-* | p6-*)
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	k5)
-		# We don't have specific support for AMD's K5 yet, so just call it a Pentium
-		basic_machine=i586-amd
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	nexen)
-		# We don't have specific support for Nexgen yet, so just call it a Pentium
-		basic_machine=i586-nexgen
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	pn)
 		basic_machine=pn-gould
 		;;
-	power)	basic_machine=rs6000-ibm
+	power)	basic_machine=power-ibm
 		;;
 	ppc)	basic_machine=powerpc-unknown
-	        ;;
+		;;
 	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
-	        ;;
+		;;
 	ppcle-* | powerpclittle-*)
 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	ps2)
 		basic_machine=i386-ibm
 		;;
-	rom68k)						# CYGNUS LOCAL
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
 		;;
@@ -692,10 +869,26 @@ case $basic_machine in
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
-	sa29200)					# CYGNUS LOCAL
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
 		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
 	sequent)
 		basic_machine=i386-sequent
 		;;
@@ -703,7 +896,10 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
-	sparclite-wrs)					# CYGNUS LOCAL
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
 		basic_machine=sparclite-wrs
 		os=-vxworks
 		;;
@@ -714,10 +910,10 @@ case $basic_machine in
 	spur)
 		basic_machine=spur-unknown
 		;;
-	st2000)						# CYGNUS LOCAL
+	st2000)
 		basic_machine=m68k-tandem
 		;;
-	stratus)					# CYGNUS LOCAL
+	stratus)
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
@@ -761,19 +957,51 @@ case $basic_machine in
 	sun386 | sun386i | roadrunner)
 		basic_machine=i386-sun
 		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
 	symmetry)
 		basic_machine=i386-sequent
 		os=-dynix
 		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
 	tx39el)
 		basic_machine=mipstx39el-unknown
 		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
 	udi29k)
 		basic_machine=a29k-amd
 		os=-udi
@@ -782,7 +1010,7 @@ case $basic_machine in
 		basic_machine=a29k-nyu
 		os=-sym1
 		;;
-	v810 | necv810)					# CYGNUS LOCAL
+	v810 | necv810)
 		basic_machine=v810-nec
 		os=-none
 		;;
@@ -795,8 +1023,8 @@ case $basic_machine in
 		os=-vms
 		;;
 	vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
+		basic_machine=f301-fujitsu
+		;;
 	vxworks960)
 		basic_machine=i960-wrs
 		os=-vxworks
@@ -809,18 +1037,26 @@ case $basic_machine in
 		basic_machine=a29k-wrs
 		os=-vxworks
 		;;
-	w65*)						# CYGNUS LOCAL
- 		basic_machine=w65-wdc
- 		os=-none
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
 		;;
-	xmp)
-		basic_machine=xmp-cray
-		os=-unicos
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
 		;;
-        xps | xps100)
+	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
-	z8k-*-coff)					# CYGNUS LOCAL
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
@@ -831,41 +1067,44 @@ case $basic_machine in
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
 # some cases the only manufacturer, in others, it is the most popular.
-	w89k)						# CYGNUS LOCAL
+	w89k)
 		basic_machine=hppa1.1-winbond
 		;;
-	op50n)						# CYGNUS LOCAL
+	op50n)
 		basic_machine=hppa1.1-oki
 		;;
-	op60c)						# CYGNUS LOCAL
+	op60c)
 		basic_machine=hppa1.1-oki
 		;;
-	mips)
-		if [ x$os = x-linux-gnu ]; then
-			basic_machine=mips-unknown
-		else
-			basic_machine=mips-mips
-		fi
-		;;
 	romp)
 		basic_machine=romp-ibm
 		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
 	rs6000)
 		basic_machine=rs6000-ibm
 		;;
 	vax)
 		basic_machine=vax-dec
 		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
 	pdp11)
 		basic_machine=pdp11-dec
 		;;
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sparc)
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
-        cydra)
+	cydra)
 		basic_machine=cydra-cydrome
 		;;
 	orion)
@@ -874,12 +1113,15 @@ case $basic_machine in
 	orion105)
 		basic_machine=clipper-highlevel
 		;;
-	mac | mpw | mac-mpw)				# CYGNUS LOCAL
+	mac | mpw | mac-mpw)
 		basic_machine=m68k-apple
 		;;
-	pmac | pmac-mpw)				# CYGNUS LOCAL
+	pmac | pmac-mpw)
 		basic_machine=powerpc-apple
 		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
 	*)
 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 		exit 1
@@ -912,9 +1154,12 @@ case $os in
 	-solaris)
 		os=-solaris2
 		;;
-	-unixware* | svr4*)
+	-svr4*)
 		os=-sysv4
 		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
 	-gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
@@ -925,26 +1170,51 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-	      | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv*)
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	# CYGNUS LOCAL
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
-	      | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
-	# END CYGNUS LOCAL
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -954,6 +1224,15 @@ case $os in
 	-sunos6*)
 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
 		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
 	-osfrose*)
 		os=-osfrose
 		;;
@@ -969,14 +1248,26 @@ case $os in
 	-acis*)
 		os=-aos
 		;;
-	-386bsd)					# CYGNUS LOCAL
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
 		os=-bsd
 		;;
 	-ctix* | -uts*)
 		os=-sysv
 		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
 	-ns2 )
-	        os=-nextstep2
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
 		;;
 	# Preserve the version number of sinix5.
 	-sinix5.*)
@@ -985,6 +1276,9 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
+        -tpf*)
+		os=-tpf
+		;;
 	-triton*)
 		os=-sysv3
 		;;
@@ -1003,15 +1297,27 @@ case $os in
 	# This must come after -sysvr4.
 	-sysv*)
 		;;
-	-ose*)						# CYGNUS LOCAL
+	-ose*)
 		os=-ose
 		;;
-	-es1800*)					# CYGNUS LOCAL
+	-es1800*)
 		os=-ose
 		;;
 	-xenix)
 		os=-xenix
 		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
 	-none)
 		;;
 	*)
@@ -1037,10 +1343,20 @@ case $basic_machine in
 	*-acorn)
 		os=-riscix1.2
 		;;
+	arm*-rebel)
+		os=-linux
+		;;
 	arm*-semi)
 		os=-aout
 		;;
-        pdp11-*)
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
 		os=-none
 		;;
 	*-dec | vax-*)
@@ -1058,34 +1374,43 @@ case $basic_machine in
 		# default.
 		# os=-sunos4
 		;;
-	m68*-cisco)					# CYGNUS LOCAL
+	m68*-cisco)
 		os=-aout
 		;;
-	mips*-cisco)					# CYGNUS LOCAL
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
 		os=-elf
 		;;
-        mips*-*)                                        # CYGNUS LOCAL
-                os=-elf
-                ;;
+	or32-*)
+		os=-coff
+		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
 		os=-sysv3
 		;;
 	sparc-* | *-sun)
 		os=-sunos4.1.1
 		;;
-	*-be)						# CYGNUS LOCAL
+	*-be)
 		os=-beos
 		;;
+	*-haiku)
+		os=-haiku
+		;;
 	*-ibm)
 		os=-aix
 		;;
-	*-wec)						# CYGNUS LOCAL
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
 		os=-proelf
 		;;
-	*-winbond)					# CYGNUS LOCAL
+	*-winbond)
 		os=-proelf
 		;;
-	*-oki)						# CYGNUS LOCAL
+	*-oki)
 		os=-proelf
 		;;
 	*-hp)
@@ -1098,7 +1423,7 @@ case $basic_machine in
 		os=-sysv
 		;;
 	*-cbm)
-		os=-amigados
+		os=-amigaos
 		;;
 	*-dg)
 		os=-dgux
@@ -1130,36 +1455,39 @@ case $basic_machine in
 	*-next)
 		os=-nextstep3
 		;;
-        *-gould)
+	*-gould)
 		os=-sysv
 		;;
-        *-highlevel)
+	*-highlevel)
 		os=-bsd
 		;;
 	*-encore)
 		os=-bsd
 		;;
-        *-sgi)
+	*-sgi)
 		os=-irix
 		;;
-        *-siemens)
+	*-siemens)
 		os=-sysv4
 		;;
 	*-masscomp)
 		os=-rtu
 		;;
-	f301-fujitsu)
+	f30[01]-fujitsu | f700-fujitsu)
 		os=-uxpv
 		;;
-	*-rom68k)					# CYGNUS LOCAL
+	*-rom68k)
 		os=-coff
 		;;
-	*-*bug)						# CYGNUS LOCAL
+	*-*bug)
 		os=-coff
 		;;
-	*-apple)					# CYGNUS LOCAL
+	*-apple)
 		os=-macos
 		;;
+	*-atari*)
+		os=-mint
+		;;
 	*)
 		os=-none
 		;;
@@ -1181,12 +1509,15 @@ case $basic_machine in
 			-aix*)
 				vendor=ibm
 				;;
-			-beos*)						# CYGNUS LOCAL
+			-beos*)
 				vendor=be
 				;;
 			-hpux*)
 				vendor=hp
 				;;
+			-mpeix*)
+				vendor=hp
+				;;
 			-hiux*)
 				vendor=hitachi
 				;;
@@ -1202,27 +1533,47 @@ case $basic_machine in
 			-genix*)
 				vendor=ns
 				;;
-			-mvs*)
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
 				vendor=ibm
 				;;
 			-ptx*)
 				vendor=sequent
 				;;
-			-vxsim* | -vxworks*)
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
 			-aux*)
 				vendor=apple
 				;;
-			-hms*)				# CYGNUS LOCAL
+			-hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)		# CYGNUS LOCAL
+			-mpw* | -macos*)
 				vendor=apple
 				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
 		esac
 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
 echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/mh-amigaos b/config/mh-amigaos
new file mode 100755
index 0000000..4889ea4
--- /dev/null
+++ binutils-2.9.1/config/mh-amigaos
@@ -0,0 +1,13 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+CFLAGS = -g -O2 -mstackextend
+
+# We have both types of links under AmigaOS with GNU
+# utils, however the links need to be made in canonical
+# AmigaOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
diff --git a/config/mh-cxux b/config/mh-cxux
index 54b2a16..15a2db5 100644
--- binutils-2.9.1.orig/config/mh-cxux
+++ binutils-2.9.1/config/mh-cxux
@@ -8,7 +8,7 @@ RANLIB = true
 CXXFLAGS=-O
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
+ARFLAGS = cq
 
 # Under CX/UX, we want to tell the compiler to use ANSI mode.
 CC=cc -Xa
diff --git a/config/mh-morphos b/config/mh-morphos
new file mode 100755
index 0000000..1572ef6
--- /dev/null
+++ binutils-2.9.1/config/mh-morphos
@@ -0,0 +1,13 @@
+# Host makefile fragment for MorphOS.
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+CFLAGS = -g -O2 
+
+# We have both types of links under MorphOS with GNU
+# utils, however the links need to be made in canonical
+# MorphOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
diff --git a/config/mh-ncr3000 b/config/mh-ncr3000
index 5bbd803..94b5632 100644
--- binutils-2.9.1.orig/config/mh-ncr3000
+++ binutils-2.9.1/config/mh-ncr3000
@@ -14,4 +14,4 @@ SYSV = -DSYSV -DSVR4
 RANLIB = true
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
+ARFLAGS = cq
diff --git a/config/mh-sysv4 b/config/mh-sysv4
index 8106651..18e8591 100644
--- binutils-2.9.1.orig/config/mh-sysv4
+++ binutils-2.9.1/config/mh-sysv4
@@ -6,6 +6,6 @@ RANLIB = true
 CXXFLAGS=-O
 
 # The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cr
+ARFLAGS = cr
 
 X11_EXTRA_LIBS = -lnsl
diff --git a/config/mpw-mh-mpw b/config/mpw-mh-mpw
index 543ef4f..3e6c139 100644
--- binutils-2.9.1.orig/config/mpw-mh-mpw
+++ binutils-2.9.1/config/mpw-mh-mpw
@@ -55,7 +55,7 @@ AR_MWLINKPPC = MWLinkPPC -xm library
 
 AR_AR = ar
 
-AR_FLAGS = -o
+ARFLAGS = -o
 
 RANLIB_NULL = null-command
 
diff --git a/config/mpw/g-mpw-make.sed b/config/mpw/g-mpw-make.sed
index e7d3c77..f3311a0 100644
--- binutils-2.9.1.orig/config/mpw/g-mpw-make.sed
+++ binutils-2.9.1/config/mpw/g-mpw-make.sed
@@ -52,7 +52,7 @@
 /CC/s/^CC *=/#CC =/
 /CFLAGS/s/^CFLAGS *=/#CFLAGS =/
 /AR/s/^AR *=/#AR =/
-/AR_FLAGS/s/^AR_FLAGS *=/#AR_FLAGS =/
+/ARFLAGS/s/^ARFLAGS *=/#ARFLAGS =/
 /RANLIB/s/^RANLIB *=/#RANLIB =/
 /CC_LD/s/^CC_LD *=/#CC_LD =/
 /LDFLAGS/s/^LDFLAGS *=/#LDFLAGS =/
diff --git a/configall b/configall
new file mode 100644
index 0000000..045137c
--- /dev/null
+++ binutils-2.9.1/configall
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+mkdir -p build
+
+cd build
+
+if [ "`uname`" = "MorphOS" ]
+then
+  CC=gcc CFLAGS="-mresident32 -mcpu=604e -mmultiple" ../configure --target=ppc-morphos --prefix=/gg
+  MYCFLAGS="-mresident32 -mmultiple -mcpu=604e"
+else
+  ../configure --target=ppc-morphos --prefix=/gg
+fi
+
+if [ ! -f Makefile.orig ]; then
+	mv Makefile Makefile.orig
+fi
+
+sed -e "s/srcdir = ./srcdir = ../ ; \
+	s/@AR@/ar/ ; \
+	s/@RANLIB@/ranlib/ ; \
+	s/@ARFLAGS@/rc/ ; \
+	s/@CC@/gcc/ ; \
+	s/@prefix@/\/gg/ ; \
+	s/CFLAGS = -g/CFLAGS = $MYCFLAGS/" Makefile.orig >Makefile
+
+if [ ! -f libiberty/Makefile.orig ]; then
+	mv libiberty/Makefile libiberty/Makefile.orig
+fi
+
+sed -e "s/srcdir = ./srcdir = ..\/..\/libiberty/ ; \
+	s/@AR@/ar/ ; \
+	s/@RANLIB@/ranlib/ ; \
+	s/@ARFLAGS@/rc/ ; \
+	s/@CC@/gcc/ ; \
+	s/@prefix@/\/gg/ ; \
+	s/CFLAGS = -g/CFLAGS = $MYCFLAGS/" libiberty/Makefile.orig >libiberty/Makefile
+
diff --git a/configure b/configure
index b2aa5b2..42d5761 100755
--- binutils-2.9.1.orig/configure
+++ binutils-2.9.1/configure
@@ -51,12 +51,15 @@ build_alias=
 cache_file=config.cache
 cache_file_option=
 configdirs=
+extraconfigdirs=
 diroptions=
 exec_prefix=
 exec_prefixoption=
 fatal=
 floating_point=default
 gas=default
+gcc_version=
+gcc_version_trigger=
 host_alias=NOHOST
 host_makefile_frag=
 moveifchange=
@@ -83,7 +86,7 @@ subdirs=
 target_alias=NOTARGET
 target_makefile_frag=
 undefs=NOUNDEFS
-version="$Revision: 1.260.2.1 $"
+version="$Revision: 1.1.1.1 $"
 x11=default
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
@@ -515,6 +518,8 @@ fi
 
 configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
+topsrcdir=`cd \`dirname ${progname}\`; pwd`
+
 
 # this is a hack.  sun4 must always be a valid host alias or this will fail.
 if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then
@@ -571,13 +576,34 @@ case "${srcdir}" in
         fi
 esac
 
-
 # default exec_prefix
 case "${exec_prefixoption}" in
 "") exec_prefix="\$(prefix)" ;;
 *) ;;
 esac
 
+# Define the trigger file to make sure configure will re-run whenever
+# the gcc version number changes.
+if [ "${with_gcc_version_trigger+set}" = set ]; then
+    gcc_version_trigger="$with_gcc_version_trigger"
+    gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${with_gcc_version_trigger}`
+else
+    # If gcc's sources are available, define the trigger file.
+    if [ -f ${topsrcdir}/gcc/version.c ] ; then
+	gcc_version_trigger=${topsrcdir}/gcc/version.c
+	gcc_version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < ${gcc_version_trigger}`
+	case "$arguments" in
+	  *--with-gcc-version-trigger=$gcc_version_trigger* )
+	    ;;
+	  * )
+	    # Make sure configure.in knows about this.
+	    arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments"
+	    ;;
+	esac
+	withoptions="--with-gcc-version-trigger=$gcc_version_trigger $withoptions"
+    fi
+fi
+
 ### break up ${srcdir}/configure.in.
 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
 "")
@@ -651,8 +677,24 @@ fi
 
 ### do common part of configure.in
 
+# If the language specific compiler does not exist, but the "gcc" directory does,
+# we will skip this directory; in this case the sub-directory's common part
+# of configure.in will create a small shell script "skip-this-dir" containing
+# commands to completely clean up any temporary or created files.
+
 . ${tmpfile}.com
 
+if test -f skip-this-dir; then
+	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
+	# and reset the trap handler.
+	trap 0
+	rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
+	# Execute the final clean-up actions
+	${config_shell} skip-this-dir
+	# and stop configuring this directory.
+	exit 0
+fi
+
 # some sanity checks on configure.in
 case "${srctrigger}" in
 "")
@@ -762,7 +804,7 @@ fi
 # If CC and CXX are not set in the environment, and the Makefile
 # exists, try to extract them from it.  This is to handle running
 # ./config.status by hand.
-if [ -z "${CC}" -a -r Makefile ]; then
+if [ -z "${CC}" ] && [ -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
 s/\\\n//g
@@ -772,7 +814,7 @@ t loop
   rm -f Makefile.cc
 fi
 
-if [ -z "${CFLAGS}" -a -r Makefile ]; then
+if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
 s/\\\n//g
@@ -782,7 +824,7 @@ t loop
   rm -f Makefile.cc
 fi
 
-if [ -z "${CXX}" -a -r Makefile ]; then
+if [ -z "${CXX}" ] && [ -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
 s/\\\n//g
@@ -792,7 +834,7 @@ t loop
   rm -f Makefile.cc
 fi
 
-if [ -z "${CXXFLAGS}" -a -r Makefile ]; then
+if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
 s/\\\n//g
@@ -821,6 +863,25 @@ do
   test -n "$DEFAULT_YACC" && break
 done
 
+# Generate a default definition for M4.  This is used if the makefile can't
+# locate m4 in objdir.
+
+for prog in gm4 gnum4 m4
+do
+  set dummy $prog; tmp=$2
+  IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
+  for dir in $PATH; do
+    test -z "$dir" && dir=.
+    if test -f $dir/$tmp; then
+      DEFAULT_M4="$prog"
+      break
+    fi
+  done
+  IFS="$save_ifs"
+
+  test -n "$DEFAULT_M4" && break
+done
+
 # Generate a default definition for LEX.  This is used if the makefile can't
 # locate flex in objdir.
 
@@ -852,7 +913,7 @@ if [ "${build}" != "${host}" ]; then
   tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
 
   for var in ${tools}; do
-    if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then
+    if [ -z "`eval 'echo $'"${var}"`" ] && [ -r Makefile ]; then
       sed -n -e ':loop
 /\\$/ N
 s/\\\n//g
@@ -954,10 +1015,10 @@ else
 	echo 'void f(){}' > conftest.c
 	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
 	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
 	else
 	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CXXFLAGS-"-O2"}
 	fi
 	rm -f conftest*
 	break
@@ -965,6 +1026,24 @@ else
     done
     IFS="$save_ifs"
     CC=${CC-cc}
+  else
+    if test -z "${CFLAGS}"; then
+      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
+      # is set to a version of gcc.
+      case "${CC}" in
+      *gcc)
+	echo 'void f(){}' > conftest.c
+	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
+	  CFLAGS=${CFLAGS-"-g -O2"}
+	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+	else
+	  CFLAGS=${CFLAGS-"-O2"}
+	  CXXFLAGS=${CXXFLAGS-"-O2"}
+	fi
+	rm -f conftest*
+	;;
+      esac
+    fi
   fi
 
   CXX=${CXX-"c++"}
@@ -983,12 +1062,14 @@ case "$host" in
 	    enable_gdbtk=no ;;
 	*msdosdjgpp*)
 	    enable_gdbtk=no ;;
+	*cygwin32*)
+	    enable_gdbtk=no ;;
 esac
 
 # FIXME: This should be in configure.in, not configure
 # Determine whether gdb needs tk/tcl or not.
 if [ "$enable_gdbtk" != "no" ]; then
-	GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui"
+	GDB_TK="all-tcl all-tk all-itcl all-tix"
 else
 	GDB_TK=""
 fi
@@ -1050,27 +1131,34 @@ for subdir in . ${subdirs} ; do
                 set ${links}; link=$1; shift; links=$*
 
                 if [ ! -r ${srcdir}/${file} ] ; then
+                  if [ ! -r ${file} ] ; then
+
                         echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
                         echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
                         exit 1
+		  else
+			srcfile=${file}
+		  fi
+		else
+			srcfile=${srcdir}/${file}
                 fi
 
                 ${remove} -f ${link}
 		# Make a symlink if possible, otherwise try a hard link
-		if ${symbolic_link} ${srcdir}/${file} ${link} >/dev/null 2>&1 ; then
+		if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then
 			true
 		else
 			# We need to re-remove the file because Lynx leaves a 
 			# very strange directory there when it fails an NFS symlink.
 			${remove} -r -f ${link}
-			${hard_link} ${srcdir}/${file} ${link}
+			${hard_link} ${srcfile} ${link}
 		fi
                 if [ ! -r ${link} ] ; then
-                        echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
+                        echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2
                         exit 1
                 fi
 
-                echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
+                echo "Linked \"${link}\" to \"${srcfile}\"."
         done
 
         # Create a .gdbinit file which runs the one in srcdir
@@ -1243,14 +1331,24 @@ EOF
                 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
             fi 
 
-	    # provide a proper gxx_include_dir to all subdirs.
-	    # Note, if you change the default, make sure to fix both here
-	    # and in the gcc subdirectory.
-	    if test -z "${with_gxx_include_dir}"; then
-		echo gxx_include_dir = '${prefix}/include/g++' >> ${Makefile}
+	    # record if we want to build shared libs.
+	    if test -z "${enable_shared}"; then
+		echo enable_shared = no >> ${Makefile}
 	    else
-		echo gxx_include_dir = ${with_gxx_include_dir} >> ${Makefile}
+		echo enable_shared = ${enable_shared} >> ${Makefile}
 	    fi
+	    # record if we want to rumtime library stuff installed in libsubdir.
+	    if test -z "${enable_version_specific_runtime_libs}"; then
+		echo enable_version_specific_runtime_libs = no >> ${Makefile}
+	    else
+		echo enable_version_specific_runtime_libs = ${enable_version_specific_runtime_libs} >> ${Makefile}
+	    fi
+
+	    # Emit a macro which describes the file containing gcc's
+	    # version number.
+	    echo gcc_version_trigger = ${gcc_version_trigger} >> ${Makefile}
+	    # And emit a macro defining gcc's version number.
+	    echo gcc_version = ${gcc_version} >> ${Makefile}
 
             # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
             # remove any form feeds.
@@ -1305,6 +1403,7 @@ EOF
 			s%^CXXFLAGS[ 	]*=.*$%CXXFLAGS = ${CXXFLAGS}%
 			}" \
 		    -e "s|^SHELL[	 ]*=.*$|SHELL = ${config_shell}|" \
+		    -e "s:^GDB_TK[	 ]*=.*$:GDB_TK = ${GDB_TK}:" \
                     -e "s|^srcdir[ 	]*=.*$|srcdir = ${makesrcdir}|" \
                     -e "s///" \
                     -e "s:^program_prefix[ 	]*=.*$:program_prefix = ${program_prefix}:" \
@@ -1313,9 +1412,8 @@ EOF
                     -e "s|^tooldir[ 	]*=.*$|tooldir = ${tooldir}|" \
 		    -e "s:^DEFAULT_YACC[	 ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
 		    -e "s:^DEFAULT_LEX[	 ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
+		    -e "s:^DEFAULT_M4[  ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \
                     ${subdir}/Makefile.tem >> ${Makefile}
-	    sed -e "s:^GDB_TK[	 ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem
-	    mv -f ${Makefile}.tem ${Makefile}
 
 	    # If this is a Canadian Cross, preset the values of many more
 	    # tools.
@@ -1398,19 +1496,33 @@ ${progname}" ${arguments}  "
 done
 
 # If there are subdirectories, then recur.
-if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then 
-        for configdir in ${configdirs} ; do
+if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then
+        for configdir in ${configdirs} ${extraconfigdirs} ; do
+
+		# If configdir contains ',' it is
+		# srcdir,builddir,target_alias
+		# These come from extraconfigdirs.
+		case ${configdir} in
+		*,*)
+		    eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'`
+		    ;;
+		*)
+		    cfg_dir=${configdir}
+		    bld_dir=${configdir}
+		    tgt_alias=${target_alias}
+		    ;;
+		esac
 
-                if [ -d ${srcdir}/${configdir} ] ; then
+                if [ -d ${srcdir}/${cfg_dir} ] ; then
                         eval echo Configuring ${configdir}... ${redirect}
                         case "${srcdir}" in
                         ".") ;;
                         *)
-                                if [ ! -d ./${configdir} ] ; then
-                                        if mkdir ./${configdir} ; then
+                                if [ ! -d ./${bld_dir} ] ; then
+                                        if mkdir ./${bld_dir} ; then
                                                 true
                                         else
-                                                echo '***' "${progname}: could not make ${PWD=`pwd`}/${configdir}" 1>&2
+                                                echo '***' "${progname}: could not make ${PWD=`pwd`}/${bld_dir}" 1>&2
                                                 exit 1
                                         fi
                                 fi
@@ -1418,21 +1530,21 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
                         esac
 
                         POPDIR=${PWD=`pwd`}
-                        cd ${configdir} 
+                        cd ${bld_dir}
 
 ### figure out what to do with srcdir
                         case "${srcdir}" in
                         ".") newsrcdir=${srcdir} ;; # no -srcdir option.  We're building in place.
                         /*) # absolute path
-                                newsrcdir=${srcdir}/${configdir}
+                                newsrcdir=${srcdir}/${cfg_dir}
                                 srcdiroption="--srcdir=${newsrcdir}"
                                 ;;
                         ?:*) # absolute path on win32
-                                newsrcdir=${srcdir}/${configdir}
+                                newsrcdir=${srcdir}/${cfg_dir}
                                 srcdiroption="--srcdir=${newsrcdir}"
                                 ;;
                         *) # otherwise relative
-                                newsrcdir=../${srcdir}/${configdir}
+                                newsrcdir=../${srcdir}/${cfg_dir}
                                 srcdiroption="--srcdir=${newsrcdir}"
                                 ;;
                         esac
@@ -1462,7 +1574,7 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
                                 *)      recprog=../${progname} ;;
                                 esac
 			else
-				eval echo No configuration information in ${configdir} ${redirect}
+				eval echo No configuration information in ${cfg_dir} ${redirect}
 				recprog=
                         fi
 
diff --git a/configure.in b/configure.in
index 5faaf02..aa1b5e8 100644
--- binutils-2.9.1.orig/configure.in
+++ binutils-2.9.1/configure.in
@@ -179,6 +179,12 @@ case "${host}" in
   i[3456]86-*-msdosdjgpp*)
     host_makefile_frag="${host_makefile_frag} config/mh-go32"
     ;;
+  *-*-amigaos*)
+    host_makefile_frag="${host_makefile_frag} config/mh-amigaos"
+    ;;
+  *-*-morphos*)
+    host_makefile_frag="${host_makefile_frag} config/mh-morphos"
+    ;;
   *-cygwin32*)
     host_makefile_frag="${host_makefile_frag} config/mh-cygwin32"
     ;;
diff --git a/dist-stmp b/dist-stmp
new file mode 100644
index 0000000..e69de29
diff --git a/etc/Makefile.in b/etc/Makefile.in
old mode 100755
new mode 100644
index c490082..f8ac78c
--- binutils-2.9.1.orig/etc/Makefile.in
+++ binutils-2.9.1/etc/Makefile.in
@@ -1,9 +1,9 @@
-# 
+#
 # Makefile.in for etc
 #
 
-prefix 		= @prefix@
-exec_prefix 	= @exec_prefix@
+prefix		= @prefix@
+exec_prefix	= @exec_prefix@
 
 srcdir  = @srcdir@
 VPATH	= @srcdir@
@@ -24,10 +24,11 @@ man7dir = $(mandir)/man7
 man8dir = $(mandir)/man8
 man9dir = $(mandir)/man9
 infodir = @infodir@
+guidedir = $(prefix)/guide
 
 SHELL = /bin/sh
 
-INSTALL 	= @INSTALL@
+INSTALL		= @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA    = @INSTALL_DATA@
 
@@ -41,11 +42,12 @@ TEXIDIR = $(srcdir)/../texinfo
 ###
 
 INFOFILES = standards.info
+GUIDEFILES = standards.guide
 DVIFILES = standards.dvi
 
-all:
+all: info #guide
 
-install:
+install: install-info #install-guide
 
 uninstall:
 
@@ -57,6 +59,14 @@ install-info: info
 	  $(INSTALL_DATA) $$i $(infodir)/$$i; \
 	done
 
+guide: $(GUIDEFILES)
+
+install-guide: guide
+	if test ! -f standards.guide; then cd $(srcdir); fi; \
+	for i in standards.guide; do \
+	  $(INSTALL_DATA) $$i $(guidedir)/$$i; \
+	done
+
 dvi: $(DVIFILES)
 
 standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
@@ -65,10 +75,14 @@ standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi
 standards.dvi: $(srcdir)/standards.texi
 	TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi
 
+standards.guide: $(srcdir)/standards.texi
+	$(MAKEINFO) -I$(srcdir) --amiga --no-split -o standards.guide $(srcdir)/standards.texi
+
 
 clean:
 	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
 	rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
+	rm -f *.guide
 
 mostlyclean: clean
 
diff --git a/etc/configure b/etc/configure
old mode 100644
new mode 100755
index 101fcef..7cddddc
--- binutils-2.9.1.orig/etc/configure
+++ binutils-2.9.1/etc/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -44,6 +44,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -161,6 +165,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -203,6 +211,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -333,7 +357,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -503,9 +527,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -546,21 +572,22 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:555: checking for a BSD compatible install" >&5
+echo "configure:582: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -599,6 +626,8 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
@@ -625,7 +654,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -665,6 +694,7 @@ fi
 
 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
+
 # Transform confdefs.h into DEFS.
 # Protect against shell expansion while executing Makefile rules.
 # Protect against Makefile macro expansion.
@@ -683,7 +713,9 @@ rm -f conftest.defs
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -704,7 +736,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -728,6 +760,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -745,8 +778,13 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 
 CEOF
@@ -857,6 +895,7 @@ cat >> $CONFIG_STATUS <<\EOF
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a7e46aa..d48e119 100644
--- binutils-2.9.1.orig/gas/ChangeLog
+++ binutils-2.9.1/gas/ChangeLog
@@ -1,3 +1,24 @@
+Sat Jun  6 23:06:18 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* config/tc-i386.c (md_section_align): Re-enable use of forced
+	section alignment based only on BFD_ASSEMBLER being defined.
+	* write.c (write_contents): Work around bug in BeOS memset.
+
+Thu Jun  4 22:18:50 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (i386-*-beos8): Set bfd_gas to yes.
+	* configure: Regenerated.
+	* read.c (output_leb128): Do not inline as it is used externally
+	for some configuration.s
+
+1998-06-02  David Zaroski  <zaroski@firewall.ninemoons.com>
+
+	* config/tc-m68k.c: Add missing param to add_fix in "case '_'"
+
+Thu Apr 30 13:09:39 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* read.c (sizeof_leb128): Referenced in write.c, so cannot be inlined.
+
 Mon Apr 27 13:45:04 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.in: Set version number to 2.9.1.
@@ -230,11 +251,21 @@ Sat Feb 21 22:36:52 1998  Richard Henderson  <rth@cygnus.com>
 	* read.c (s_set): Record file and line info for symbols when -as.
 	(pseudo_set): Don't overwrite that dummy fragment.
 
+Sat Feb 21 16:11:31 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* itbl-parse.c: Only use gcc's builtin alloca if C_ALLOCA
+	is not defined.  Only include <alloca.h> if C_ALLOCA is
+	not defined.
+
 Fri Feb 20 15:03:13 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* config/tc-ppc.c (md_pseudo_table): Add "section".
 	(ppc_named_section): New static function.
 
+Fri Feb 20 07:48:52 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* as.h (alloca.h): Only include if C_ALLOCA is not defined.
+
 Thu Feb 19 22:25:42 1998  Richard Henderson  <rth@cygnus.com>
 
 	* tc-ppc.c (ppc_biei): Cache the last symbol we inserted
@@ -781,6 +812,11 @@ Sun Nov 16 10:05:07 1997  Fred Fish  <fnf@cygnus.com>
 	* config/obj-coff.c (fixup_segment): Cast second arg of
 	md_apply_fix3 call to type "valueT *".
 
+Sat Nov 15 09:19:21 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (i386-*-beos*): Add x86 BeOS config.
+	* configure: Regenerated.
+
 Thu Nov 13 13:53:10 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
 	* configure.in (emulations): Make FreeBSD an aout / i386bsd
@@ -910,6 +946,14 @@ Thu Oct 30 13:46:20 1997  Nick Clifton  <nickc@cygnus.com>
 	* config/tc-arm.c (md_apply_fix3): Fix thumb ADR pseudo op.  Patch
 	from Tony Thompson at ARM: athompso@arm.com
 
+Tue Oct 28 09:05:21 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (BFDLIB,OPCODES_LIB): For BeOS hosts, directly
+ 	include libraries rather than using -L search paths.
+	* configure: Regenerated.
+	* config/tc-sh.c (sh_do_align): Cast second arg of frag_align_pattern
+	calls from "char *" to "const char *".
+
 Fri Oct 24 15:56:47 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* config/tc-ppc.c (md_assemble): When handling @l, always sign
@@ -961,6 +1005,17 @@ Tue Oct 21 10:20:11 1997  Doug Evans  <devans@canuck.cygnus.com>
 	* config/tc-sparc.c (md_apply_fix3, cases ..._H44, ..._HIX22): Leave
 	overflow signalling to linker.
 
+Mon Oct 20 21:42:55 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* config/tc-sh.c (insert): Add extra 0 arg for fix_new_exp call.
+	(md_assemble): Add extra 0 arg for fix_new call.
+	(sh_frob_label): Add extra 0 arg for fix_new call.
+	(sh_flush_pending_output): Add extra 0 arg for fix_new call.
+	(s_uses): Add extra 0 arg for fix_new_exp call.
+	(sh_frob_section): Add extra 0 arg for fix_new call.
+	(md_convert_frag): Add extra 0 arg for fix_new calls.
+	(sh_handle_align): Add extra 0 arg for fix_new call.
+
 Mon Oct 20 14:54:06 1997  Klaus K"ampf  <kkaempf@progis.de>
 
 	* makefile.vms: Fix for dec c.
@@ -973,6 +1028,12 @@ Mon Oct 20 14:54:06 1997  Klaus K"ampf  <kkaempf@progis.de>
 
 	* config/obj-evax.c: support .weak pseudo-op
 
+Mon Oct 20 11:12:29 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* doc/Makefile.in (AR, ARFLAGS): Remove, not used.
+	* Makefile (AR, ARFLAGS): Remove, not used.
+	(FLAGS_TO_PASS): Don't need to pass AR or ARFLAGS.
+	
 Mon Oct 20 10:13:32 1997  Doug Evans  <devans@canuck.cygnus.com>
 
 	* config/tc-sparc.c (default_arch_size): New static local.
@@ -1115,6 +1176,12 @@ Wed Oct  8 12:33:32 1997  Richard Henderson  <rth@cygnus.com>
 	recognizes alphaev5 etc.
 	* configure: Rebuild.
 
+Wed Oct  8 10:40:55 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* config/tc-i386.c (md_assemble): Add extra 0 arg for fix_new_exp calls.
+	(md_create_long_jump): Add extra 0 arg for fix_new calls.
+	(md_estimate_size_before_relax): Ditto.
+
 Wed Oct  8 00:04:05 1997  Gavin Koch  <gavin@cygnus.com>
 
 	* config/tc-mips.c (md_begin): Replace the TARGET_CPU value
@@ -1398,6 +1465,12 @@ Tue Aug 26 12:23:25 1997  Ian Lance Taylor  <ian@cygnus.com>
 	for a WORD_PREFIX_OPCODE, change it to ADDR_PREFIX_OPCODE if this
 	is jcxz or a loop instruction.
 
+Mon Aug 25 16:32:00 1997  Steffen Opel  <opel@rumms.uni-mannheim.de>
+
+	* Makefile.in (guide, install-guide, clean-guide): New targets 
+	for AmigaGuide documentation.
+	(install): Add install-info and install-guide.
+
 Mon Aug 25 16:04:14 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* config/tc-v850.c (pre_defined_registers): Add 'hp' as alias for
@@ -3396,6 +3469,13 @@ Fri Dec 27 11:42:29 1996  Ian Lance Taylor  <ian@cygnus.com>
 	* doc/as.texinfo (M): Mention explicitly that -M changes macro
 	handling.
 
+Sun Dec 22 10:45:58 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in: Add support for BeOS target.
+	* configure: Regenerate.
+	* config/tc-ppc.c (ppc_set_cpu): For BeOS set ppc_cpu
+	to PPC_OPCODE_PPC.
+
 Thu Dec 19 12:06:08 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* write.c (adjust_reloc_syms): If the fixup symbol has been
@@ -3749,6 +3829,12 @@ Mon Nov 18 15:22:28 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
 	instructions the user requested execute in parallel, can be
 	executed that way.
 
+Sun Nov 17 21:09:55 1996  Kamil Iskra  <iskra@student.uci.agh.edu.pl>
+
+	* config/tc-m68k.c (md_estimate_size_before_relax): Do not
+	output 'bsrl' instructions for external function calls when
+	compiling with '-m68020' or higher.
+
 Thu Nov 14 11:17:49 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
 
 	* config/tc-d10v.c (write_2_short): Fix bug that wouldn't
diff --git a/gas/Makefile.am b/gas/Makefile.am
index e645c2c..765b329 100644
--- binutils-2.9.1.orig/gas/Makefile.am
+++ binutils-2.9.1/gas/Makefile.am
@@ -63,6 +63,7 @@ CPU_TYPES = \
 # We deliberately omit som, since it does not work as a cross assembler.
 
 OBJ_FORMATS = \
+	amigahunk \
 	aout \
 	bout \
 	coff \
@@ -239,6 +240,7 @@ TARGET_CPU_HFILES = \
 # OBJ files in config
 
 OBJ_FORMAT_CFILES = \
+	config/obj-amigahunk.c \
 	config/obj-aout.c \
 	config/obj-bout.c \
 	config/obj-coff.c \
@@ -251,6 +253,7 @@ OBJ_FORMAT_CFILES = \
 	config/obj-vms.c
 
 OBJ_FORMAT_HFILES = \
+	config/obj-amigahunk.h \
 	config/obj-aout.h \
 	config/obj-bout.h \
 	config/obj-coff.h \
@@ -266,6 +269,7 @@ OBJ_FORMAT_HFILES = \
 
 TARG_ENV_HFILES = \
 	config/te-386bsd.h \
+	config/te-amiga.h \
 	config/te-aux.h \
 	config/te-delta.h \
 	config/te-delt88.h \
@@ -352,7 +356,7 @@ stamp-mk.com: vmsconf.sh Makefile
 EXTRA_DIST = make-gas.com
 
 DISTSTUFF = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c
-diststuff: $(DISTSTUFF) info
+diststuff: $(DISTSTUFF) info guide
 
 DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-opc.h
 
@@ -448,6 +452,8 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
 # We need all these explicit rules for the multi stuff.  Because of
 # these rules, we don't need one for OBJ_FORMAT_O.
 
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
+	$(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
 obj-aout.o : $(srcdir)/config/obj-aout.c
 	$(COMPILE) -c $(srcdir)/config/obj-aout.c
 obj-bout.o : $(srcdir)/config/obj-bout.c
@@ -964,6 +970,9 @@ TCDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
   $(INCDIR)/opcode/cgen.h
+TCDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
 TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
   subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
@@ -1213,6 +1222,9 @@ OBJDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+  $(INCDIR)/obstack.h
 OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/obstack.h
@@ -1436,6 +1448,8 @@ DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
 DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
+  $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
 DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
 DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 51eb930..d2e7ebe 100644
--- binutils-2.9.1.orig/gas/Makefile.in
+++ binutils-2.9.1/gas/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -144,6 +150,7 @@ CPU_TYPES = \
 # We deliberately omit som, since it does not work as a cross assembler.
 
 OBJ_FORMATS = \
+	amigahunk \
 	aout \
 	bout \
 	coff \
@@ -320,6 +327,7 @@ TARGET_CPU_HFILES = \
 # OBJ files in config
 
 OBJ_FORMAT_CFILES = \
+	config/obj-amigahunk.c \
 	config/obj-aout.c \
 	config/obj-bout.c \
 	config/obj-coff.c \
@@ -332,6 +340,7 @@ OBJ_FORMAT_CFILES = \
 	config/obj-vms.c
 
 OBJ_FORMAT_HFILES = \
+	config/obj-amigahunk.h \
 	config/obj-aout.h \
 	config/obj-bout.h \
 	config/obj-coff.h \
@@ -347,6 +356,7 @@ OBJ_FORMAT_HFILES = \
 
 TARG_ENV_HFILES = \
 	config/te-386bsd.h \
+	config/te-amiga.h \
 	config/te-aux.h \
 	config/te-delta.h \
 	config/te-delt88.h \
@@ -610,6 +620,9 @@ TCDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/symcat.h cgen-opc.h $(srcdir)/../opcodes/m32r-opc.h \
   $(INCDIR)/opcode/cgen.h
+TCDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
+  subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
 TCDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
   subsegs.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h
@@ -859,6 +872,9 @@ OBJDEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+OBJDEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h $(srcdir)/config/tc-m68k.h \
+  $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
+  $(INCDIR)/obstack.h
 OBJDEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/obstack.h
@@ -1082,6 +1098,8 @@ DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \
 DEP_m32r_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h
+DEP_m68k_amigaoshunk = $(srcdir)/config/obj-amigahunk.h \
+  $(srcdir)/config/tc-m68k.h $(BFDDIR)/libamiga.h $(INCDIR)/bfdlink.h
 DEP_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
 DEP_m68k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m68k.h \
@@ -1228,21 +1246,21 @@ acconfig.h acinclude.m4 aclocal.m4 config.in config/m68k-parse.c \
 configure configure.in gdbinit.in itbl-lex.c itbl-parse.c stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES)
 OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS)
 
-default: all
+all: all-recursive-am all-am
 
 .SUFFIXES:
 .SUFFIXES: .S .c .l .lo .o .s .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -1354,7 +1372,8 @@ itbl-parse.h: itbl-parse.c
 
 all-recursive install-data-recursive install-exec-recursive \
 installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+check-recursive installcheck-recursive info-recursive dvi-recursive \
+guide-recursive ps-recursive html-recursive:
 	@set fnord $(MAKEFLAGS); amf=$$2; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  target=`echo $@ | sed s/-recursive//`; \
@@ -1482,6 +1501,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: info-recursive
+guide: guide-recursive
+html: html-recursive
+ps: ps-recursive
 dvi: dvi-recursive
 check:
 	$(MAKE) check-recursive check-DEJAGNU
@@ -1505,8 +1527,6 @@ install: install-recursive install-exec-am
 
 uninstall: uninstall-recursive
 
-all: all-recursive-am all-am
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs: installdirs-recursive
@@ -1556,20 +1576,21 @@ maintainer-clean:  maintainer-clean-recursive maintainer-clean-am
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
 uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
 all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+guide-recursive html-recursive ps-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
 distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
-info dvi installcheck install-info all-recursive-am all-am \
-install-exec-am install-exec install-data install uninstall all \
+info guide html ps dvi installcheck install-info all-recursive-am \
+all-am install-exec-am install-exec install-data install uninstall all \
 installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
@@ -1579,7 +1600,7 @@ stamp-mk.com: vmsconf.sh Makefile
 	sh $(srcdir)/vmsconf.sh $(GENERIC_OBJS) > new-make.com
 	$(SHELL) $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
 	touch stamp-mk.com
-diststuff: $(DISTSTUFF) info
+diststuff: $(DISTSTUFF) info guide
 
 $(OBJS): @ALL_OBJ_DEPS@
 
@@ -1628,6 +1649,8 @@ ecoff.o : ecoff.c ecoff.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \
 # We need all these explicit rules for the multi stuff.  Because of
 # these rules, we don't need one for OBJ_FORMAT_O.
 
+obj-amigahunk.o : $(srcdir)/config/obj-amigahunk.c
+	$(COMPILE) -c $(srcdir)/config/obj-amigahunk.c
 obj-aout.o : $(srcdir)/config/obj-aout.c
 	$(COMPILE) -c $(srcdir)/config/obj-aout.c
 obj-bout.o : $(srcdir)/config/obj-bout.c
diff --git a/gas/as.c b/gas/as.c
index d7ed4b8..a16e776 100644
--- binutils-2.9.1.orig/gas/as.c
+++ binutils-2.9.1/gas/as.c
@@ -76,6 +76,9 @@ char *myname;			/* argv[0] */
 #ifdef BFD_ASSEMBLER
 segT reg_section, expr_section;
 segT text_section, data_section, bss_section;
+#ifdef TE_AMIGA
+segT data_chip_section, bss_chip_section;
+#endif
 #endif
 
 /* The default obstack chunk size.  If we set this to zero, the
@@ -924,6 +927,10 @@ perform_an_assembly_pass (argc, argv)
   text_section = subseg_new (TEXT_SECTION_NAME, 0);
   data_section = subseg_new (DATA_SECTION_NAME, 0);
   bss_section = subseg_new (BSS_SECTION_NAME, 0);
+#ifdef TE_AMIGA
+  data_chip_section = subseg_new (".data_chip", 0);
+  bss_chip_section = subseg_new (".bss_chip", 0);
+#endif
   /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
      to have relocs, otherwise we don't find out in time. */
   applicable = bfd_applicable_section_flags (stdoutput);
@@ -934,6 +941,12 @@ perform_an_assembly_pass (argc, argv)
   bfd_set_section_flags (stdoutput, data_section,
 			 applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
   bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC);
+#ifdef TE_AMIGA
+  bfd_set_section_flags (stdoutput, data_chip_section,
+			 applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC));
+  bfd_set_section_flags (stdoutput, bss_chip_section, applicable & SEC_ALLOC);
+#endif
+
   seg_info (bss_section)->bss = 1;
   subseg_new (BFD_ABS_SECTION_NAME, 0);
   subseg_new (BFD_UND_SECTION_NAME, 0);
diff --git a/gas/as.h b/gas/as.h
index 3f457e9..cd00d06 100644
--- binutils-2.9.1.orig/gas/as.h
+++ binutils-2.9.1/gas/as.h
@@ -51,7 +51,7 @@
 /* Force void* decl for hpux.  This is what Bison uses.  --KR 1995.08.16 */
 
 /* AIX requires this to be the first thing in the file.  */
-#ifdef __GNUC__
+#if defined __GNUC__ && !defined (C_ALLOCA)
 # ifndef alloca
 #  ifdef __STDC__
 extern void *alloca ();
@@ -60,7 +60,7 @@ extern char *alloca ();
 #  endif
 # endif
 #else
-# if HAVE_ALLOCA_H
+# if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #  include <alloca.h>
 # else
 #  ifdef _AIX
diff --git a/gas/config/amigaos.mh b/gas/config/amigaos.mh
new file mode 100644
index 0000000..d38d7bc
--- /dev/null
+++ binutils-2.9.1/gas/config/amigaos.mh
@@ -0,0 +1,13 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# There is no standard system compiler.  Assume use GNU C.
+CC = gcc
+# There is no support for -g yet.  But use -O instead.
+CFLAGS = -O
+# We have both types of links under AmigaOS with GNU
+# utils, however the links need to be made in canonical
+# AmigaOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
diff --git a/gas/config/m68k-parse.h b/gas/config/m68k-parse.h
index e131342..1c33db6 100644
--- binutils-2.9.1.orig/gas/config/m68k-parse.h
+++ binutils-2.9.1/gas/config/m68k-parse.h
@@ -225,6 +225,9 @@ struct m68k_exp
 
   /* The expression itself.  */
   expressionS exp;
+  
+  /* base-relative? */
+  short baserel;
 };
 
 /* The operand modes.  */
diff --git a/gas/config/m68k-parse.y b/gas/config/m68k-parse.y
index 1e18699..ae4a38f 100644
--- binutils-2.9.1.orig/gas/config/m68k-parse.y
+++ binutils-2.9.1/gas/config/m68k-parse.y
@@ -945,6 +945,7 @@ yylex ()
     }
 
   yylval.exp.size = SIZE_UNSPEC;
+  yylval.exp.baserel = 0;
   if (s <= str + 2
       || (s[-2] != '.' && s[-2] != ':'))
     tail = 0;
@@ -952,18 +953,21 @@ yylex ()
     {
       switch (s[-1])
 	{
+	case 'B':
+          yylval.exp.baserel = 1;
 	case 's':
 	case 'S':
 	case 'b':
-	case 'B':
 	  yylval.exp.size = SIZE_BYTE;
 	  break;
-	case 'w':
 	case 'W':
+          yylval.exp.baserel = 1;
+	case 'w':
 	  yylval.exp.size = SIZE_WORD;
 	  break;
-	case 'l':
 	case 'L':
+          yylval.exp.baserel = 1;
+	case 'l':
 	  yylval.exp.size = SIZE_LONG;
 	  break;
 	default:
diff --git a/gas/config/morphos.mh b/gas/config/morphos.mh
new file mode 100755
index 0000000..46db472
--- /dev/null
+++ binutils-2.9.1/gas/config/morphos.mh
@@ -0,0 +1,13 @@
+# Host makefile fragment for MorphOS.
+
+# There is no standard system compiler.  Assume use GNU C.
+CC = gcc
+# There is no support for -g yet.  But use -O instead.
+CFLAGS = -O
+# We have both types of links under AmigaOS with GNU
+# utils, however the links need to be made in canonical
+# AmigaOS format (foo:bar/bell/file) rather than UNIX
+# format (/foo/bar/bell/file).  When this is fixed, then
+# these can go away.
+SYMLINK = cp
+HARDLINK = cp
diff --git a/gas/config/obj-amigahunk.c b/gas/config/obj-amigahunk.c
new file mode 100644
index 0000000..85a0036
--- /dev/null
+++ binutils-2.9.1/gas/config/obj-amigahunk.c
@@ -0,0 +1,560 @@
+/* AmigaOS object file format
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+This file is part of GAS, the GNU Assembler.
+
+GAS 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,
+or (at your option) any later version.
+
+GAS 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 GAS; see the file COPYING.  If not, write
+to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "as.h"
+
+#ifdef BFD_ASSEMBLER
+#undef NO_RELOC
+#endif
+#include "obstack.h"
+
+#ifndef BFD_ASSEMBLER
+/* in: segT   out: N_TYPE bits */
+const short seg_N_TYPE[] =
+{
+  N_ABS,
+  N_TEXT,
+  N_DATA,
+  N_BSS,
+  N_UNDF,			/* unknown */
+  N_UNDF,			/* error */
+  N_UNDF,			/* expression */
+  N_UNDF,			/* debug */
+  N_UNDF,			/* ntv */
+  N_UNDF,			/* ptv */
+  N_REGISTER,			/* register */
+};
+
+const segT N_TYPE_seg[N_TYPE + 2] =
+{				/* N_TYPE == 0x1E = 32-2 */
+  SEG_UNKNOWN,			/* N_UNDF == 0 */
+  SEG_GOOF,
+  SEG_ABSOLUTE,			/* N_ABS == 2 */
+  SEG_GOOF,
+  SEG_TEXT,			/* N_TEXT == 4 */
+  SEG_GOOF,
+  SEG_DATA,			/* N_DATA == 6 */
+  SEG_GOOF,
+  SEG_BSS,			/* N_BSS == 8 */
+  SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF,
+  SEG_REGISTER,			/* dummy N_REGISTER for regs = 30 */
+  SEG_GOOF,
+};
+#endif
+
+static void obj_amiga_line PARAMS ((int));
+static void obj_amiga_weak PARAMS ((int));
+
+const pseudo_typeS obj_pseudo_table[] =
+{
+  {"line", obj_amiga_line, 0},	/* source code line number */
+  {"ln", obj_amiga_line, 0},	/* coff line number that we use anyway */
+
+  {"weak", obj_amiga_weak, 0},	/* mark symbol as weak.  */
+
+  /* coff debug pseudos (ignored) */
+  {"def", s_ignore, 0},
+  {"dim", s_ignore, 0},
+  {"endef", s_ignore, 0},
+  {"ident", s_ignore, 0},
+  {"line", s_ignore, 0},
+  {"ln", s_ignore, 0},
+  {"scl", s_ignore, 0},
+  {"size", s_ignore, 0},
+  {"tag", s_ignore, 0},
+  {"type", s_ignore, 0},
+  {"val", s_ignore, 0},
+  {"version", s_ignore, 0},
+
+  {"optim", s_ignore, 0},	/* For sun386i cc (?) */
+
+  /* other stuff */
+  {"ABORT", s_abort, 0},
+
+  {NULL}			/* end sentinel */
+};				/* obj_pseudo_table */
+
+
+#ifdef BFD_ASSEMBLER
+
+void
+obj_amiga_frob_symbol (sym, punt)
+     symbolS *sym;
+     int *punt;
+{
+  flagword flags;
+  asection *sec;
+  int desc, type, other;
+
+  flags = sym->bsym->flags;
+  type = S_GET_TYPE (sym);
+  desc = S_GET_DESC (sym);
+  other = S_GET_OTHER (sym);
+  sec = sym->bsym->section;
+
+  /* Only frob simple symbols this way right now.  */
+  if (! (type & ~ (N_TYPE | N_EXT)))
+    {
+      if (type == (N_UNDF | N_EXT)
+	  && sec == &bfd_abs_section)
+	sym->bsym->section = sec = bfd_und_section_ptr;
+
+      if ((type & N_TYPE) != N_INDR
+	  && (type & N_TYPE) != N_SETA
+	  && (type & N_TYPE) != N_SETT
+	  && (type & N_TYPE) != N_SETD
+	  && (type & N_TYPE) != N_SETB
+	  && type != N_WARNING
+	  && (sec == &bfd_abs_section
+	      || sec == &bfd_und_section))
+	return;
+      if (flags & BSF_EXPORT)
+	type |= N_EXT;
+
+      switch (type & N_TYPE)
+	{
+	case N_SETA:
+	case N_SETT:
+	case N_SETD:
+	case N_SETB:
+	  /* Set the debugging flag for constructor symbols so that
+	     BFD leaves them alone.  */
+	  sym->bsym->flags |= BSF_DEBUGGING;
+
+	  /* You can't put a common symbol in a set.  The way a set
+	     element works is that the symbol has a definition and a
+	     name, and the linker adds the definition to the set of
+	     that name.  That does not work for a common symbol,
+	     because the linker can't tell which common symbol the
+	     user means.  FIXME: Using as_bad here may be
+	     inappropriate, since the user may want to force a
+	     particular type without regard to the semantics of sets;
+	     on the other hand, we certainly don't want anybody to be
+	     mislead into thinking that their code will work.  */
+	  if (S_IS_COMMON (sym))
+	    as_bad ("Attempt to put a common symbol into set %s",
+		    S_GET_NAME (sym));
+	  /* Similarly, you can't put an undefined symbol in a set.  */
+	  else if (! S_IS_DEFINED (sym))
+	    as_bad ("Attempt to put an undefined symbol into set %s",
+		    S_GET_NAME (sym));
+
+	  break;
+	case N_INDR:
+	  /* Put indirect symbols in the indirect section.  */
+	  sym->bsym->section = bfd_ind_section_ptr;
+	  sym->bsym->flags |= BSF_INDIRECT;
+	  if (type & N_EXT)
+	    {
+	      sym->bsym->flags |= BSF_EXPORT;
+	      sym->bsym->flags &=~ BSF_LOCAL;
+	    }
+	  break;
+	case N_WARNING:
+	  /* Mark warning symbols.  */
+	  sym->bsym->flags |= BSF_WARNING;
+	  break;
+	}
+    }
+  else
+    {
+      sym->bsym->flags |= BSF_DEBUGGING;
+    }
+
+  S_SET_TYPE (sym, type);
+
+  /* Double check weak symbols.  */
+  if (sym->bsym->flags & BSF_WEAK)
+    {
+      if (S_IS_COMMON (sym))
+	as_bad ("Symbol `%s' can not be both weak and common",
+		S_GET_NAME (sym));
+    }
+}
+
+void
+obj_amiga_frob_file ()
+{
+  /* Relocation processing may require knowing the VMAs of the sections.
+     Since writing to a section will cause the BFD back end to compute the
+     VMAs, fake it out here....  */
+  bfd_byte b = 0;
+  boolean x = true;
+  if (bfd_section_size (stdoutput, text_section) != 0)
+    {
+      x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0,
+				    (bfd_size_type) 1);
+    }
+  else if (bfd_section_size (stdoutput, data_section) != 0)
+    {
+      x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
+				    (bfd_size_type) 1);
+    }
+  assert (x == true);
+}
+
+#else
+
+/* Relocation. */
+
+/*
+ *		emit_relocations()
+ *
+ * Crawl along a fixS chain. Emit the segment's relocations.
+ */
+void
+obj_emit_relocations (where, fixP, segment_address_in_file)
+     char **where;
+     fixS *fixP;		/* Fixup chain for this segment. */
+     relax_addressT segment_address_in_file;
+{
+  for (; fixP; fixP = fixP->fx_next)
+    if (fixP->fx_done == 0)
+      {
+	tc_aout_fix_to_chars (*where, fixP, segment_address_in_file);
+	*where += md_reloc_size;
+      }
+}
+
+#ifndef obj_header_append
+/* Aout file generation & utilities */
+void
+obj_header_append (where, headers)
+     char **where;
+     object_headers *headers;
+{
+  tc_headers_hook (headers);
+
+#ifdef CROSS_COMPILE
+  md_number_to_chars (*where, headers->header.a_info, sizeof (headers->header.a_info));
+  *where += sizeof (headers->header.a_info);
+  md_number_to_chars (*where, headers->header.a_text, sizeof (headers->header.a_text));
+  *where += sizeof (headers->header.a_text);
+  md_number_to_chars (*where, headers->header.a_data, sizeof (headers->header.a_data));
+  *where += sizeof (headers->header.a_data);
+  md_number_to_chars (*where, headers->header.a_bss, sizeof (headers->header.a_bss));
+  *where += sizeof (headers->header.a_bss);
+  md_number_to_chars (*where, headers->header.a_syms, sizeof (headers->header.a_syms));
+  *where += sizeof (headers->header.a_syms);
+  md_number_to_chars (*where, headers->header.a_entry, sizeof (headers->header.a_entry));
+  *where += sizeof (headers->header.a_entry);
+  md_number_to_chars (*where, headers->header.a_trsize, sizeof (headers->header.a_trsize));
+  *where += sizeof (headers->header.a_trsize);
+  md_number_to_chars (*where, headers->header.a_drsize, sizeof (headers->header.a_drsize));
+  *where += sizeof (headers->header.a_drsize);
+
+#else /* CROSS_COMPILE */
+
+  append (where, (char *) &headers->header, sizeof (headers->header));
+#endif /* CROSS_COMPILE */
+
+}
+#endif
+
+void
+obj_symbol_to_chars (where, symbolP)
+     char **where;
+     symbolS *symbolP;
+{
+  md_number_to_chars ((char *) &(S_GET_OFFSET (symbolP)),
+		      S_GET_OFFSET (symbolP),
+		      sizeof (S_GET_OFFSET (symbolP)));
+
+  md_number_to_chars ((char *) &(S_GET_DESC (symbolP)),
+		      S_GET_DESC (symbolP),
+		      sizeof (S_GET_DESC (symbolP)));
+
+  md_number_to_chars ((char *) &(symbolP->sy_symbol.n_value),
+		      S_GET_VALUE (symbolP),
+		      sizeof (symbolP->sy_symbol.n_value));
+
+  append (where, (char *) &symbolP->sy_symbol, sizeof (obj_symbol_type));
+}
+
+void
+obj_emit_symbols (where, symbol_rootP)
+     char **where;
+     symbolS *symbol_rootP;
+{
+  symbolS *symbolP;
+
+  /* Emit all symbols left in the symbol chain.  */
+  for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
+    {
+      /* Used to save the offset of the name. It is used to point
+	 to the string in memory but must be a file offset. */
+      register char *temp;
+
+      temp = S_GET_NAME (symbolP);
+      S_SET_OFFSET (symbolP, symbolP->sy_name_offset);
+
+      /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */
+      if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP))
+	S_SET_EXTERNAL (symbolP);
+
+      /* Adjust the type of a weak symbol.  */
+      if (S_GET_WEAK (symbolP))
+	{
+	  switch (S_GET_TYPE (symbolP))
+	    {
+	    case N_UNDF: S_SET_TYPE (symbolP, N_WEAKU); break;
+	    case N_ABS:	 S_SET_TYPE (symbolP, N_WEAKA); break;
+	    case N_TEXT: S_SET_TYPE (symbolP, N_WEAKT); break;
+	    case N_DATA: S_SET_TYPE (symbolP, N_WEAKD); break;
+	    case N_BSS:  S_SET_TYPE (symbolP, N_WEAKB); break;
+	    default: as_bad ("%s: bad type for weak symbol", temp); break;
+	    }
+	}
+
+      obj_symbol_to_chars (where, symbolP);
+      S_SET_NAME (symbolP, temp);
+    }
+}
+
+#endif /* ! BFD_ASSEMBLER */
+
+static void
+obj_amiga_line (ignore)
+     int ignore;
+{
+  /* Assume delimiter is part of expression.
+     BSD4.2 as fails with delightful bug, so we
+     are not being incompatible here. */
+  new_logical_line ((char *) NULL, (int) (get_absolute_expression ()));
+  demand_empty_rest_of_line ();
+}				/* obj_aout_line() */
+
+/* Handle .weak.  This is a GNU extension.  */
+
+static void
+obj_amiga_weak (ignore)
+     int ignore;
+{
+  char *name;
+  int c;
+  symbolS *symbolP;
+
+  do
+    {
+      name = input_line_pointer;
+      c = get_symbol_end ();
+      symbolP = symbol_find_or_make (name);
+      *input_line_pointer = c;
+      SKIP_WHITESPACE ();
+      S_SET_WEAK (symbolP);
+      if (c == ',')
+	{
+	  input_line_pointer++;
+	  SKIP_WHITESPACE ();
+	  if (*input_line_pointer == '\n')
+	    c = '\n';
+	}
+    }
+  while (c == ',');
+  demand_empty_rest_of_line ();
+}
+
+void
+obj_read_begin_hook ()
+{
+}
+
+#ifndef BFD_ASSEMBLER
+
+void
+obj_crawl_symbol_chain (headers)
+     object_headers *headers;
+{
+  symbolS *symbolP;
+  symbolS **symbolPP;
+  int symbol_number = 0;
+
+  tc_crawl_symbol_chain (headers);
+
+  symbolPP = &symbol_rootP;	/*->last symbol chain link. */
+  while ((symbolP = *symbolPP) != NULL)
+    {
+      if (symbolP->sy_mri_common)
+	{
+	  if (S_IS_EXTERNAL (symbolP))
+	    as_bad ("%s: global symbols not supported in common sections",
+		    S_GET_NAME (symbolP));
+	  *symbolPP = symbol_next (symbolP);
+	  continue;
+	}
+
+      if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA))
+	{
+	  S_SET_SEGMENT (symbolP, SEG_TEXT);
+	}			/* if pusing data into text */
+
+      resolve_symbol_value (symbolP);
+
+      /* OK, here is how we decide which symbols go out into the brave
+	 new symtab.  Symbols that do are:
+
+	 * symbols with no name (stabd's?)
+	 * symbols with debug info in their N_TYPE
+
+	 Symbols that don't are:
+	 * symbols that are registers
+	 * symbols with \1 as their 3rd character (numeric labels)
+	 * "local labels" as defined by S_LOCAL_NAME(name) if the -L
+	 switch was passed to gas.
+
+	 All other symbols are output.  We complain if a deleted
+	 symbol was marked external. */
+
+
+      if (!S_IS_REGISTER (symbolP)
+	  && (!S_GET_NAME (symbolP)
+	      || S_IS_DEBUG (symbolP)
+	      || !S_IS_DEFINED (symbolP)
+	      || S_IS_EXTERNAL (symbolP)
+	      || (S_GET_NAME (symbolP)[0] != '\001'
+		  && (flag_keep_locals || !S_LOCAL_NAME (symbolP)))))
+	{
+	  symbolP->sy_number = symbol_number++;
+
+	  /* The + 1 after strlen account for the \0 at the
+			   end of each string */
+	  if (!S_IS_STABD (symbolP))
+	    {
+	      /* Ordinary case. */
+	      symbolP->sy_name_offset = string_byte_count;
+	      string_byte_count += strlen (S_GET_NAME (symbolP)) + 1;
+	    }
+	  else			/* .Stabd case. */
+	    symbolP->sy_name_offset = 0;
+	  symbolPP = &(symbol_next (symbolP));
+	}
+      else
+	{
+	  if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP))
+	    /* This warning should never get triggered any more.
+	       Well, maybe if you're doing twisted things with
+	       register names...  */
+	    {
+	      as_bad ("Local symbol %s never defined.", decode_local_label_name (S_GET_NAME (symbolP)));
+	    }			/* oops. */
+
+	  /* Unhook it from the chain */
+	  *symbolPP = symbol_next (symbolP);
+	}			/* if this symbol should be in the output */
+    }				/* for each symbol */
+
+  H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number);
+}
+
+/*
+ * Find strings by crawling along symbol table chain.
+ */
+
+void
+obj_emit_strings (where)
+     char **where;
+{
+  symbolS *symbolP;
+
+#ifdef CROSS_COMPILE
+  /* Gotta do md_ byte-ordering stuff for string_byte_count first - KWK */
+  md_number_to_chars (*where, string_byte_count, sizeof (string_byte_count));
+  *where += sizeof (string_byte_count);
+#else /* CROSS_COMPILE */
+  append (where, (char *) &string_byte_count, (unsigned long) sizeof (string_byte_count));
+#endif /* CROSS_COMPILE */
+
+  for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP))
+    {
+      if (S_GET_NAME (symbolP))
+	append (&next_object_file_charP, S_GET_NAME (symbolP),
+		(unsigned long) (strlen (S_GET_NAME (symbolP)) + 1));
+    }				/* walk symbol chain */
+}
+
+void
+obj_pre_write_hook (headers)
+     object_headers *headers;
+{
+  H_SET_DYNAMIC (headers, 0);
+  H_SET_VERSION (headers, AOUT_VERSION);
+  H_SET_MACHTYPE (headers, AOUT_MACHTYPE);
+  tc_aout_pre_write_hook (headers);
+}
+
+void
+DEFUN_VOID (s_sect)
+{
+  /* Strip out the section name */
+  char *section_name;
+  char *section_name_end;
+  char c;
+
+  unsigned int len;
+  unsigned int exp;
+  char *save;
+
+  section_name = input_line_pointer;
+  c = get_symbol_end ();
+  section_name_end = input_line_pointer;
+
+  len = section_name_end - section_name;
+  input_line_pointer++;
+  save = input_line_pointer;
+
+  SKIP_WHITESPACE ();
+  if (c == ',')
+    {
+      exp = get_absolute_expression ();
+    }
+  else if (*input_line_pointer == ',')
+    {
+      input_line_pointer++;
+      exp = get_absolute_expression ();
+    }
+  else
+    {
+      input_line_pointer = save;
+      exp = 0;
+    }
+  if (exp >= 1000)
+    {
+      as_bad ("subsegment index too high");
+    }
+
+  if (strcmp (section_name, ".text") == 0)
+    {
+      subseg_set (SEG_TEXT, (subsegT) exp);
+    }
+
+  if (strcmp (section_name, ".data") == 0)
+    {
+      if (flag_readonly_data_in_text)
+	subseg_set (SEG_TEXT, (subsegT) exp + 1000);
+      else
+	subseg_set (SEG_DATA, (subsegT) exp);
+    }
+
+  *section_name_end = c;
+}
+
+#endif /* ! BFD_ASSEMBLER */
diff --git a/gas/config/obj-amigahunk.h b/gas/config/obj-amigahunk.h
new file mode 100644
index 0000000..67ce799
--- /dev/null
+++ binutils-2.9.1/gas/config/obj-amigahunk.h
@@ -0,0 +1,219 @@
+/* obj-amigahunk.h, AmigaOS object file format for gas, the assembler.
+   Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS 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,
+   or (at your option) any later version.
+
+   GAS 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 GAS; see the file COPYING.  If not, write
+   to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Tag to validate an amiga object file format processing */
+#define OBJ_AMIGAHUNK 1
+
+#include "targ-cpu.h"
+#include "aout_gnu.h"
+
+#ifdef BFD_ASSEMBLER
+
+#include "bfd/libamiga.h"
+
+#define OUTPUT_FLAVOR bfd_target_amiga_flavour
+
+#else /* ! BFD_ASSEMBLER */
+
+extern const short seg_N_TYPE[];
+extern const segT N_TYPE_seg[];
+
+#ifndef DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE
+#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE	(HUNK_UNIT)
+#endif
+
+#endif /* ! BFD_ASSEMBLER */
+
+/* SYMBOL TABLE */
+/* Symbol table macros and constants */
+
+#ifdef BFD_ASSEMBLER
+
+
+#define S_SET_OTHER(S,V)		(amiga_symbol((S)->bsym)->other = (V))
+#define S_SET_TYPE(S,T)			(amiga_symbol((S)->bsym)->type = (T))
+#define S_SET_DESC(S,D)			(amiga_symbol((S)->bsym)->desc = (D))
+#define S_GET_OTHER(S)			(amiga_symbol((S)->bsym)->other)
+#define S_GET_TYPE(S)			(amiga_symbol((S)->bsym)->type)
+#define S_GET_DESC(S)			(amiga_symbol((S)->bsym)->desc)
+
+asection *text_section, *data_section, *bss_section;
+
+#define obj_frob_symbol(S,PUNT)	obj_amiga_frob_symbol (S, &PUNT)
+#define obj_frob_file()		obj_amiga_frob_file ()
+extern void obj_amiga_frob_symbol PARAMS ((struct symbol *, int *));
+extern void obj_amiga_frob_file PARAMS ((void));
+
+#define obj_sec_sym_ok_for_reloc(SEC)	(1)
+
+#else
+
+/* We use the sy_obj field to record whether a symbol is weak.  */
+#define OBJ_SYMFIELD_TYPE char
+
+/*
+ *  Macros to extract information from a symbol table entry.
+ *  This syntaxic indirection allows independence regarding a.out or coff.
+ *  The argument (s) of all these macros is a pointer to a symbol table entry.
+ */
+
+/* True if the symbol is external */
+#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_REGISTER(s)	((s)->sy_symbol.n_type == N_REGISTER)
+
+/* True if a debug special symbol entry */
+#define S_IS_DEBUG(s)		((s)->sy_symbol.n_type & N_STAB)
+/* True if a symbol is local symbol name */
+/* A symbol name whose name begin with ^A is a gas internal pseudo symbol
+   nameless symbols come from .stab directives. */
+#define S_IS_LOCAL(s)		(S_GET_NAME(s) && \
+				 !S_IS_DEBUG(s) && \
+				 (S_GET_NAME(s)[0] == '\001' || \
+				  (S_LOCAL_NAME(s) && !flag_keep_locals)))
+/* True if a symbol is not defined in this file */
+#define S_IS_EXTERN(s)		((s)->sy_symbol.n_type & N_EXT)
+/* True if the symbol has been generated because of a .stabd directive */
+#define S_IS_STABD(s)		(S_GET_NAME(s) == (char *)0)
+
+/* Accessors */
+/* The name of the symbol */
+#define S_GET_NAME(s)		((s)->sy_symbol.n_un.n_name)
+/* 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)
+/* The numeric value of the segment */
+#define S_GET_SEGMENT(s)	(N_TYPE_seg[S_GET_TYPE(s)])
+/* The n_other expression value */
+#define S_GET_OTHER(s)		((s)->sy_symbol.n_other)
+/* The n_desc expression value */
+#define S_GET_DESC(s)		((s)->sy_symbol.n_desc)
+/* Whether the symbol is weak.  */
+#define S_GET_WEAK(s)		((s)->sy_obj)
+
+/* Modifiers */
+/* Assume that a symbol cannot be simultaneously in more than on segment */
+/* set segment */
+#define S_SET_SEGMENT(s,seg)	((s)->sy_symbol.n_type &= ~N_TYPE,(s)->sy_symbol.n_type|=SEGMENT_TO_SYMBOL_TYPE(seg))
+/* The symbol is external */
+#define S_SET_EXTERNAL(s)	((s)->sy_symbol.n_type |= N_EXT)
+/* The symbol is not external */
+#define S_CLEAR_EXTERNAL(s)	((s)->sy_symbol.n_type &= ~N_EXT)
+/* Set the name of the symbol */
+#define S_SET_NAME(s,v)		((s)->sy_symbol.n_un.n_name = (v))
+/* Set the offset in the string table */
+#define S_SET_OFFSET(s,v)	((s)->sy_symbol.n_un.n_strx = (v))
+/* Set the n_type field */
+#define S_SET_TYPE(s,t)		((s)->sy_symbol.n_type = (t))
+/* Set the n_other expression value */
+#define S_SET_OTHER(s,v)	((s)->sy_symbol.n_other = (v))
+/* Set the n_desc expression value */
+#define S_SET_DESC(s,v)		((s)->sy_symbol.n_desc = (v))
+/* Mark the symbol as weak.  This causes n_type to be adjusted when
+   the symbol is written out.  */
+#define S_SET_WEAK(s)		((s)->sy_obj = 1)
+
+/* File header macro and type definition */
+
+#define H_GET_FILE_SIZE(h)	(H_GET_HEADER_SIZE(h) \
+				 + H_GET_TEXT_SIZE(h) \
+				 + H_GET_DATA_SIZE(h) \
+				 + H_GET_SYMBOL_TABLE_SIZE(h) \
+				 + H_GET_TEXT_RELOCATION_SIZE(h) \
+				 + H_GET_DATA_RELOCATION_SIZE(h) \
+				 + H_GET_STRING_SIZE(h))
+
+#define H_GET_HEADER_SIZE(h)		(EXEC_BYTES_SIZE)
+#define H_GET_TEXT_SIZE(h)		((h)->header.a_text)
+#define H_GET_DATA_SIZE(h)		((h)->header.a_data)
+#define H_GET_BSS_SIZE(h)		((h)->header.a_bss)
+#define H_GET_TEXT_RELOCATION_SIZE(h)	((h)->header.a_trsize)
+#define H_GET_DATA_RELOCATION_SIZE(h)	((h)->header.a_drsize)
+#define H_GET_SYMBOL_TABLE_SIZE(h)	((h)->header.a_syms)
+#define H_GET_ENTRY_POINT(h)		((h)->header.a_entry)
+#define H_GET_STRING_SIZE(h)		((h)->string_table_size)
+#define H_GET_LINENO_SIZE(h)		(0)
+
+#define H_GET_DYNAMIC(h)		((h)->header.a_info >> 31)
+#define H_GET_VERSION(h)		(((h)->header.a_info >> 24) & 0x7f)
+#define H_GET_MACHTYPE(h)		(((h)->header.a_info >> 16) & 0xff)
+#define H_GET_MAGIC_NUMBER(h)		((h)->header.a_info & 0xffff)
+
+#define H_SET_DYNAMIC(h,v)		((h)->header.a_info = (((v) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_VERSION(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | ((v) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_MACHTYPE(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | ((v) << 16) \
+							       | (H_GET_MAGIC_NUMBER(h))))
+
+#define H_SET_MAGIC_NUMBER(h,v)		((h)->header.a_info = ((H_GET_DYNAMIC(h) << 31) \
+							       | (H_GET_VERSION(h) << 24) \
+							       | (H_GET_MACHTYPE(h) << 16) \
+							       | ((v))))
+
+#define H_SET_TEXT_SIZE(h,v)		((h)->header.a_text = md_section_align(SEG_TEXT, (v)))
+#define H_SET_DATA_SIZE(h,v)		((h)->header.a_data = md_section_align(SEG_DATA, (v)))
+#define H_SET_BSS_SIZE(h,v)		((h)->header.a_bss = md_section_align(SEG_BSS, (v)))
+
+#define H_SET_RELOCATION_SIZE(h,t,d)	(H_SET_TEXT_RELOCATION_SIZE((h),(t)),\
+					 H_SET_DATA_RELOCATION_SIZE((h),(d)))
+
+#define H_SET_TEXT_RELOCATION_SIZE(h,v)	((h)->header.a_trsize = (v))
+#define H_SET_DATA_RELOCATION_SIZE(h,v)	((h)->header.a_drsize = (v))
+#define H_SET_SYMBOL_TABLE_SIZE(h,v)	((h)->header.a_syms = (v) * 12)
+
+#define H_SET_ENTRY_POINT(h,v)		((h)->header.a_entry = (v))
+#define H_SET_STRING_SIZE(h,v)		((h)->string_table_size = (v))
+
+typedef struct
+  {
+    struct exec header;		/* a.out header */
+    long string_table_size;	/* names + '\0' + sizeof(int) */
+  }
+
+object_headers;
+
+/* line numbering stuff. */
+#define OBJ_EMIT_LINENO(a, b, c)	{;}
+
+struct fix;
+void tc_aout_fix_to_chars PARAMS ((char *where, struct fix *fixP, relax_addressT segment_address));
+
+#endif
+
+#define obj_symbol_new_hook(s)	{;}
+
+#define EMIT_SECTION_SYMBOLS		0
+
+#define AOUT_STABS
+
+
+/* end of obj-aout.h */
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index cc173ec..9600de5 100644
--- binutils-2.9.1.orig/gas/config/tc-i386.c
+++ binutils-2.9.1/gas/config/tc-i386.c
@@ -1807,7 +1807,7 @@ md_assemble (line)
 	else
 	  {
 	    fix_new_exp (frag_now, p - frag_now->fr_literal, size,
-			 i.disps[0], 1, reloc (size, 1, i.disp_reloc[0]));
+			 i.disps[0], 1, reloc (size, 1, i.disp_reloc[0]), 0);
 
 	  }
       }
@@ -1826,7 +1826,7 @@ md_assemble (line)
 	  md_number_to_chars (p + 1, (valueT) i.imms[1]->X_add_number, 4);
 	else
 	  fix_new_exp (frag_now, p + 1 - frag_now->fr_literal, 4,
-		       i.imms[1], 0, BFD_RELOC_32);
+		       i.imms[1], 0, BFD_RELOC_32, 0);
 	if (i.imms[0]->X_op != O_constant)
 	  as_bad ("can't handle non absolute segment in long call/jmp");
 	md_number_to_chars (p + 5, (valueT) i.imms[0]->X_add_number, 2);
@@ -1952,7 +1952,7 @@ md_assemble (line)
 			insn_size += 4;
 			fix_new_exp (frag_now, p - frag_now->fr_literal, 4,
 					    i.disps[n], 0, 
-					    TC_RELOC(i.disp_reloc[n], BFD_RELOC_32));
+					    TC_RELOC(i.disp_reloc[n], BFD_RELOC_32), 0);
 		      }
 		  }
 	      }
@@ -2026,7 +2026,7 @@ md_assemble (line)
 			  }
 #endif
 			fix_new_exp (frag_now, p - frag_now->fr_literal, size,
-				     i.imms[n], pcrel, r_type);
+				     i.imms[n], pcrel, r_type, 0);
 		      }
 		  }
 	      }
@@ -2577,7 +2577,7 @@ md_estimate_size_before_relax (fragP, segment)
 				     think it does not matter that much, as
 				     this will be right most of the time. ERY*/
 		    S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)?
-		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL);
+		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL, 0);
 	  break;
 
 	default:
@@ -2593,7 +2593,7 @@ md_estimate_size_before_relax (fragP, segment)
 				     presence of @PLT, but I cannot see how
 				     to get to that from here.  ERY */
 		    S_GET_SEGMENT(fragP->fr_symbol) == undefined_section)?
-		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL);
+		   BFD_RELOC_386_PLT32 : BFD_RELOC_32_PCREL, 0);
 	  break;
 	}
       frag_wane (fragP);
@@ -2729,7 +2729,7 @@ md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
       md_number_to_chars (ptr, (valueT) 0xe9, 1);/* opcode for long jmp */
       md_number_to_chars (ptr + 1, (valueT) offset, 4);
       fix_new (frag, (ptr + 1) - frag->fr_literal, 4,
-	       to_symbol, (offsetT) 0, 0, BFD_RELOC_32);
+	       to_symbol, (offsetT) 0, 0, BFD_RELOC_32, 0);
     }
   else
     {
@@ -3064,7 +3064,11 @@ md_section_align (segment, size)
      segT segment;
      valueT size;
 {
-#ifdef OBJ_AOUT
+/* fnf hack - check to see if BFD really should handle this or not.  It is currently
+   not, at least for the BeOS port, and since stdio does not guarantee that holes
+   in files are zero filled, the holes are ending up with random contents.  This
+   really screws things like gcc's bootstrap success/fail testing. */
+#if 1
 #ifdef BFD_ASSEMBLER
   /* For a.out, force the section size to be aligned.  If we don't do
      this, BFD will align it for us, but it will not write out the
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 96ea00c..e731bc0 100644
--- binutils-2.9.1.orig/gas/config/tc-m68k.c
+++ binutils-2.9.1/gas/config/tc-m68k.c
@@ -27,6 +27,12 @@
 #include "opcode/m68k.h"
 #include "m68k-parse.h"
 
+/* FIXME: delete this #define as soon as the code that references
+   N_TEXT is changed */
+#ifdef BFD_ASSEMBLER
+#define N_TEXT 4
+#endif
+
 /* This string holds the chars that always start a comment.  If the
    pre-processor is disabled, these aren't very useful.  The macro
    tc_comment_chars points to this.  We use this, rather than the
@@ -70,6 +76,7 @@ int flag_want_pic;
 
 static int flag_short_refs;	/* -l option */
 static int flag_long_jumps;	/* -S option */
+static int flag_small_code;	/* -sc option */
 
 #ifdef REGISTER_PREFIX_OPTIONAL
 int flag_reg_prefix_optional = REGISTER_PREFIX_OPTIONAL;
@@ -156,6 +163,9 @@ static struct obstack robyn;
 /* Mode AINDX (apc-relative) using PC, with variable target, might fit
    in 16 or 8 bits.  */
 #define PCINDEX		7
+/* AmigaOS relocations */
+#define ABSREL		8
+#define IMMREL		9
 
 struct m68k_incant
   {
@@ -243,6 +253,7 @@ struct m68k_it
 	 so, which.  */
       enum pic_relocation pic_reloc;
 #endif
+      char baserel;
     }
   reloc[5];			/* Five is enough??? */
 };
@@ -268,7 +279,7 @@ static struct m68k_it the_ins;	/* the instruction being assembled */
 /* Static functions.  */
 
 static void insop PARAMS ((int, const struct m68k_incant *));
-static void add_fix PARAMS ((int, struct m68k_exp *, int, int));
+static void add_fix PARAMS ((int, struct m68k_exp *, int, int, int));
 static void add_frag PARAMS ((symbolS *, offsetT, int));
 
 /* Like addword, but goes BEFORE general operands */
@@ -291,11 +302,12 @@ insop (w, opcode)
 /* The numo+1 kludge is so we can hit the low order byte of the prev word.
    Blecch.  */
 static void
-add_fix (width, exp, pc_rel, pc_fix)
+add_fix (width, exp, pc_rel, pc_fix, base_rel)
      int width;
      struct m68k_exp *exp;
      int pc_rel;
      int pc_fix;
+     int base_rel;
 {
   the_ins.reloc[the_ins.nrel].n = ((width == 'B' || width == '3')
 				   ? (the_ins.numo*2-1)
@@ -308,7 +320,8 @@ add_fix (width, exp, pc_rel, 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;
+  the_ins.reloc[the_ins.nrel].pcrel = pc_rel;
+  the_ins.reloc[the_ins.nrel++].baserel = base_rel;
 }
 
 /* Cause an extra frag to be generated here, inserting up to 10 bytes
@@ -425,6 +438,15 @@ static const int n_archs = sizeof (archs) / sizeof (archs[0]);
 /* BCC68000 is for patching in an extra jmp instruction for long offsets
    on the 68000.  The 68000 doesn't support long branches with branchs */
 
+/* ABSREL (nice name;-)) is used in small-code, it might be 
+ * implemented base-relative (a4), pc-relative, or base-rel with an extra
+ * add instruction to add the base-register
+ *
+ * IMMREL is the analogous mode for immediate addressing of variables. This
+ * one can lead into situations, where a replacement is not possible:
+ * addl #foo,a0
+ * can't be made pc-relative, if foo is in the text segment */
+
 /* This table desribes how you change sizes for the various types of variable
    size expressions.  This version only supports two kinds. */
 
@@ -479,6 +501,17 @@ relax_typeS md_relax_table[] =
   {32765, -32770, 2, TAB (PCINDEX, LONG)},
   {0, 0, 4, 0},
   {1, 1, 0, 0},
+
+  {127, -128, 0, 0},
+  {32767, -32768, 2, TAB(ABSREL,LONG)},
+  {0, 0, 6, 0},
+  {1, 1, 0, 0},
+
+  {127, -128, 0, 0},
+  {32767, -32768, 2, TAB(IMMREL,LONG)},
+  {0, 0, 6, 0},
+  {1, 1, 0, 0},
+
 };
 
 /* These are the machine dependent pseudo-ops.  These are included so
@@ -500,12 +533,14 @@ const pseudo_typeS md_pseudo_table[] =
   {"even", s_even, 0},
   {"skip", s_space, 0},
   {"proc", s_proc, 0},
+#ifndef __amigaos__
 #if defined (TE_SUN3) || defined (OBJ_ELF)
   {"align", s_align_bytes, 0},
 #endif
 #ifdef OBJ_ELF
   {"swbeg", s_ignore, 0},
 #endif
+#endif
   {"extend", float_cons, 'x'},
   {"ldouble", float_cons, 'x'},
 
@@ -1820,7 +1855,20 @@ m68k_ip (instring)
 	      else
 		nextword = get_num (&opP->disp, 0);
 	      if (isvar (&opP->disp))
-		add_fix (s[1], &opP->disp, 0, 0);
+	        {
+/* This doesn't work when the symbol is N_UNDF! So we ignore this for the moment.
+
+	          if (flag_small_code)
+	            {
+	              add_frag (adds(&opP->disp),
+	      		        offs(&opP->disp),
+	      		        TAB(IMMREL, SZ_UNDEF));
+	      	      break;
+	            }
+	          else
+*/
+		    add_fix(s[1], &opP->disp, 0, 0, opP->disp.baserel);
+	        }
 	      switch (s[1])
 		{
 		case 'b':
@@ -1980,7 +2028,7 @@ m68k_ip (instring)
 			      )
 			    {
 			      addword (0x0170);
-			      add_fix ('l', &opP->disp, 1, 2);
+			      add_fix ('l', &opP->disp, 1, 2, opP->disp.baserel);
 			    }
 			  else
 			    {
@@ -1993,7 +2041,7 @@ m68k_ip (instring)
 		      else
 			{
 			  addword (0x0170);
-			  add_fix ('l', &opP->disp, 0, 0);
+			  add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 			}
 		    }
 		  else
@@ -2011,10 +2059,10 @@ m68k_ip (instring)
 		    {
 		      if (opP->reg == PC)
 			{
-			  add_fix ('w', &opP->disp, 1, 0);
+			  add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 			}
 		      else
-			add_fix ('w', &opP->disp, 0, 0);
+			add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
 		    }
 		}
 	      addword (nextword);
@@ -2119,9 +2167,9 @@ m68k_ip (instring)
 				 fit (possible on m68000) let the
 				 fixup processing complain later.  */
 			      if (opP->reg == PC)
-				add_fix ('B', &opP->disp, 1, 1);
+				add_fix ('B', &opP->disp, 1, 1, 0);	/* FIXME? -fnf */
 			      else
-				add_fix ('B', &opP->disp, 0, 0);
+				add_fix ('B', &opP->disp, 0, 0, 0);	/* FIXME? -fnf */
 			    }
 			  else if (siz1 != SIZE_BYTE)
 			    {
@@ -2251,9 +2299,9 @@ m68k_ip (instring)
 	      if (siz1 != SIZE_UNSPEC && isvar (&opP->disp))
 		{
 		  if (opP->reg == PC || opP->reg == ZPC)
-		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2);
+		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 1, 2, opP->disp.baserel);
 		  else
-		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0);
+		    add_fix (siz1 == SIZE_LONG ? 'l' : 'w', &opP->disp, 0, 0, opP->disp.baserel);
 		}
 	      if (siz1 == SIZE_LONG)
 		addword (baseo >> 16);
@@ -2261,7 +2309,7 @@ m68k_ip (instring)
 		addword (baseo);
 
 	      if (siz2 != SIZE_UNSPEC && isvar (&opP->odisp))
-		add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0);
+		add_fix (siz2 == SIZE_LONG ? 'l' : 'w', &opP->odisp, 0, 0, opP->disp.baserel);
 	      if (siz2 == SIZE_LONG)
 		addword (outro >> 16);
 	      if (siz2 != SIZE_UNSPEC)
@@ -2293,7 +2341,7 @@ m68k_ip (instring)
 		      && opP->disp.pic_reloc == pic_none
 #endif
 		      && S_GET_SEGMENT (adds (&opP->disp)) == now_seg
-		      && HAVE_LONG_BRANCH(current_architecture)
+		      && (HAVE_LONG_BRANCH(current_architecture) || flag_small_code)
 		      && !flag_long_jumps
 		      && !strchr ("~%&$?", s[0]))
 		    {
@@ -2305,8 +2353,20 @@ m68k_ip (instring)
 		    }
 		  /* Fall through into long */
 		case SIZE_LONG:
+#if 0
+        /* This doesn't work when the symbol is N_UNDF! We ignore this for now. */
+
+		  if (flag_small_code)
+		    {
+		      tmpreg=0x3A; /* 7.2 */
+		      add_frag (adds(&opP->disp),
+			        offs(&opP->disp),
+				TAB(ABSREL, SZ_UNDEF));
+		      break;
+		    }
+#endif
 		  if (isvar (&opP->disp))
-		    add_fix ('l', &opP->disp, 0, 0);
+		    add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 
 		  tmpreg = 0x39;/* 7.1 mode */
 		  addword (nextword >> 16);
@@ -2318,7 +2378,7 @@ m68k_ip (instring)
 		  /* Fall through.  */
 		case SIZE_WORD:	/* Word */
 		  if (isvar (&opP->disp))
-		    add_fix ('w', &opP->disp, 0, 0);
+		    add_fix ('w', &opP->disp, 0, 0, opP->disp.baserel);
 
 		  tmpreg = 0x38;/* 7.0 mode */
 		  addword (nextword);
@@ -2354,7 +2414,7 @@ m68k_ip (instring)
 	    }
 	  tmpreg = get_num (&opP->disp, tmpreg);
 	  if (isvar (&opP->disp))
-	    add_fix (s[1], &opP->disp, 0, 0);
+	    add_fix (s[1], &opP->disp, 0, 0, opP->disp.baserel);
 	  switch (s[1])
 	    {
 	    case 'b':		/* Danger:  These do no check for
@@ -2423,10 +2483,10 @@ m68k_ip (instring)
                  which is a char, and may therefore be unsigned.  We
                  want to pass -1, but we pass 64 instead, and convert
                  back in md_pcrel_from.  */
-	      add_fix ('B', &opP->disp, 1, 64);
+	      add_fix ('B', &opP->disp, 1, 64, opP->disp.baserel);
 	      break;
 	    case 'W':
-	      add_fix ('w', &opP->disp, 1, 0);
+	      add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      break;
 	    case 'L':
@@ -2434,7 +2494,7 @@ m68k_ip (instring)
 	      if (!HAVE_LONG_BRANCH(current_architecture))
 		as_warn ("Can't use long branches on 68000/68010/5200");
 	      the_ins.opcode[the_ins.numo - 1] |= 0xff;
-	      add_fix ('l', &opP->disp, 1, 0);
+	      add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      addword (0);
 	      break;
@@ -2479,19 +2539,19 @@ m68k_ip (instring)
 		      break;
 		    }
 #endif
-		  add_fix ('w', &opP->disp, 1, 0);
+		  add_fix ('w', &opP->disp, 1, 0, opP->disp.baserel);
 		}
 	      addword (0);
 	      break;
 	    case 'C':		/* Fixed size LONG coproc branches */
-	      add_fix ('l', &opP->disp, 1, 0);
+	      add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 	      addword (0);
 	      addword (0);
 	      break;
 	    case 'c':		/* Var size Coprocesssor branches */
 	      if (subs (&opP->disp))
 		{
-		  add_fix ('l', &opP->disp, 1, 0);
+		  add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 		  add_frag ((symbolS *) 0, (offsetT) 0, TAB (FBRANCH, LONG));
 		}
 	      else if (adds (&opP->disp))
@@ -2502,7 +2562,7 @@ m68k_ip (instring)
 		  /* add_frag ((symbolS *) 0, offs (&opP->disp),
 		     	       TAB(FBRANCH,SHORT)); */
 		  the_ins.opcode[the_ins.numo - 1] |= 0x40;
-		  add_fix ('l', &opP->disp, 1, 0);
+		  add_fix ('l', &opP->disp, 1, 0, opP->disp.baserel);
 		  addword (0);
 		  addword (0);
 		}
@@ -2856,7 +2916,7 @@ m68k_ip (instring)
 	  break;
 	case '_':	/* used only for move16 absolute 32-bit address */
 	  if (isvar (&opP->disp))
-	    add_fix ('l', &opP->disp, 0, 0);
+	    add_fix ('l', &opP->disp, 0, 0, opP->disp.baserel);
 	  tmpreg = get_num (&opP->disp, 80);
 	  addword (tmpreg >> 16);
 	  addword (tmpreg & 0xFFFF);
@@ -3162,8 +3222,8 @@ static const struct init_entry init_table[] =
   { "a3", ADDR3 },
   { "a4", ADDR4 },
   { "a5", ADDR5 },
+  { "fp", ADDR5 },
   { "a6", ADDR6 },
-  { "fp", ADDR6 },
   { "a7", ADDR7 },
   { "sp", ADDR7 },
   { "ssp", ADDR7 },
@@ -3439,7 +3499,8 @@ md_assemble (str)
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
 			      get_reloc_code (n, the_ins.reloc[m].pcrel,
-					      the_ins.reloc[m].pic_reloc));
+					      the_ins.reloc[m].pic_reloc),
+			      the_ins.reloc[m].baserel);
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	  if (the_ins.reloc[m].wid == 'B')
 	    fixP->fx_signed = 1;
@@ -3486,7 +3547,8 @@ md_assemble (str)
 			      &the_ins.reloc[m].exp,
 			      the_ins.reloc[m].pcrel,
 			      get_reloc_code (wid, the_ins.reloc[m].pcrel,
-					      the_ins.reloc[m].pic_reloc));
+					      the_ins.reloc[m].pic_reloc),
+			      the_ins.reloc[m].baserel);
 	  fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
 	}
       (void) frag_var (rs_machine_dependent, 10, 0,
@@ -3523,7 +3585,8 @@ md_assemble (str)
 			  &the_ins.reloc[m].exp,
 			  the_ins.reloc[m].pcrel,
 			  get_reloc_code (wid, the_ins.reloc[m].pcrel,
-					  the_ins.reloc[m].pic_reloc));
+					  the_ins.reloc[m].pic_reloc),
+			  the_ins.reloc[m].baserel);
       fixP->fx_pcrel_adjust = the_ins.reloc[m].pcrel_fix;
     }
 }
@@ -4146,7 +4209,11 @@ md_convert_frag_1 (fragP)
     case TAB (ABRANCH, LONG):
       if (!HAVE_LONG_BRANCH(current_architecture))
 	{
-	  if (fragP->fr_opcode[0] == 0x61)
+          if (flag_small_code)
+            {
+              as_bad("Long branch in small code model, not supported.");
+            }
+          else if (fragP->fr_opcode[0] == 0x61)
 	    /* BSR */
 	    {
 	      fragP->fr_opcode[0] = 0x4E;
@@ -4158,7 +4225,7 @@ md_convert_frag_1 (fragP)
 		       fragP->fr_symbol,
 		       fragP->fr_offset,
 		       0,
-		       NO_RELOC);
+		       NO_RELOC, 0);
 
 	      fragP->fr_fix += 4;
 	      ext = 0;
@@ -4169,7 +4236,7 @@ md_convert_frag_1 (fragP)
 	      fragP->fr_opcode[0] = 0x4E;
 	      fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
 	      fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		       fragP->fr_offset, 0, NO_RELOC);
+		       fragP->fr_offset, 0, NO_RELOC, 0);
 	      fragP->fr_fix += 4;
 	      ext = 0;
 	    }
@@ -4197,7 +4264,7 @@ md_convert_frag_1 (fragP)
       *buffer_address++ = (char) 0xf9;
       fragP->fr_fix += 2;	/* account for jmp instruction */
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-	       fragP->fr_offset, 0, NO_RELOC);
+	       fragP->fr_offset, 0, NO_RELOC, 0);
       fragP->fr_fix += 4;
       ext = 0;
       break;
@@ -4214,7 +4281,7 @@ md_convert_frag_1 (fragP)
 
       fragP->fr_fix += 6;	/* account for bra/jmp instructions */
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-	       fragP->fr_offset, 0, NO_RELOC);
+	       fragP->fr_offset, 0, NO_RELOC, 0);
       fragP->fr_fix += 4;
       ext = 0;
       break;
@@ -4233,8 +4300,10 @@ md_convert_frag_1 (fragP)
       /* 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 */
+      if (flag_small_code)
+        as_bad ("Trying to force a pcrel thing into absolute mode while in small code mode");
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset,
-	       0, NO_RELOC);
+	       0, NO_RELOC, 0);
       if ((fragP->fr_opcode[1] & 0x3F) != 0x3A)
 	as_bad ("Internal error (long PC-relative operand) for insn 0x%04x at 0x%lx",
 		(unsigned) fragP->fr_opcode[0],
@@ -4246,14 +4315,14 @@ md_convert_frag_1 (fragP)
       break;
     case TAB (PCLEA, SHORT):
       fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
-	       fragP->fr_offset, 1, NO_RELOC);
+	       fragP->fr_offset, 1, NO_RELOC, 0);
       fragP->fr_opcode[1] &= ~0x3F;
       fragP->fr_opcode[1] |= 0x3A; /* 072 - mode 7.2 */
       ext = 2;
       break;
     case TAB (PCLEA, LONG):
       fixP = fix_new (fragP, (int) (fragP->fr_fix) + 2, 4, fragP->fr_symbol,
-		      fragP->fr_offset, 1, NO_RELOC);
+		      fragP->fr_offset, 1, NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       /* Already set to mode 7.3; this indicates: PC indirect with
 	 suppressed index, 32-bit displacement.  */
@@ -4283,7 +4352,7 @@ md_convert_frag_1 (fragP)
       buffer_address[-1] = 0x20;
       fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
 		      fragP->fr_offset, (fragP->fr_opcode[1] & 077) == 073,
-		      NO_RELOC);
+		      NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       ext = 2;
       break;
@@ -4291,13 +4360,89 @@ md_convert_frag_1 (fragP)
       disp += 2;
       fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
 		      fragP->fr_offset, (fragP->fr_opcode[1] & 077) == 073,
-		      NO_RELOC);
+		      NO_RELOC, 0);
       fixP->fx_pcrel_adjust = 2;
       assert (fragP->fr_fix >= 2);
       buffer_address[-2] |= 0x1;
       buffer_address[-1] = 0x30;
       ext = 4;
       break;
+    case TAB(ABSREL,BYTE):
+      as_bad ("ABSREL_BYTE: how the ** does this look ?? \n");
+      break;
+    case TAB(ABSREL,SHORT):
+      subseg_change (text_section, 0);
+      ext = 2;
+      fragP->fr_opcode[1] &= ~0x3f;
+      if ((S_GET_TYPE (fragP->fr_symbol)) == N_TEXT)
+        {
+          /* so this is really a pc-relative address */
+          fragP->fr_opcode[1] |=  0x3a;
+          fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol, fragP->fr_offset+2, 1, NO_RELOC, 0);
+  	break;
+        }
+      /* in that case we have to generate base-relative code
+       * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
+       *        will have to do the final patch in that case) */
+      fragP->fr_opcode[1] |=  0x2c;  /* (a4) */
+      fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol,fragP->fr_offset, 0, NO_RELOC, 1);
+      break;
+    case TAB(ABSREL,LONG):
+      as_bad ("ABSREL_LONG: sorry, not supported.\n");
+      break;
+  
+    case TAB(IMMREL,BYTE):
+      as_bad ("IMMREL_BYTE: how the ** does this look ?? \n");
+      break;
+    case TAB(IMMREL,SHORT):
+      subseg_change (text_section, 0);
+      ext = 0; 
+      if ((S_GET_TYPE (fragP->fr_symbol)) == N_TEXT)
+        {
+  	/* we can only fix operations on data registers, not on <ea> */
+ 	if ((fragP->fr_opcode[1] & 0x38) != 0)
+   	  {
+  	    /* use the normal reloc32, sigh... */
+  	    fix_new (fragP,(int)(fragP->fr_fix),4,fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+  	    fragP->fr_fix += 4;
+  	    break;
+  	  }
+  
+          /* so this is really a pc-relative address
+           * What we have to do now is a VERY UGLY AND BIG KLUDGE. Basically do the
+           * following thing:
+           *   turn
+           *     addl #foo,d0      (foo is N_TEXT)
+           *   into
+           *     pea  foo(pc)
+           *     addl (sp)+,d0
+           */
+          *buffer_address++ = fragP->fr_opcode[0]; /* save the original command */
+  	*buffer_address++ = fragP->fr_opcode[1];
+          fragP->fr_opcode[0] = 0x48; 	/* PEA */
+          fragP->fr_opcode[1] = 0x7a;
+          fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol, fragP->fr_offset+2, 1, NO_RELOC, 0);
+  	
+          *buffer_address++ = 0x9f;	/* sp@+ */
+  	fragP->fr_fix += 4;	/* two byte fix, two byte code extension */
+  	break;
+        }
+      /* in that case we have to generate base-relative code
+       * (note: if we're in N_UNDF, this could as well be pc-relative, but the linker
+       *        will have to do the final patch in that case) */
+  
+      /* analogous (more or less;-)) to above, the following conversion is done
+       *   turn
+       *     addl #bar,d0		(bar is N_DATA)
+       *   into
+       *	   addl #<bar>,d0	where <bar> is a baserel-reloc
+       *     addl a4,d0
+       */
+   
+      fix_new(fragP,(int)(fragP->fr_fix), 4,fragP->fr_symbol,fragP->fr_offset, 0, NO_RELOC, 1);
+      *buffer_address++ = 0xd0;
+      *buffer_address++ = 0x8c;
+      break;
     }
 
   if (ext)
@@ -4355,26 +4500,68 @@ md_estimate_size_before_relax (fragP, segment)
 	    fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE);
 	    break;
 	  }
-	else if ((fragP->fr_symbol == 0) || !HAVE_LONG_BRANCH(current_architecture))
+	else if ((fragP->fr_symbol == 0) || !HAVE_LONG_BRANCH(current_architecture) || !flag_small_code)
 	  {
 	    /* On 68000, or for absolute value, switch to abs long */
 	    /* FIXME, we should check abs val, pick short or long */
-	    if (fragP->fr_opcode[0] == 0x61)
+            if (fragP->fr_opcode[0] == 0x61)
 	      {
-		fragP->fr_opcode[0] = 0x4E;
-		fragP->fr_opcode[1] = (char) 0xB9; /* JBSR with ABSL LONG offset */
-		fix_new (fragP, fragP->fr_fix, 4,
-			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
-		fragP->fr_fix += 4;
+		if (flag_small_code)
+		  {
+		    /* leave the BSR, no need to change
+		     * it into a JSR (PC,..) */
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		    fragP->fr_opcode[1]=0x00;
+	          }
+	        else if (flag_short_refs)
+	          {
+		    subseg_change(text_section, 0);
+		    fix_new(fragP,(int)(fragP->fr_fix),2,fragP->fr_symbol,
+			    fragP->fr_offset + 2, 0, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		    fragP->fr_opcode[1]=0x00;
+		  }
+		else
+		  {
+		    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, 0);
+		    fragP->fr_fix += 4;
+		  }
 		frag_wane (fragP);
 	      }
 	    else if (fragP->fr_opcode[0] == 0x60)
 	      {
-		fragP->fr_opcode[0] = 0x4E;
-		fragP->fr_opcode[1] = (char) 0xF9; /* JMP  with ABSL LONG offset */
-		fix_new (fragP, fragP->fr_fix, 4,
-			 fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC);
-		fragP->fr_fix += 4;
+		if (flag_small_code)
+  		  {
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 1, NO_RELOC, 0);
+	  	    fragP->fr_fix+=2;
+		  }
+                else if (flag_short_refs)
+                  {
+		    fragP->fr_opcode[0]= 0x4E;
+		    fragP->fr_opcode[1]= 0xF8;	/* JMP	with ABSL WORD offset */
+		    subseg_change(text_section, 0);
+		    fix_new(fragP, fragP->fr_fix, 2, 
+			    fragP->fr_symbol, fragP->fr_offset, 0, NO_RELOC, 0);
+		    fragP->fr_fix+=2;
+		  }
+		else
+		  {
+		    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, 0);
+		    fragP->fr_fix += 4;
+		  }
 		frag_wane (fragP);
 	      }
 	    else
@@ -4385,7 +4572,7 @@ md_estimate_size_before_relax (fragP, segment)
 	else
 	  {			/* Symbol is still undefined.  Make it simple */
 	    fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
-		     fragP->fr_offset, 1, NO_RELOC);
+		     fragP->fr_offset, 1, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	    fragP->fr_opcode[1] = (char) 0xff;
 	    frag_wane (fragP);
@@ -4405,7 +4592,7 @@ md_estimate_size_before_relax (fragP, segment)
 	else
 	  {
 	    fix_new (fragP, (int) fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 1, NO_RELOC);
+		     fragP->fr_offset, 1, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	    fragP->fr_opcode[1] |= 0x40; /* Turn on LONG bit */
 	    frag_wane (fragP);
@@ -4450,7 +4637,7 @@ md_estimate_size_before_relax (fragP, segment)
 	    buffer_address[1] = (char) 0xf8;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 2;
 	  }
 	else
@@ -4461,7 +4648,7 @@ md_estimate_size_before_relax (fragP, segment)
 	    buffer_address[1] = (char) 0xf9;
 	    fragP->fr_fix += 2;	/* account for jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	  }
 	frag_wane (fragP);
@@ -4491,7 +4678,7 @@ md_estimate_size_before_relax (fragP, segment)
 	    buffer_address[5] = (char) 0xf8;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 2;
 	  }
 	else
@@ -4502,7 +4689,7 @@ md_estimate_size_before_relax (fragP, segment)
 	    buffer_address[5] = (char) 0xf9;
 	    fragP->fr_fix += 6;	/* account for bra/jmp instruction */
 	    fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
-		     fragP->fr_offset, 0, NO_RELOC);
+		     fragP->fr_offset, 0, NO_RELOC, 0);
 	    fragP->fr_fix += 4;
 	  }
 
@@ -4542,6 +4729,16 @@ md_estimate_size_before_relax (fragP, segment)
 	}
       break;
 
+    case TAB(ABSREL,SZ_UNDEF):
+	if ((S_GET_SEGMENT (fragP->fr_symbol)) == segment || flag_short_refs || flag_small_code) {
+		fragP->fr_subtype = TAB(ABSREL, SHORT);
+		fragP->fr_var += 2;
+	} else {
+		fragP->fr_subtype = TAB(ABSREL, LONG);
+		fragP->fr_var += 6;
+	}
+      break;
+
     default:
       break;
     }
@@ -4604,7 +4801,7 @@ md_ri_to_chars (the_bytes, ri)
   the_bytes[5] = (ri->r_symbolnum >> 8) & 0x0ff;
   the_bytes[6] = ri->r_symbolnum & 0x0ff;
   the_bytes[7] = (((ri->r_pcrel << 7) & 0x80) | ((ri->r_length << 5) & 0x60) |
-		  ((ri->r_extern << 4) & 0x10));
+		  ((ri->r_extern << 4) & 0x10) | ((ri->r_baserel << 3) & 0x08));
 }
 
 #endif /* comment */
@@ -4638,7 +4835,7 @@ tc_aout_fix_to_chars (where, fixP, segment_address_in_file)
   where[5] = (r_symbolnum >> 8) & 0x0ff;
   where[6] = r_symbolnum & 0x0ff;
   where[7] = (((fixP->fx_pcrel << 7) & 0x80) | ((nbytes_r_length[fixP->fx_size] << 5) & 0x60) |
-	      (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10));
+	      (((!S_IS_DEFINED (fixP->fx_addsy)) << 4) & 0x10) | ((fixP->tc_fix_data << 3) & 0x08));
 }
 #endif
 
@@ -4678,7 +4875,7 @@ md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
       md_number_to_chars (ptr, (valueT) 0x4EF9, 2);
       md_number_to_chars (ptr + 2, (valueT) offset, 4);
       fix_new (frag, (ptr + 2) - frag->fr_literal, 4, to_symbol, (offsetT) 0,
-	       0, NO_RELOC);
+	       0, NO_RELOC, 0);
     }
   else
     {
@@ -6549,7 +6746,7 @@ s_mri_endw (ignore)
 #ifdef OBJ_ELF
 CONST char *md_shortopts = "lSA:m:kQ:V";
 #else
-CONST char *md_shortopts = "lSA:m:k";
+CONST char *md_shortopts = "SA:m:s:k";
 #endif
 
 struct option md_longopts[] = {
@@ -6589,6 +6786,13 @@ md_parse_option (c, arg)
       flag_long_jumps = 1;
       break;
 
+    case 's':
+      if (!strcmp(arg, "c") || !strcmp(arg, "mallcode"))
+        flag_small_code = 1;
+      else
+        return 0;
+      break;
+      
     case 'A':
       if (*arg == 'm')
  	arg++;
@@ -6731,7 +6935,6 @@ md_show_usage (stream)
 {
   fprintf(stream, "\
 680X0 options:\n\
--l			use 1 word for refs to undefined symbols [default 2]\n\
 -m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060\n\
  | -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -m68360\n\
  | -mcpu32 | -m5200\n\
@@ -6745,6 +6948,7 @@ md_show_usage (stream)
 			[default yes for 68020 and up]\n\
 -pic, -k		generate position independent code\n\
 -S			turn jbsr into jsr\n\
+-smallcode, -sc		small code model\n\
 --register-prefix-optional\n\
 			recognize register names without prefix character\n\
 --bitwise-or		do not treat `|' as a comment character\n");
diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h
index fd2629d..75b45ac 100644
--- binutils-2.9.1.orig/gas/config/tc-m68k.h
+++ binutils-2.9.1/gas/config/tc-m68k.h
@@ -35,6 +35,9 @@ struct fix;
 #ifdef TE_NetBSD
 #define TARGET_FORMAT "a.out-m68k-netbsd"
 #endif
+#ifdef TE_AMIGA
+#define TARGET_FORMAT "a.out-amiga"
+#endif
 #ifdef TE_LINUX
 #define TARGET_FORMAT "a.out-m68k-linux"
 #endif
@@ -43,6 +46,10 @@ struct fix;
 #endif
 #endif
 
+#ifdef OBJ_AMIGAHUNK
+#define TARGET_FORMAT "amiga"
+#endif
+
 #ifdef OBJ_ELF
 #define TARGET_FORMAT "elf32-m68k"
 #endif
@@ -74,13 +81,10 @@ struct fix;
 #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP)
 #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag)
 extern int tc_coff_sizemachdep PARAMS ((struct frag *));
-#ifdef TE_SUN3
 /* This variable contains the value to write out at the beginning of
-   the a.out file.  The 2<<16 means that this is a 68020 file instead
    of an old-style 68000 file */
 
-#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (2<<16|OMAGIC);	/* Magic byte for file header */
-#endif /* TE_SUN3 */
+#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (OMAGIC);	/* Magic byte for file header */
 
 #ifndef AOUT_MACHTYPE
 #define AOUT_MACHTYPE m68k_aout_machtype
@@ -201,6 +205,9 @@ extern int m68k_parse_long_option PARAMS ((char *));
 extern struct relax_type md_relax_table[];
 #define TC_GENERIC_RELAX_TABLE md_relax_table
 
+#define TC_FIX_TYPE char
+#define TC_INIT_FIX_DATA(p)
+
 /* Copied from write.c */
 /* This was formerly called M68K_AIM_KLUDGE.  */
 #define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index e81d41c..f331415 100644
--- binutils-2.9.1.orig/gas/config/tc-ppc.c
+++ binutils-2.9.1/gas/config/tc-ppc.c
@@ -85,6 +85,7 @@ static void ppc_stabx PARAMS ((int));
 static void ppc_rename PARAMS ((int));
 static void ppc_toc PARAMS ((int));
 static void ppc_xcoff_cons PARAMS ((int));
+static void ppc_vbyte PARAMS ((int));
 #endif
 
 #ifdef OBJ_ELF
@@ -182,6 +183,7 @@ const pseudo_typeS md_pseudo_table[] =
   { "long",	ppc_xcoff_cons,	2 },
   { "word",	ppc_xcoff_cons,	1 },
   { "short",	ppc_xcoff_cons,	1 },
+  { "vbyte",    ppc_vbyte,	0 },
 #endif
 
 #ifdef OBJ_ELF
@@ -286,70 +288,70 @@ static const struct pd_reg pre_defined_registers[] =
   { "dsisr", 18 },  /* Data Storage Interrupt Status Register */
 
   { "f.0", 0 },     /* Floating point registers */
-  { "f.1", 1 }, 
-  { "f.10", 10 }, 
-  { "f.11", 11 }, 
-  { "f.12", 12 }, 
-  { "f.13", 13 }, 
-  { "f.14", 14 }, 
-  { "f.15", 15 }, 
-  { "f.16", 16 }, 
-  { "f.17", 17 }, 
-  { "f.18", 18 }, 
-  { "f.19", 19 }, 
-  { "f.2", 2 }, 
-  { "f.20", 20 }, 
-  { "f.21", 21 }, 
-  { "f.22", 22 }, 
-  { "f.23", 23 }, 
-  { "f.24", 24 }, 
-  { "f.25", 25 }, 
-  { "f.26", 26 }, 
-  { "f.27", 27 }, 
-  { "f.28", 28 }, 
-  { "f.29", 29 }, 
-  { "f.3", 3 }, 
+  { "f.1", 1 },
+  { "f.10", 10 },
+  { "f.11", 11 },
+  { "f.12", 12 },
+  { "f.13", 13 },
+  { "f.14", 14 },
+  { "f.15", 15 },
+  { "f.16", 16 },
+  { "f.17", 17 },
+  { "f.18", 18 },
+  { "f.19", 19 },
+  { "f.2", 2 },
+  { "f.20", 20 },
+  { "f.21", 21 },
+  { "f.22", 22 },
+  { "f.23", 23 },
+  { "f.24", 24 },
+  { "f.25", 25 },
+  { "f.26", 26 },
+  { "f.27", 27 },
+  { "f.28", 28 },
+  { "f.29", 29 },
+  { "f.3", 3 },
   { "f.30", 30 },
   { "f.31", 31 },
-  { "f.4", 4 }, 
-  { "f.5", 5 }, 
-  { "f.6", 6 }, 
-  { "f.7", 7 }, 
-  { "f.8", 8 }, 
-  { "f.9", 9 }, 
-
-  { "f0", 0 }, 
-  { "f1", 1 }, 
-  { "f10", 10 }, 
-  { "f11", 11 }, 
-  { "f12", 12 }, 
-  { "f13", 13 }, 
-  { "f14", 14 }, 
-  { "f15", 15 }, 
-  { "f16", 16 }, 
-  { "f17", 17 }, 
-  { "f18", 18 }, 
-  { "f19", 19 }, 
-  { "f2", 2 }, 
-  { "f20", 20 }, 
-  { "f21", 21 }, 
-  { "f22", 22 }, 
-  { "f23", 23 }, 
-  { "f24", 24 }, 
-  { "f25", 25 }, 
-  { "f26", 26 }, 
-  { "f27", 27 }, 
-  { "f28", 28 }, 
-  { "f29", 29 }, 
-  { "f3", 3 }, 
+  { "f.4", 4 },
+  { "f.5", 5 },
+  { "f.6", 6 },
+  { "f.7", 7 },
+  { "f.8", 8 },
+  { "f.9", 9 },
+
+  { "f0", 0 },
+  { "f1", 1 },
+  { "f10", 10 },
+  { "f11", 11 },
+  { "f12", 12 },
+  { "f13", 13 },
+  { "f14", 14 },
+  { "f15", 15 },
+  { "f16", 16 },
+  { "f17", 17 },
+  { "f18", 18 },
+  { "f19", 19 },
+  { "f2", 2 },
+  { "f20", 20 },
+  { "f21", 21 },
+  { "f22", 22 },
+  { "f23", 23 },
+  { "f24", 24 },
+  { "f25", 25 },
+  { "f26", 26 },
+  { "f27", 27 },
+  { "f28", 28 },
+  { "f29", 29 },
+  { "f3", 3 },
   { "f30", 30 },
   { "f31", 31 },
-  { "f4", 4 }, 
-  { "f5", 5 }, 
-  { "f6", 6 }, 
-  { "f7", 7 }, 
-  { "f8", 8 }, 
-  { "f9", 9 }, 
+  { "f4", 4 },
+  { "f5", 5 },
+  { "f6", 6 },
+  { "f7", 7 },
+  { "f8", 8 },
+  { "f9", 9 },
 
   { "fpscr", 0 },
 
@@ -438,6 +440,74 @@ static const struct pd_reg pre_defined_registers[] =
 
   { "xer", 1 },
 
+  { "v.0", 0 },     /* Vector registers */
+  { "v.1", 1 },
+  { "v.10", 10 },
+  { "v.11", 11 },
+  { "v.12", 12 },
+  { "v.13", 13 },
+  { "v.14", 14 },
+  { "v.15", 15 },
+  { "v.16", 16 },
+  { "v.17", 17 },
+  { "v.18", 18 },
+  { "v.19", 19 },
+  { "v.2", 2 },
+  { "v.20", 20 },
+  { "v.21", 21 },
+  { "v.22", 22 },
+  { "v.23", 23 },
+  { "v.24", 24 },
+  { "v.25", 25 },
+  { "v.26", 26 },
+  { "v.27", 27 },
+  { "v.28", 28 },
+  { "v.29", 29 },
+  { "v.3", 3 },
+  { "v.30", 30 },
+  { "v.31", 31 },
+  { "v.4", 4 },
+  { "v.5", 5 },
+  { "v.6", 6 },
+  { "v.7", 7 },
+  { "v.8", 8 },
+  { "v.9", 9 },
+
+  { "v0", 0 },
+  { "v1", 1 },
+  { "v10", 10 },
+  { "v11", 11 },
+  { "v12", 12 },
+  { "v13", 13 },
+  { "v14", 14 },
+  { "v15", 15 },
+  { "v16", 16 },
+  { "v17", 17 },
+  { "v18", 18 },
+  { "v19", 19 },
+  { "v2", 2 },
+  { "v20", 20 },
+  { "v21", 21 },
+  { "v22", 22 },
+  { "v23", 23 },
+  { "v24", 24 },
+  { "v25", 25 },
+  { "v26", 26 },
+  { "v27", 27 },
+  { "v28", 28 },
+  { "v29", 29 },
+  { "v3", 3 },
+  { "v30", 30 },
+  { "v31", 31 },
+  { "v4", 4 },
+  { "v5", 5 },
+  { "v6", 6 },
+  { "v7", 7 },
+  { "v8", 8 },
+  { "v9", 9 },
+
+  { "vrsave", 256 },
+
 };
 
 #define REG_NAME_CNT	(sizeof(pre_defined_registers) / sizeof(struct pd_reg))
@@ -509,11 +579,11 @@ register_name (expressionP)
   reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name);
 
   /* look to see if it's in the register table */
-  if (reg_number >= 0) 
+  if (reg_number >= 0)
     {
       expressionP->X_op = O_register;
       expressionP->X_add_number = reg_number;
-      
+
       /* make the rest nice */
       expressionP->X_add_symbol = NULL;
       expressionP->X_op_symbol = NULL;
@@ -769,6 +839,11 @@ md_parse_option (c, arg)
 	  ppc_cpu = PPC_OPCODE_PPC;
 	  ppc_size = PPC_OPCODE_64;
 	}
+      else if (strcmp (arg, "ppc64bridge") == 0)
+	{
+	  ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE;
+	  ppc_size = PPC_OPCODE_64;
+	}
       /* -mcom means assemble for the common intersection between Power
 	 and PowerPC.  At present, we just allow the union, rather
 	 than the intersection.  */
@@ -777,6 +852,8 @@ md_parse_option (c, arg)
       /* -many means to assemble for any architecture (PWR/PWRX/PPC).  */
       else if (strcmp (arg, "any") == 0)
 	ppc_cpu = PPC_OPCODE_ANY;
+      else if (strcmp (arg, "vec") == 0 || strcmp(arg, "altivec") == 0)
+	ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_VEC;
 
       else if (strcmp (arg, "regnames") == 0)
 	reg_names_p = true;
@@ -875,6 +952,8 @@ PowerPC options:\n\
 -mppc, -mppc32, -m403, -m603, -m604\n\
 			generate code for Motorola PowerPC 603/604\n\
 -mppc64, -m620		generate code for Motorola PowerPC 620\n\
+-mvec, -maltivec	generate code for AltiVec instructions\n\
+-mppc64bridge		generate code for PowerPC 64, including bridge insns\n\
 -mcom			generate code Power/PowerPC common instructions\n\
 -many			generate code for any architecture (PWR/PWRX/PPC)\n\
 -mregnames		Allow symbolic names for registers\n\
@@ -975,7 +1054,8 @@ md_begin ()
 
       if ((op->flags & ppc_cpu) != 0
 	  && ((op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == 0
-	      || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size))
+	      || (op->flags & (PPC_OPCODE_32 | PPC_OPCODE_64)) == ppc_size
+	      || (ppc_cpu & PPC_OPCODE_64_BRIDGE) != 0))
 	{
 	  const char *retval;
 
@@ -1037,7 +1117,7 @@ md_begin ()
 #ifdef TE_PE
 
   ppc_current_section = text_section;
-  ppc_previous_section = 0;  
+  ppc_previous_section = 0;
 
 #endif
 }
@@ -1059,8 +1139,7 @@ ppc_insert_operand (insn, operand, val, file, line)
 
       if ((operand->flags & PPC_OPERAND_SIGNED) != 0)
 	{
-	  if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0
-	      && ppc_size == PPC_OPCODE_32)
+	  if ((operand->flags & PPC_OPERAND_SIGNOPT) != 0)
 	    max = (1 << operand->bits) - 1;
 	  else
 	    max = (1 << (operand->bits - 1)) - 1;
@@ -1188,6 +1267,13 @@ ppc_elf_suffix (str_p, exp_p)
     MAP ("bitfld",	BFD_RELOC_PPC_EMB_BIT_FLD),
     MAP ("relsda",	BFD_RELOC_PPC_EMB_RELSDA),
     MAP ("xgot",	BFD_RELOC_PPC_TOC16),
+    MAP ("drel",	BFD_RELOC_PPC_MORPHOS_DREL),
+    MAP ("drell",	BFD_RELOC_PPC_MORPHOS_DREL_LO),
+    MAP ("drelh",	BFD_RELOC_PPC_MORPHOS_DREL_HI),
+    MAP ("drelha",	BFD_RELOC_PPC_MORPHOS_DREL_HA),
+    MAP ("drel@l",	BFD_RELOC_PPC_MORPHOS_DREL_LO),
+    MAP ("drel@h",	BFD_RELOC_PPC_MORPHOS_DREL_HI),
+    MAP ("drel@ha",	BFD_RELOC_PPC_MORPHOS_DREL_HA),
 
     { (char *)0,	0,	BFD_RELOC_UNUSED }
   };
@@ -1278,7 +1364,7 @@ ppc_elf_cons (nbytes)
 	      register char *p = frag_more ((int) nbytes);
 	      int offset = nbytes - size;
 
-	      fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc);
+	      fix_new_exp (frag_now, p - frag_now->fr_literal + offset, size, &exp, 0, reloc, 0);
 	    }
 	}
       else
@@ -1446,6 +1532,7 @@ ppc_elf_validate_fix (fixp, seg)
 	  && strcmp (segment_name (seg), ".fixup") != 0
 	  && strcmp (segment_name (seg), ".stab") != 0
 	  && strcmp (segment_name (seg), ".gcc_except_table") != 0
+	  && strcmp (segment_name (seg), ".eh_frame") != 0
 	  && strcmp (segment_name (seg), ".ex_shared") != 0)
 	{
 	  if ((seg->flags & (SEC_READONLY | SEC_CODE)) != 0
@@ -1471,7 +1558,7 @@ ppc_elf_validate_fix (fixp, seg)
  *
  *      Anything else is an error of one kind or another.
  *
- * out:	
+ * out:
  *   return value: success or failure
  *   toc_kind:     kind of toc reference
  *   input_line_pointer:
@@ -1487,8 +1574,8 @@ ppc_elf_validate_fix (fixp, seg)
  *
  */
 
-enum toc_size_qualifier 
-{ 
+enum toc_size_qualifier
+{
   default_toc, /* The toc cell constructed should be the system default size */
   data_in_toc, /* This is a direct reference to a toc cell                   */
   must_be_32,  /* The toc cell constructed must be 32 bits wide              */
@@ -1510,24 +1597,24 @@ parse_toc_entry(toc_kind)
   /* skip over the '[' , and whitespace */
   ++input_line_pointer;
   SKIP_WHITESPACE ();
-  
+
   /* find the spelling of the operand */
   toc_spec = input_line_pointer;
   c = get_symbol_end ();
 
-  if (strcmp(toc_spec, "toc") == 0) 
+  if (strcmp(toc_spec, "toc") == 0)
     {
       t = default_toc;
     }
-  else if (strcmp(toc_spec, "tocv") == 0) 
+  else if (strcmp(toc_spec, "tocv") == 0)
     {
       t = data_in_toc;
     }
-  else if (strcmp(toc_spec, "toc32") == 0) 
+  else if (strcmp(toc_spec, "toc32") == 0)
     {
       t = must_be_32;
     }
-  else if (strcmp(toc_spec, "toc64") == 0) 
+  else if (strcmp(toc_spec, "toc64") == 0)
     {
       t = must_be_64;
     }
@@ -1656,7 +1743,7 @@ md_assemble (str)
 	  /* If there are fewer operands in the line then are called
 	     for by the instruction, we want to skip the optional
 	     operand.  */
-	  if (opcount < strlen (opcode->operands))
+	  if (opcount < strlen ((const char *) opcode->operands))
 	    skip_optional = 1;
 
 	  break;
@@ -1716,13 +1803,13 @@ md_assemble (str)
       input_line_pointer = str;
 
 #ifdef TE_PE
-      if (*input_line_pointer == '[') 
+      if (*input_line_pointer == '[')
 	{
 	  /* We are expecting something like the second argument here:
 
-	        lwz r4,[toc].GS.0.static_int(rtoc)
+		lwz r4,[toc].GS.0.static_int(rtoc)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-	     The argument following the `]' must be a symbol name, and the 
+	     The argument following the `]' must be a symbol name, and the
              register must be the toc register: 'rtoc' or '2'
 
 	     The effect is to 0 as the displacement field
@@ -1738,7 +1825,7 @@ md_assemble (str)
 	       there are also toc entries that are specified to be
 	       either 32 or 64 bits:
                  lwz r4,[toc32].GS.0.static_int(rtoc)
-	         lwz r4,[toc64].GS.0.static_int(rtoc)
+		 lwz r4,[toc64].GS.0.static_int(rtoc)
 	       These demand toc entries of the specified size, and the
 	       instruction probably requires it.
           */
@@ -1750,7 +1837,7 @@ md_assemble (str)
 	  /* go parse off the [tocXX] part */
 	  valid_toc = parse_toc_entry(&toc_kind);
 
-	  if (!valid_toc) 
+	  if (!valid_toc)
 	    {
 	      /* Note: message has already been issued.     */
 	      /* FIXME: what sort of recovery should we do? */
@@ -1776,8 +1863,8 @@ md_assemble (str)
 	      /* FIXME: It's a little confusing what the tocv qualifier can */
 	      /*        be used for. At the very least, I've seen three     */
 	      /*        uses, only one of which I'm sure I can explain.     */
-	      if (ex.X_op == O_symbol) 
-		{		  
+	      if (ex.X_op == O_symbol)
+		{
 		  assert (ex.X_add_symbol != NULL);
 		  if (ex.X_add_symbol->bsym->section != tocdata_section)
 		    {
@@ -1800,7 +1887,7 @@ md_assemble (str)
 	      as_bad ("Unimplemented toc64 expression modifier");
 	      break;
 	    default:
-	      fprintf(stderr, 
+	      fprintf(stderr,
 		      "Unexpected return value [%d] from parse_toc_entry!\n",
 		      toc_kind);
 	      abort();
@@ -1880,8 +1967,9 @@ md_assemble (str)
 		break;
 
 	      case BFD_RELOC_HI16_S:
-		ex.X_add_number = (((ex.X_add_number >> 16) & 0xffff)
-				   + ((ex.X_add_number >> 15) & 1));
+		ex.X_add_number = ((((ex.X_add_number >> 16) & 0xffff)
+				    + ((ex.X_add_number >> 15) & 1))
+				   & 0xffff);
 		break;
 	      }
 #endif
@@ -2000,7 +2088,7 @@ md_assemble (str)
 
 	  fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, size,
 			      &fixups[i].exp, reloc_howto->pc_relative,
-			      fixups[i].reloc);
+			      fixups[i].reloc, 0);
 
 	  /* Turn off complaints that the addend is too large for things like
 	     foo+100000@ha.  */
@@ -2011,6 +2099,9 @@ md_assemble (str)
 	    case BFD_RELOC_LO16:
 	    case BFD_RELOC_HI16:
 	    case BFD_RELOC_HI16_S:
+	    case BFD_RELOC_PPC_MORPHOS_DREL_LO:
+	    case BFD_RELOC_PPC_MORPHOS_DREL_HI:
+	    case BFD_RELOC_PPC_MORPHOS_DREL_HA:
 	      fixP->fx_no_overflow = 1;
 	      break;
 	    default:
@@ -2022,7 +2113,7 @@ md_assemble (str)
 		     &fixups[i].exp,
 		     (operand->flags & PPC_OPERAND_RELATIVE) != 0,
 		     ((bfd_reloc_code_real_type)
-		       (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+		       (fixups[i].opindex + (int) BFD_RELOC_UNUSED)),0);
     }
 }
 
@@ -2080,7 +2171,7 @@ ppc_macro (str, macro)
       if (s == (char *) NULL)
 	break;
       *s++ = '\0';
-    }  
+    }
 
   if (count != macro->operands)
     {
@@ -2127,7 +2218,7 @@ ppc_macro (str, macro)
 
   /* Assemble the constructed instruction.  */
   md_assemble (complete);
-}  
+}
 
 #ifdef OBJ_ELF
 /* For ELF, add support for SHF_EXCLUDE and SHT_ORDERED */
@@ -2316,7 +2407,7 @@ ppc_comm (lcomm)
 
       lcomm_name = input_line_pointer;
       lcomm_endc = get_symbol_end ();
-      
+
       lcomm_sym = symbol_find_or_make (lcomm_name);
 
       *input_line_pointer = lcomm_endc;
@@ -2333,9 +2424,9 @@ ppc_comm (lcomm)
       ignore_rest_of_line ();
       return;
     }
-    
+
   record_alignment (bss_section, align);
-	  
+
   if (! lcomm
       || ! S_IS_DEFINED (lcomm_sym))
     {
@@ -2357,7 +2448,7 @@ ppc_comm (lcomm)
 
       subseg_set (bss_section, 1);
       frag_align (align, 0, 0);
-  
+
       def_sym->sy_frag = frag_now;
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, def_sym,
 			def_size, (char *) NULL);
@@ -2405,7 +2496,7 @@ ppc_csect (ignore)
 
   name = input_line_pointer;
   endc = get_symbol_end ();
-  
+
   sym = symbol_find_or_make (name);
 
   *input_line_pointer = endc;
@@ -2499,13 +2590,13 @@ ppc_change_csect (sym)
       sym->sy_tc.align = 2;
       sym->sy_tc.output = 1;
       sym->sy_tc.within = sym;
-	  
+
       for (list = *list_ptr;
 	   list->sy_tc.next != (symbolS *) NULL;
 	   list = list->sy_tc.next)
 	;
       list->sy_tc.next = sym;
-	  
+
       symbol_remove (sym, &symbol_rootP, &symbol_lastP);
       symbol_append (sym, list->sy_tc.within, &symbol_rootP, &symbol_lastP);
     }
@@ -2928,7 +3019,7 @@ ppc_biei (ei)
 
   S_SET_STORAGE_CLASS (sym, ei ? C_EINCL : C_BINCL);
   sym->sy_tc.output = 1;
-  
+
   for (look = last_biei ? last_biei : symbol_rootP;
        (look != (symbolS *) NULL
 	&& (S_GET_STORAGE_CLASS (look) == C_FILE
@@ -3117,7 +3208,7 @@ ppc_toc (ignore)
       subsegT subseg;
       symbolS *sym;
       symbolS *list;
-    
+
       subseg = ppc_data_subsegment;
       ++ppc_data_subsegment;
 
@@ -3133,7 +3224,7 @@ ppc_toc (ignore)
       sym->sy_tc.within = sym;
 
       ppc_toc_csect = sym;
-	  
+
       for (list = ppc_data_csects;
 	   list->sy_tc.next != (symbolS *) NULL;
 	   list = list->sy_tc.next)
@@ -3282,7 +3373,7 @@ ppc_previous(ignore)
 {
   symbolS *tmp;
 
-  if (ppc_previous_section == NULL) 
+  if (ppc_previous_section == NULL)
     {
       as_warn("No previous section to return to. Directive ignored.");
       return;
@@ -3313,14 +3404,14 @@ static void
 ppc_pdata(ignore)
      int ignore;
 {
-  if (pdata_section == 0) 
+  if (pdata_section == 0)
     {
       pdata_section = subseg_new (".pdata", 0);
-      
+
       bfd_set_section_flags (stdoutput, pdata_section,
 			     (SEC_ALLOC | SEC_LOAD | SEC_RELOC
 			      | SEC_READONLY | SEC_DATA ));
-      
+
       bfd_set_section_alignment (stdoutput, pdata_section, 2);
     }
   else
@@ -3348,7 +3439,7 @@ static void
 ppc_ydata(ignore)
      int ignore;
 {
-  if (ydata_section == 0) 
+  if (ydata_section == 0)
     {
       ydata_section = subseg_new (".ydata", 0);
       bfd_set_section_flags (stdoutput, ydata_section,
@@ -3390,7 +3481,7 @@ ppc_reldata(ignore)
       reldata_section = subseg_new (".reldata", 0);
 
       bfd_set_section_flags (stdoutput, reldata_section,
-			     ( SEC_ALLOC | SEC_LOAD | SEC_RELOC 
+			     ( SEC_ALLOC | SEC_LOAD | SEC_RELOC
 			      | SEC_DATA ));
 
       bfd_set_section_alignment (stdoutput, reldata_section, 2);
@@ -3433,7 +3524,7 @@ ppc_rdata(ignore)
 }
 
 /* pseudo-op: .ualong
-   behaviour: much like .int, with the exception that no alignment is 
+   behaviour: much like .int, with the exception that no alignment is
               performed.
 	      FIXME: test the alignment statement
    errors:    None
@@ -3504,10 +3595,10 @@ ppc_znop(ignore)
 
 }
 
-/* pseudo-op: 
-   behaviour: 
-   errors:    
-   warnings:  
+/* pseudo-op:
+   behaviour:
+   errors:
+   warnings:
 */
 static void
 ppc_pe_comm(lcomm)
@@ -3607,7 +3698,7 @@ ppc_pe_comm(lcomm)
  * additions/changes for the moto-pas assembler support. There are three
  * categories:
  *
- * FIXME: I just noticed this. This doesn't work at all really. It it 
+ * FIXME: I just noticed this. This doesn't work at all really. It it
  *        setting bits that bfd probably neither understands or uses. The
  *        correct approach (?) will have to incorporate extra fields attached
  *        to the section to hold the system specific stuff. (krk)
@@ -3706,7 +3797,7 @@ ppc_pe_section (ignore)
 		  as_bad ("Unsupported section attribute -- 'a'");
 		  break;
 		case 'c': /* code section */
-		  flags |= SEC_CODE; 
+		  flags |= SEC_CODE;
 		  break;
 		case 'd': /* section has initialized data */
 		  flags |= SEC_DATA;
@@ -3722,7 +3813,7 @@ ppc_pe_section (ignore)
 		  flags |= SEC_HAS_CONTENTS;
 		  break;
 		case 'n': /* section can be discarded */
-		  flags &=~ SEC_LOAD; 
+		  flags &=~ SEC_LOAD;
 		  break;
 		case 'R': /* Remove section at link time */
 		  flags |= SEC_NEVER_LOAD;
@@ -4224,7 +4315,7 @@ ppc_frob_symbol (sym)
 	    }
 	  a->x_csect.x_smtyp = XTY_LD;
 	}
-	
+
       a->x_csect.x_parmhash = 0;
       a->x_csect.x_snhash = 0;
       if (sym->sy_tc.class == -1)
@@ -4383,7 +4474,7 @@ md_atof (type, litp, sizep)
 	  litp += 2;
 	}
     }
-     
+
   return NULL;
 }
 
@@ -4849,6 +4940,10 @@ md_apply_fix3 (fixp, valuep, seg)
 	case BFD_RELOC_PPC_EMB_RELST_HA:
 	case BFD_RELOC_PPC_EMB_RELSDA:
 	case BFD_RELOC_PPC_TOC16:
+	case BFD_RELOC_PPC_MORPHOS_DREL:
+	case BFD_RELOC_PPC_MORPHOS_DREL_LO:
+	case BFD_RELOC_PPC_MORPHOS_DREL_HI:
+	case BFD_RELOC_PPC_MORPHOS_DREL_HA:
 	  if (fixp->fx_pcrel)
 	    as_bad_where (fixp->fx_file, fixp->fx_line,
 			  "cannot emit PC relative %s relocation%s%s",
@@ -4906,7 +5001,7 @@ md_apply_fix3 (fixp, valuep, seg)
 	  {
 	    char *where;
 	    unsigned long insn;
-	    
+
 	    /* Fetch the instruction, insert the fully resolved operand
 	       value, and stuff the instruction back again.  */
 	    where = fixp->fx_frag->fr_literal + fixp->fx_where;
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index e2bcf55..b9d625f 100644
--- binutils-2.9.1.orig/gas/config/tc-ppc.h
+++ binutils-2.9.1/gas/config/tc-ppc.h
@@ -60,6 +60,11 @@ extern int target_big_endian;
 #endif
 #endif
 
+/* This is used by the Amiga to produce sun3 style a.out objects */
+#if defined(OBJ_AOUT) && defined(TE_SUN3) && 0
+#define TARGET_FORMAT "a.out-amiga"
+#endif
+
 /* PowerMac has a BFD slightly different from AIX's.  */
 #ifdef TE_POWERMAC
 #ifdef TARGET_FORMAT
@@ -69,8 +74,12 @@ extern int target_big_endian;
 #endif
 
 #ifdef OBJ_ELF
+#ifdef TE_MORPHOS
+#define TARGET_FORMAT "elf32-morphos"
+#else
 #define TARGET_FORMAT (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle")
 #endif
+#endif
 
 /* Permit temporary numeric labels.  */
 #define LOCAL_LABELS_FB 1
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index eaa6146..f5b0b43 100644
--- binutils-2.9.1.orig/gas/config/tc-sh.c
+++ binutils-2.9.1/gas/config/tc-sh.c
@@ -853,7 +853,7 @@ insert (where, how, pcrel)
 	       2,
 	       &immediate,
 	       pcrel,
-	       how);
+	       how, 0);
 }
 
 static void
@@ -1020,7 +1020,7 @@ md_assemble (str)
       /* Output a CODE reloc to tell the linker that the following
          bytes are instructions, not data.  */
       fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
-	       BFD_RELOC_SH_CODE);
+	       BFD_RELOC_SH_CODE, 0);
       seg_info (now_seg)->tc_segment_info_data.in_code = 1;
     }
 
@@ -1072,7 +1072,7 @@ sh_frob_label ()
       if (frag_now != last_label_frag
 	  || offset != last_label_offset)
 	{	
-	  fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, BFD_RELOC_SH_LABEL);
+	  fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, BFD_RELOC_SH_LABEL, 0);
 	  last_label_frag = frag_now;
 	  last_label_offset = offset;
 	}
@@ -1089,7 +1089,7 @@ sh_flush_pending_output ()
       && seg_info (now_seg)->tc_segment_info_data.in_code)
     {
       fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
-	       BFD_RELOC_SH_DATA);
+	       BFD_RELOC_SH_DATA, 0);
       seg_info (now_seg)->tc_segment_info_data.in_code = 0;
     }
 }
@@ -1202,7 +1202,7 @@ s_uses (ignore)
       return;
     }
 
-  fix_new_exp (frag_now, frag_now_fix (), 2, &ex, 1, BFD_RELOC_SH_USES);
+  fix_new_exp (frag_now, frag_now_fix (), 2, &ex, 1, BFD_RELOC_SH_USES, 0);
 
   demand_empty_rest_of_line ();
 }
@@ -1440,7 +1440,7 @@ sh_frob_section (abfd, sec, ignore)
 	 fragment address, so we undo that adjustment here.  */
       subseg_change (sec, 0);
       fix_new (sym->sy_frag, S_GET_VALUE (sym) - sym->sy_frag->fr_address,
-	       4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT);
+	       4, &abs_symbol, info.count, 0, BFD_RELOC_SH_COUNT, 0);
     }
 }
 
@@ -1492,7 +1492,7 @@ md_convert_frag (headers, seg, fragP)
     case C (COND_JUMP, COND8):
       subseg_change (seg, 0);
       fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
-	       1, BFD_RELOC_SH_PCDISP8BY2);
+	       1, BFD_RELOC_SH_PCDISP8BY2, 0);
       fragP->fr_fix += 2;
       fragP->fr_var = 0;
       break;
@@ -1500,7 +1500,7 @@ md_convert_frag (headers, seg, fragP)
     case C (UNCOND_JUMP, UNCOND12):
       subseg_change (seg, 0);
       fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset,
-	       1, BFD_RELOC_SH_PCDISP12BY2);
+	       1, BFD_RELOC_SH_PCDISP12BY2, 0);
       fragP->fr_fix += 2;
       fragP->fr_var = 0;
       break;
@@ -1578,13 +1578,13 @@ md_convert_frag (headers, seg, fragP)
 		 seg_info (seg)->dot,
 #endif
 		 fragP->fr_address + fragP->fr_fix + 6,
-		 1, BFD_RELOC_SH_PCDISP8BY2);
+		 1, BFD_RELOC_SH_PCDISP8BY2, 0);
 
 	/* Set up a jump instruction.  */
 	buffer[highbyte + 2] = 0xa0;
 	buffer[lowbyte + 2] = 0;
 	fix_new (fragP, fragP->fr_fix + 2, 2, fragP->fr_symbol,
-		 fragP->fr_offset, 1, BFD_RELOC_SH_PCDISP12BY2);
+		 fragP->fr_offset, 1, BFD_RELOC_SH_PCDISP12BY2, 0);
 
 	/* Fill in a NOP instruction.  */
 	buffer[highbyte + 4] = 0x0;
@@ -1755,7 +1755,7 @@ sh_handle_align (frag)
       && frag->fr_offset > 1
       && now_seg != bss_section)
     fix_new (frag, frag->fr_fix, 2, &abs_symbol, frag->fr_offset, 0,
-	     BFD_RELOC_SH_ALIGN);
+	     BFD_RELOC_SH_ALIGN, 0);
 
   if (frag->fr_type == rs_align_code
       && frag->fr_next->fr_address - frag->fr_address - frag->fr_fix != 0)
@@ -2115,9 +2115,9 @@ sh_do_align (n, fill, len, max)
          .byte.  */
       frag_align (1, 0, 0);
       if (target_big_endian)
-	frag_align_pattern (n, big_nop_pattern, sizeof big_nop_pattern, max);
+	frag_align_pattern (n, (const char *) big_nop_pattern, sizeof big_nop_pattern, max);
       else
-	frag_align_pattern (n, little_nop_pattern, sizeof little_nop_pattern,
+	frag_align_pattern (n, (const char *) little_nop_pattern, sizeof little_nop_pattern,
 			    max);
       return 1;
     }
diff --git a/gas/config/te-amiga.h b/gas/config/te-amiga.h
new file mode 100644
index 0000000..30903d7
--- /dev/null
+++ binutils-2.9.1/gas/config/te-amiga.h
@@ -0,0 +1,14 @@
+/*
+ * te-amiga.h -- Amiga target environment declarations.
+ */
+
+#define TE_AMIGA 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#ifdef OBJ_HEADER
+#include OBJ_HEADER
+#else
+#include "obj-format.h"
+#endif
diff --git a/gas/config/te-morphos.h b/gas/config/te-morphos.h
new file mode 100644
index 0000000..43b0826
--- /dev/null
+++ binutils-2.9.1/gas/config/te-morphos.h
@@ -0,0 +1,14 @@
+/*
+ * te-amiga.h -- Amiga target environment declarations.
+ */
+
+#define TE_MORPHOS 1
+
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#ifdef OBJ_HEADER
+#include OBJ_HEADER
+#else
+#include "obj-format.h"
+#endif
diff --git a/gas/configure b/gas/configure
index 937b289..3eb40cb 100755
--- binutils-2.9.1.orig/gas/configure
+++ binutils-2.9.1/gas/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -352,7 +352,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -522,9 +522,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -586,7 +588,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:590: checking host system type" >&5
+echo "configure:592: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -607,7 +609,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:611: checking target system type" >&5
+echo "configure:613: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -625,7 +627,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:629: checking build system type" >&5
+echo "configure:631: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -660,12 +662,12 @@ test "$host_alias" != "$target_alias" &&
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:664: checking for a BSD compatible install" >&5
+echo "configure:666: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
@@ -708,13 +710,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:718: checking whether build environment is sane" >&5
+echo "configure:722: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -771,7 +775,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:775: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:779: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -817,7 +821,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:821: checking for working aclocal" >&5
+echo "configure:825: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -830,7 +834,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:834: checking for working autoconf" >&5
+echo "configure:838: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -843,7 +847,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:847: checking for working automake" >&5
+echo "configure:851: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -856,7 +860,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:860: checking for working autoheader" >&5
+echo "configure:864: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -869,7 +873,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:873: checking for working makeinfo" >&5
+echo "configure:877: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -932,15 +936,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:936: checking for $ac_word" >&5
+echo "configure:940: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -961,15 +966,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
+echo "configure:970: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -990,16 +996,17 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:994: checking for $ac_word" >&5
+echo "configure:1000: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1034,25 +1041,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1051: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1042: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1083: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1094 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1066,18 +1109,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1076: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1125: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1081: checking whether we are using GNU C" >&5
+echo "configure:1130: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1086,7 +1135,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1097,11 +1146,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1105: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1158: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1116,16 +1169,20 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
@@ -1141,7 +1198,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1145: checking for ld used by GCC" >&5
+echo "configure:1202: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1159,10 +1216,10 @@ echo "configure:1145: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1163: checking for GNU ld" >&5
+echo "configure:1220: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1166: checking for non-GNU ld" >&5
+echo "configure:1223: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1198,7 +1255,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1202: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1259: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1214,7 +1271,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1218: checking for BSD-compatible nm" >&5
+echo "configure:1275: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1251,7 +1308,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1255: checking whether ln -s works" >&5
+echo "configure:1312: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1287,8 +1344,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1291 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1348 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1506,6 +1563,7 @@ EOF
 			    fmt=aout em=mach bfd_gas=yes ;;
       i386-*-msdos*)        fmt=aout ;;
       i386-*-moss*)	    fmt=elf ;;
+      i386-*-beos*)         fmt=coff em=pe bfd_gas=yes ;;
       i386-*-pe)            fmt=coff em=pe ;;
       i386-*-cygwin32*)     fmt=coff em=pe bfd_gas=yes ;;
       i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
@@ -1521,6 +1579,8 @@ EOF
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
+      m68*-*-amigaoshunk)   fmt=amigahunk em=amiga bfd_gas=yes ;;
+      m68*-*-amigaos*)      fmt=aout em=amiga ;;
       m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
 			    fmt=aout em=sun3 ;;
       m68k-motorola-sysv*)  fmt=coff em=delta ;;
@@ -1567,8 +1627,10 @@ EOF
 		            fmt=coff em=pe ;;
       ppc-*-aix*)           fmt=coff ;;
       ppc-*-beos*)          fmt=coff ;;
-      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
+      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4* | ppc-*-amigaos*)
 			    fmt=elf ;;
+      ppc-*-morphos*)
+			    fmt=elf em=morphos ;;
       ppc-*-linux-gnu*)	    fmt=elf
 			    case "$endian" in
 			    big)  ;;
@@ -1974,7 +2036,7 @@ EOF
 
 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
   yes-*-coff)	need_bfd=yes ;;
-  no-*-coff)	need_bfd=yes
+  no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk)	need_bfd=yes
 		cat >> confdefs.h <<\EOF
 #define MANY_SEGMENTS 1
 EOF
@@ -2045,15 +2107,16 @@ EOF
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2049: checking for $ac_word" >&5
+echo "configure:2109: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -2074,16 +2137,17 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2078: checking for $ac_word" >&5
+echo "configure:2139: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -2118,25 +2182,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2190: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2126: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2222: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 2136 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2233 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2150,18 +2250,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2160: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2264: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2165: checking whether we are using GNU C" >&5
+echo "configure:2269: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2170,7 +2276,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2181,11 +2287,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2189: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2297: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2200,33 +2310,50 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+echo $ac_n "checking for host dependent CFLAGS""... $ac_c" 1>&6
+echo "configure:2332: checking for host dependent CFLAGS" >&5
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+echo "$ac_t""$other_host_cflags" 1>&6
+### end-GG-local
+
 for ac_prog in 'bison -y' byacc
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2222: checking for $ac_word" >&5
+echo "configure:2346: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -2250,15 +2377,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2254: checking for $ac_word" >&5
+echo "configure:2379: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -2283,7 +2411,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:2287: checking for yywrap in -l$ac_lib" >&5
+echo "configure:2413: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2291,7 +2419,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2295 "configure"
+#line 2421 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2302,7 +2430,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2325,7 +2453,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2329: checking how to run the C preprocessor" >&5
+echo "configure:2455: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2340,14 +2468,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2344 "configure"
+#line 2470 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -2357,14 +2485,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2361 "configure"
+#line 2487 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2504 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -2377,6 +2522,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -2386,7 +2533,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:2390: checking lex output file root" >&5
+echo "configure:2535: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2407,7 +2554,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:2411: checking whether yytext is a pointer" >&5
+echo "configure:2556: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2419,14 +2566,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 2423 "configure"
+#line 2568 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -2449,7 +2596,7 @@ fi
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2453: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2598: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -2467,19 +2614,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:2471: checking for Cygwin32 environment" >&5
+echo "configure:2616: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2476 "configure"
+#line 2621 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:2483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -2496,19 +2643,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:2500: checking for Mingw32 environment" >&5
+echo "configure:2645: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2505 "configure"
+#line 2650 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -2527,7 +2674,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2531: checking for executable suffix" >&5
+echo "configure:2676: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2555,18 +2702,18 @@ for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h e
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2559: checking for $ac_hdr" >&5
+echo "configure:2704: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2564 "configure"
+#line 2709 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2595,7 +2742,7 @@ done
 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
 # people who are not cross-compiling but are compiling cross-assemblers.
 echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6
-echo "configure:2599: checking whether compiling a cross-assembler" >&5
+echo "configure:2744: checking whether compiling a cross-assembler" >&5
 if test "${host}" = "${target}"; then
   cross_gas=no
 else
@@ -2610,19 +2757,19 @@ echo "$ac_t""$cross_gas" 1>&6
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2614: checking for working alloca.h" >&5
+echo "configure:2759: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2619 "configure"
+#line 2764 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:2626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -2643,25 +2790,30 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2647: checking for alloca" >&5
+echo "configure:2792: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2652 "configure"
+#line 2797 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
 # else
-#  ifdef _AIX
- #pragma alloca
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
 #  else
-#   ifndef alloca /* predefined by HP cc +Olibcalls */
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#    endif
 #   endif
 #  endif
 # endif
@@ -2671,7 +2823,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -2696,19 +2848,19 @@ if test $ac_cv_func_alloca_works = no; then
   # that cause trouble.  Some versions do not even contain alloca or
   # contain a buggy version.  If you still want to use their alloca,
   # use ar to extract alloca.o from them instead of compiling alloca.c.
-  ALLOCA=alloca.o
+  ALLOCA=alloca.${ac_objext}
   cat >> confdefs.h <<\EOF
 #define C_ALLOCA 1
 EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2707: checking whether alloca needs Cray hooks" >&5
+echo "configure:2857: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2712 "configure"
+#line 2862 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -2733,12 +2885,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2737: checking for $ac_func" >&5
+echo "configure:2887: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2742 "configure"
+#line 2892 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2761,7 +2913,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2788,7 +2940,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2792: checking stack direction for C alloca" >&5
+echo "configure:2942: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2796,7 +2948,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 2800 "configure"
+#line 2950 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -2815,7 +2967,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -2837,21 +2989,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2841: checking for inline" >&5
+echo "configure:2991: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2848 "configure"
+#line 2998 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2881,12 +3033,12 @@ esac
 for ac_func in unlink remove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2885: checking for $ac_func" >&5
+echo "configure:3035: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2890 "configure"
+#line 3040 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2909,7 +3061,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2938,12 +3090,12 @@ done
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2942: checking for $ac_func" >&5
+echo "configure:3092: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2947 "configure"
+#line 3097 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2966,7 +3118,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2995,12 +3147,12 @@ done
 # enough, but on some of those systems, the assert macro relies on requoting
 # working properly!
 echo $ac_n "checking for working assert macro""... $ac_c" 1>&6
-echo "configure:2999: checking for working assert macro" >&5
+echo "configure:3149: checking for working assert macro" >&5
 if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3004 "configure"
+#line 3154 "configure"
 #include "confdefs.h"
 #include <assert.h>
 #include <stdio.h>
@@ -3016,7 +3168,7 @@ assert (a == b
 
 ; return 0; }
 EOF
-if { (eval echo configure:3020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_assert_ok=yes
 else
@@ -3057,12 +3209,12 @@ gas_test_headers="
 "
 
 echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
-echo "configure:3061: checking whether declaration is required for strstr" >&5
+echo "configure:3211: checking whether declaration is required for strstr" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3066 "configure"
+#line 3216 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3073,7 +3225,7 @@ x = (f) strstr;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_strstr=no
 else
@@ -3094,12 +3246,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
-echo "configure:3098: checking whether declaration is required for malloc" >&5
+echo "configure:3248: checking whether declaration is required for malloc" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+#line 3253 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3110,7 +3262,7 @@ x = (f) malloc;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_malloc=no
 else
@@ -3131,12 +3283,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
-echo "configure:3135: checking whether declaration is required for free" >&5
+echo "configure:3285: checking whether declaration is required for free" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3140 "configure"
+#line 3290 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3147,7 +3299,7 @@ x = (f) free;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_free=no
 else
@@ -3168,12 +3320,12 @@ EOF
 
 
 echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
-echo "configure:3172: checking whether declaration is required for sbrk" >&5
+echo "configure:3322: checking whether declaration is required for sbrk" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3177 "configure"
+#line 3327 "configure"
 #include "confdefs.h"
 $gas_test_headers
 int main() {
@@ -3184,7 +3336,7 @@ x = (f) sbrk;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_sbrk=no
 else
@@ -3208,12 +3360,12 @@ EOF
 # for it?
 
 echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
-echo "configure:3212: checking whether declaration is required for errno" >&5
+echo "configure:3362: checking whether declaration is required for errno" >&5
 if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3217 "configure"
+#line 3367 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_ERRNO_H
@@ -3228,7 +3380,7 @@ x = (f) errno;
 
 ; return 0; }
 EOF
-if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gas_cv_decl_needed_errno=no
 else
@@ -3273,7 +3425,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -3340,7 +3492,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -3364,6 +3516,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -3398,8 +3551,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
diff --git a/gas/configure.in b/gas/configure.in
index ebb6202..2fda4a4 100644
--- binutils-2.9.1.orig/gas/configure.in
+++ binutils-2.9.1/gas/configure.in
@@ -177,6 +177,7 @@ changequote([,])dnl
 			    fmt=aout em=mach bfd_gas=yes ;;
       i386-*-msdos*)        fmt=aout ;;
       i386-*-moss*)	    fmt=elf ;;
+      i386-*-beos*)         fmt=coff em=pe bfd_gas=yes ;;
       i386-*-pe)            fmt=coff em=pe ;;
       i386-*-cygwin32*)     fmt=coff em=pe bfd_gas=yes ;;
       i386-*-mingw32*)      fmt=coff em=pe bfd_gas=yes ;;
@@ -192,6 +193,8 @@ changequote([,])dnl
 
       m32r-*-*)		    fmt=elf bfd_gas=yes ;;
 
+      m68*-*-amigaoshunk)   fmt=amigahunk em=amiga bfd_gas=yes ;;
+      m68*-*-amigaos*)      fmt=aout em=amiga ;;
       m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
 			    fmt=aout em=sun3 ;;
       m68k-motorola-sysv*)  fmt=coff em=delta ;;
@@ -238,8 +241,10 @@ changequote([,])dnl
 		            fmt=coff em=pe ;;
       ppc-*-aix*)           fmt=coff ;;
       ppc-*-beos*)          fmt=coff ;;
-      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
+      ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4* | ppc-*-amigaos*)
 			    fmt=elf ;;
+      ppc-*-morphos*)
+			    fmt=elf em=morphos ;;
       ppc-*-linux-gnu*)	    fmt=elf
 			    case "$endian" in
 			    big)  ;;
@@ -555,7 +560,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
 
 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
   yes-*-coff)	need_bfd=yes ;;
-  no-*-coff)	need_bfd=yes
+  no-*-coff | yes-m68k-amigahunk | no-m68k-amigahunk)	need_bfd=yes
 		AC_DEFINE(MANY_SEGMENTS) ;;
 esac
 
@@ -605,6 +610,17 @@ AC_DEFINE_UNQUOTED(TARGET_OS,		"${target_os}")
 
 AC_PROG_CC
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+AC_MSG_CHECKING(for host dependent CFLAGS)
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+AC_MSG_RESULT($other_host_cflags)
+### end-GG-local
+
 AC_PROG_YACC
 AC_PROG_LEX
 AC_DECL_YYTEXT
diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in
index d9ee2b2..53af7f7 100644
--- binutils-2.9.1.orig/gas/doc/Makefile.in
+++ binutils-2.9.1/gas/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -123,33 +129,46 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = as.info gasp.info
 DVIS = as.dvi gasp.dvi
 TEXINFOS = as.texinfo gasp.texi
-MANS = as.1
+GUIDES = as.guide gasp.guide
+GUIDE_DEPS = as.guide gasp.guide
+HTMLS = as.html gasp.html
+HTML_DEPS = as.html gasp.html
+PS_S = as.ps gasp.ps
+PS_DEPS = as.ps gasp.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  Makefile.am Makefile.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
-default: all
+all: Makefile $(MANS)
 
 .SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
+.SUFFIXES: .dvi .guide .html .info .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps doc/Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 
 as.info: as.texinfo
+as.guide: as.texinfo
+as.html: as.texinfo
+as.ps: as.dvi
 as.dvi: as.texinfo
 
 
 gasp.info: gasp.texi
+gasp.guide: gasp.texi
+gasp.html: gasp.texi
+gasp.ps: gasp.dvi
 gasp.dvi: gasp.texi
 
 
@@ -157,7 +176,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -165,39 +184,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -208,11 +239,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -225,13 +256,155 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps as.log \
+	  as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr as.cv \
+	  as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps \
 	  as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr \
-	  as.cv as.cn gasp.aux gasp.cp gasp.cps gasp.dvi gasp.fn \
-	  gasp.fns gasp.ky gasp.kys gasp.ps gasp.log gasp.pg gasp.toc \
-	  gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op gasp.tr gasp.cv \
-	  gasp.cn
+	  as.cv as.cn as.guide as.html as.ps gasp.aux gasp.cp gasp.cps \
+	  gasp.dvi gasp.fn gasp.fns gasp.ky gasp.kys gasp.ps gasp.log \
+	  gasp.pg gasp.toc gasp.tp gasp.tps gasp.vr gasp.vrs gasp.op \
+	  gasp.tr gasp.cv gasp.cn gasp.guide gasp.html gasp.ps
 
 clean-aminfo:
 
@@ -245,21 +418,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "as" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/as.1; then file=$(srcdir)/as.1; \
-	else file=as.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "as" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 tags: TAGS
 TAGS:
 
@@ -277,6 +474,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -293,12 +493,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-man
 
-all: Makefile $(MANS)
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(mandir)/man1
+	$(mkinstalldirs)  $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -315,24 +513,34 @@ distclean-generic:
 maintainer-clean-generic:
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean:  mostlyclean-aminfo mostlyclean-generic
+mostlyclean:  mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-generic
 
-clean:  clean-aminfo clean-generic mostlyclean
+clean:  clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-generic mostlyclean
 
-distclean:  distclean-aminfo distclean-generic clean
+distclean:  distclean-aminfo distclean-guide distclean-html \
+		distclean-dvi distclean-ps distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
-maintainer-clean:  maintainer-clean-aminfo maintainer-clean-generic \
-		distclean
+maintainer-clean:  maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man \
-uninstall-man tags distdir info dvi installcheck install-info \
-install-exec install-data install uninstall all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
+.PHONY: install-info-am uninstall-info install-guide uninstall-guide \
+install-ps uninstall-ps install-html uninstall-html install-dvi \
+uninstall-dvi mostlyclean-guide distclean-guide clean-guide \
+maintainer-clean-guide mostlyclean-html distclean-html clean-html \
+maintainer-clean-html mostlyclean-ps distclean-ps clean-ps \
+maintainer-clean-ps mostlyclean-dvi distclean-dvi clean-dvi \
+maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo clean-aminfo \
+maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
+uninstall-man tags distdir info guide html ps dvi installcheck \
+install-info install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index eb9f44b..f5c5d02 100644
--- binutils-2.9.1.orig/gas/doc/internals.texi
+++ binutils-2.9.1/gas/doc/internals.texi
@@ -8,7 +8,7 @@
 This chapter describes the internals of the assembler.  It is incomplete, but
 it may help a bit.
 
-This chapter was last modified on $Date: 1998/02/06 03:42:57 $.  It is not updated regularly, and it
+This chapter was last modified on $Date: 2005/03/15 16:00:32 $.  It is not updated regularly, and it
 may be out of date.
 
 @menu
diff --git a/gas/itbl-lex.c b/gas/itbl-lex.c
index d27f012..5faafe1 100644
--- binutils-2.9.1.orig/gas/itbl-lex.c
+++ binutils-2.9.1/gas/itbl-lex.c
@@ -1,7 +1,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
+ * $Header: /home/cvs/root/morphos/morphoswb/development/binutils/gas/itbl-lex.c,v 1.1.1.1 2005/03/15 16:00:29 laire Exp $
  */
 
 #define FLEX_SCANNER
diff --git a/gas/itbl-parse.c b/gas/itbl-parse.c
index 8f2d78e..7c51031 100644
--- binutils-2.9.1.orig/gas/itbl-parse.c
+++ binutils-2.9.1/gas/itbl-parse.c
@@ -455,10 +455,10 @@ static const short yycheck[] = {     0,
    in version 1.24 of Bison.  */
 
 #ifndef alloca
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 #define alloca __builtin_alloca
 #else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA)
 #include <alloca.h>
 #else /* not sparc */
 #if defined (MSDOS) && !defined (__TURBOC__)
diff --git a/gas/read.c b/gas/read.c
index cde61bb..bbf3d77 100644
--- binutils-2.9.1.orig/gas/read.c
+++ binutils-2.9.1/gas/read.c
@@ -29,6 +29,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define MASK_CHAR ((int)(unsigned char)-1)
 #endif
 
+void gcc_fucking_sucks()
+{
+}
 
 /* This is the largest known floating point format (for now). It will
    grow when we do 4361 style flonums. */
@@ -53,6 +56,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define TC_START_LABEL(x,y) (x==':')
 #endif
 
+#ifdef OBJ_AMIGAHUNK
+extern segT data_chip_section, bss_chip_section;
+#endif
+
 /* The NOP_OPCODE is for the alignment fill value.
  * fill it a nop instruction so that the disassembler does not choke
  * on it
@@ -260,6 +267,9 @@ static const pseudo_typeS potable[] =
   {"common", s_mri_common, 0},
   {"common.s", s_mri_common, 1},
   {"data", s_data, 0},
+#ifdef OBJ_AMIGAHUNK
+  {"datachip", s_data_chip, 0},
+#endif
   {"dc", cons, 2},
   {"dc.b", cons, 1},
   {"dc.d", float_cons, 'd'},
@@ -1540,6 +1550,17 @@ s_data (ignore)
   demand_empty_rest_of_line ();
 }
 
+#ifdef OBJ_AMIGAHUNK
+void
+s_data_chip (ignore)
+     int ignore;
+{
+  int temp = get_absolute_expression ();
+  subseg_set (data_chip_section, (subsegT) temp);
+  demand_empty_rest_of_line ();
+}
+#endif
+
 /* Handle the .appfile pseudo-op.  This is automatically generated by
    do_scrub_chars when a preprocessor # line comment is seen with a
    file name.  This default definition may be overridden by the object
@@ -3582,7 +3603,7 @@ emit_expr (exp, nbytes)
 
 #ifdef BFD_ASSEMBLER
 #ifdef TC_CONS_FIX_NEW
-      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
+      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
 #else
       {
 	bfd_reloc_code_real_type r;
@@ -3607,12 +3628,12 @@ emit_expr (exp, nbytes)
 	    break;
 	  }
 	fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp,
-		     0, r);
+		     0, r, 0);
       }
 #endif
 #else
 #ifdef TC_CONS_FIX_NEW
-      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp);
+      TC_CONS_FIX_NEW (frag_now, p - frag_now->fr_literal, nbytes, exp, 0);
 #else
       /* Figure out which reloc number to use.  Use TC_CONS_RELOC if
 	 it is defined, otherwise use NO_RELOC if it is defined,
@@ -3625,7 +3646,7 @@ emit_expr (exp, nbytes)
 #endif
 #endif
       fix_new_exp (frag_now, p - frag_now->fr_literal, (int) nbytes, exp, 0,
-		   TC_CONS_RELOC);
+		   TC_CONS_RELOC, 0);
 #endif /* TC_CONS_FIX_NEW */
 #endif /* BFD_ASSEMBLER */
     }
@@ -4111,7 +4132,7 @@ sizeof_uleb128 (value)
   return size;
 }
 
-inline int
+int
 sizeof_leb128 (value, sign)
      valueT value;
      int sign;
@@ -4175,7 +4196,7 @@ output_uleb128 (p, value)
   return p - orig;
 }
 
-inline int
+int
 output_leb128 (p, value, sign)
      char *p;
      valueT value;
@@ -4535,10 +4556,22 @@ next_char_of_string ()
 	    long number;
 	    int i;
 
+#if 0	/* CISC: Workaround weirdo GCC bug, we should really try to fix this! */
 	    for (i = 0, number = 0; isdigit (c) && i < 3; c = *input_line_pointer++, i++)
 	      {
 		number = number * 8 + c - '0';
 	      }
+#else
+	    i = 0; number = 0;
+	    while (isdigit (c) && i < 3)
+	      {
+		number = number * 8 + c - '0';
+		c = *input_line_pointer++;
+		i++;
+                /* bigfoot: And now... Really work around the bug. */
+		gcc_fucking_sucks();
+	      }
+#endif
 	    c = number & 0xff;
 	  }
 	  --input_line_pointer;
diff --git a/gas/read.h b/gas/read.h
index 4e1e226..4cbb0fd 100644
--- binutils-2.9.1.orig/gas/read.h
+++ binutils-2.9.1/gas/read.h
@@ -117,6 +117,9 @@ extern void s_app_file PARAMS ((int));
 extern void s_app_line PARAMS ((int));
 extern void s_comm PARAMS ((int));
 extern void s_data PARAMS ((int));
+#ifdef OBJ_AMIGAHUNK
+extern void s_data_chip PARAMS ((int));
+#endif
 extern void s_desc PARAMS ((int));
 extern void s_else PARAMS ((int arg));
 extern void s_end PARAMS ((int arg));
diff --git a/gas/write.c b/gas/write.c
index e59ddb7..1f2b379 100644
--- binutils-2.9.1.orig/gas/write.c
+++ binutils-2.9.1/gas/write.c
@@ -101,12 +101,12 @@ static int n_fixups;
 static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
 				       symbolS *add, symbolS *sub,
 				       offsetT offset, int pcrel,
-				       bfd_reloc_code_real_type r_type));
+				       bfd_reloc_code_real_type r_type, int baserel));
 #else
 static fixS *fix_new_internal PARAMS ((fragS *, int where, int size,
 				       symbolS *add, symbolS *sub,
 				       offsetT offset, int pcrel,
-				       int r_type));
+				       int r_type, int baserel));
 #endif
 #if defined (BFD_ASSEMBLER) || (!defined (BFD) && !defined (OBJ_VMS))
 static long fixup_segment PARAMS ((fixS * fixP, segT this_segment_type));
@@ -140,7 +140,7 @@ static void relax_and_size_all_segments PARAMS ((void));
  */
 static fixS *
 fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
-		  r_type)
+		  r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -153,6 +153,7 @@ fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;               /* TRUE if base-relative data */
 {
   fixS *fixP;
 
@@ -187,6 +188,7 @@ fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
   fixP->fx_signed = 0;
 
 #ifdef TC_FIX_TYPE
+  fixP->tc_fix_data = baserel;
   TC_INIT_FIX_DATA(fixP);
 #endif
 
@@ -233,7 +235,7 @@ fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
 /* Create a fixup relative to a symbol (plus a constant).  */
 
 fixS *
-fix_new (frag, where, size, add_symbol, offset, pcrel, r_type)
+fix_new (frag, where, size, add_symbol, offset, pcrel, r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -245,9 +247,10 @@ fix_new (frag, where, size, add_symbol, offset, pcrel, r_type)
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;
 {
   return fix_new_internal (frag, where, size, add_symbol,
-			   (symbolS *) NULL, offset, pcrel, r_type);
+			   (symbolS *) NULL, offset, pcrel, r_type, baserel);
 }
 
 /* Create a fixup for an expression.  Currently we only support fixups
@@ -255,7 +258,7 @@ fix_new (frag, where, size, add_symbol, offset, pcrel, r_type)
    file formats support anyhow.  */
 
 fixS *
-fix_new_exp (frag, where, size, exp, pcrel, r_type)
+fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel)
      fragS *frag;		/* Which frag? */
      int where;			/* Where in that frag? */
      int size;			/* 1, 2, or 4 usually. */
@@ -266,6 +269,7 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
 #else
      int r_type;		/* Relocation type */
 #endif
+     int baserel;
 {
   symbolS *add = NULL;
   symbolS *sub = NULL;
@@ -285,7 +289,7 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
 	exp->X_op_symbol = 0;
 	exp->X_add_symbol = stmp;
 	exp->X_add_number = 0;
-	return fix_new_exp (frag, where, size, exp, pcrel, r_type);
+	return fix_new_exp (frag, where, size, exp, pcrel, r_type, baserel);
       }
 
     case O_symbol_rva:
@@ -324,7 +328,7 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
     }
 
   return fix_new_internal (frag, where, size, add, sub, off,
-			   pcrel, r_type);
+			   pcrel, r_type, baserel);
 }
 
 /* Append a string onto another string, bumping the pointer along.  */
@@ -1134,7 +1138,7 @@ write_contents (abfd, sec, xxx)
 	      if (fill_size == 1)
 		{
 		  n_per_buf = sizeof (buf);
-		  memset (buf, *fill_literal, n_per_buf);
+		  memset (buf, *fill_literal & 0xFF, n_per_buf);	/* fnf - work around BeOS memset bug */
 		}
 	      else
 		{
@@ -1530,17 +1534,17 @@ write_object_file ()
 #ifdef TC_CONS_FIX_NEW
 	  TC_CONS_FIX_NEW (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp);
+		       2, &exp, 0);
 #else
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, BFD_RELOC_16);
+		       2, &exp, 0, BFD_RELOC_16, 0);
 #endif
 #else
 #if defined(TC_SPARC) || defined(TC_A29K) || defined(NEED_FX_R_TYPE)
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, NO_RELOC);
+		       2, &exp, 0, NO_RELOC, 0);
 #else
 #ifdef TC_NS32K
 	  fix_new_ns32k_exp (lie->frag,
@@ -1549,7 +1553,7 @@ write_object_file ()
 #else
 	  fix_new_exp (lie->frag,
 		       lie->word_goes_here - lie->frag->fr_literal,
-		       2, &exp, 0, 0);
+		       2, &exp, 0, 0, 0);
 #endif /* TC_NS32K */
 #endif /* TC_SPARC|TC_A29K|NEED_FX_R_TYPE */
 #endif /* BFD_ASSEMBLER */
@@ -2392,6 +2396,7 @@ fixup_segment (fixP, this_segment_type)
   char *place;
   long where;
   int pcrel, plt;
+  char baserel = 0;
   fragS *fragP;
   segT add_symbol_segment = absolute_section;
 
@@ -2430,6 +2435,9 @@ fixup_segment (fixP, this_segment_type)
       add_number = fixP->fx_offset;
       pcrel = fixP->fx_pcrel;
       plt = fixP->fx_plt;
+#ifdef TC_FIX_TYPE
+      baserel = fixP->tc_fix_data;
+#endif
 
       if (add_symbolP != NULL
 	  && add_symbolP->sy_mri_common)
@@ -2556,7 +2564,6 @@ fixup_segment (fixP, this_segment_type)
 		}
 	    }
 	}
-
       if (add_symbolP)
 	{
 	  if (add_symbol_segment == this_segment_type && pcrel && !plt
@@ -2669,6 +2676,11 @@ fixup_segment (fixP, this_segment_type)
 	    }
 	}
 
+#if !defined(BFD_ASSEMBLER) && !defined(MANY_SEGMENTS)
+      if (baserel && add_number)
+        add_number -= text_last_frag->fr_address;
+#endif
+
       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
 	{
 	  if ((size_t) size < sizeof (valueT))
diff --git a/gas/write.h b/gas/write.h
index 8fd1411..579337f 100644
--- binutils-2.9.1.orig/gas/write.h
+++ binutils-2.9.1/gas/write.h
@@ -177,17 +177,18 @@ extern void number_to_chars_bigendian    PARAMS ((char *, valueT, int));
 #ifdef BFD_ASSEMBLER
 extern fixS *fix_new
   PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
-	   offsetT offset, int pcrel, bfd_reloc_code_real_type r_type));
+	   offsetT offset, int pcrel, bfd_reloc_code_real_type r_type,
+	   int baserel));
 extern fixS *fix_new_exp
   PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
-	   bfd_reloc_code_real_type r_type));
+	   bfd_reloc_code_real_type r_type, int baserel));
 #else
 extern fixS *fix_new
   PARAMS ((fragS * frag, int where, int size, symbolS * add_symbol,
-	   offsetT offset, int pcrel, int r_type));
+	   offsetT offset, int pcrel, int r_type, int baserel));
 extern fixS *fix_new_exp
   PARAMS ((fragS * frag, int where, int size, expressionS *exp, int pcrel,
-	   int r_type));
+	   int r_type, int baserel));
 #endif
 
 extern void write_print_statistics PARAMS ((FILE *));
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index f4ce254..62a9f14 100644
--- binutils-2.9.1.orig/gprof/ChangeLog
+++ binutils-2.9.1/gprof/ChangeLog
@@ -188,6 +188,12 @@ Mon Dec 29 14:17:08 1997  Ian Lance Taylor  <ian@cygnus.com>
 	* core.c (core_sym_class): Treat weak symbols as text symbols.
 	From Dean Gaudet <dgaudet@arctic.org>.
 
+Tue Oct 28 09:05:21 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (BFDLIB): For BeOS hosts, directly
+ 	include libraries rather than using -L search paths.
+	* configure: Regenerated.
+
 Wed Sep 24 11:35:43 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* aclocal.m4: Rebuild with new libtool.
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 2e98d24..1907bd3 100644
--- binutils-2.9.1.orig/gprof/Makefile.am
+++ binutils-2.9.1/gprof/Makefile.am
@@ -25,7 +25,7 @@ EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c bbconv.pl
 
 BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
 
-diststuff: $(BUILT_SOURCES) info
+diststuff: $(BUILT_SOURCES) info guide
 
 .m.c:
 	awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
index e6156b4..4df735b 100644
--- binutils-2.9.1.orig/gprof/Makefile.in
+++ binutils-2.9.1/gprof/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -126,7 +132,14 @@ TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = gprof.info
 DVIS = gprof.dvi
 TEXINFOS = gprof.texi
-MANS = gprof.1
+GUIDES = gprof.guide
+GUIDE_DEPS = gprof.guide
+HTMLS = gprof.html
+HTML_DEPS = gprof.html
+PS_S = gprof.ps
+PS_DEPS = gprof.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 HEADERS =  $(noinst_HEADERS)
@@ -135,21 +148,21 @@ DIST_COMMON =  ChangeLog Makefile.am Makefile.in TODO acconfig.h \
 aclocal.m4 configure configure.in gconfig.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(gprof_SOURCES)
 OBJECTS = $(gprof_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) $(HEADERS) gconfig.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .lo .m .o .ps .s .texi .texinfo
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .lo .m .o .ps .s .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -193,18 +206,18 @@ maintainer-clean-binPROGRAMS:
 
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(bindir)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	  else :; fi; \
 	done
 
 uninstall-binPROGRAMS:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
 	done
 
 .c.o:
@@ -250,6 +263,9 @@ gprof$(EXEEXT): $(gprof_OBJECTS) $(gprof_DEPENDENCIES)
 	$(LINK) $(gprof_LDFLAGS) $(gprof_OBJECTS) $(gprof_LDADD) $(LIBS)
 
 gprof.info: gprof.texi
+gprof.guide: gprof.texi
+gprof.html: gprof.texi
+gprof.ps: gprof.dvi
 gprof.dvi: gprof.texi
 
 
@@ -257,7 +273,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -265,39 +281,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -308,11 +336,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -325,11 +353,145 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
+	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
+	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f gprof.aux gprof.cp gprof.cps gprof.dvi gprof.fn gprof.fns \
 	  gprof.ky gprof.kys gprof.ps gprof.log gprof.pg gprof.toc \
 	  gprof.tp gprof.tps gprof.vr gprof.vrs gprof.op gprof.tr \
-	  gprof.cv gprof.cn
+	  gprof.cv gprof.cn gprof.guide gprof.html gprof.ps
 
 clean-aminfo:
 
@@ -343,21 +505,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "gprof" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/gprof.1; then file=$(srcdir)/gprof.1; \
-	else file=gprof.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "gprof" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -428,6 +614,9 @@ distdir: $(DISTFILES)
 	done
 	$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE)
@@ -444,12 +633,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-binPROGRAMS uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) $(HEADERS) gconfig.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(bindir) $(mandir)/man1
+	$(mkinstalldirs)  $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -468,40 +655,52 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-binPROGRAMS \
 		mostlyclean-compile mostlyclean-libtool \
-		mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
+		mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-tags \
+		mostlyclean-generic
 
 clean:  clean-hdr clean-binPROGRAMS clean-compile clean-libtool \
-		clean-aminfo clean-tags clean-generic mostlyclean
+		clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-binPROGRAMS distclean-compile \
-		distclean-libtool distclean-aminfo distclean-tags \
-		distclean-generic clean
+		distclean-libtool distclean-aminfo distclean-guide \
+		distclean-html distclean-dvi distclean-ps \
+		distclean-tags distclean-generic clean
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-binPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
 maintainer-clean-compile mostlyclean-libtool distclean-libtool \
 clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info guide html ps dvi \
 installcheck install-info install-exec install-data install uninstall \
 all installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
-diststuff: $(BUILT_SOURCES) info
+diststuff: $(BUILT_SOURCES) info guide
 
 .m.c:
 	awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \
diff --git a/gprof/configure b/gprof/configure
index a8f363e..cddcc7b 100755
--- binutils-2.9.1.orig/gprof/configure
+++ binutils-2.9.1/gprof/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -57,6 +57,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -174,6 +178,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -216,6 +224,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -346,7 +370,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -516,9 +540,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -580,7 +606,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:584: checking host system type" >&5
+echo "configure:610: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -601,7 +627,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:605: checking target system type" >&5
+echo "configure:631: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -619,7 +645,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:623: checking build system type" >&5
+echo "configure:649: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -649,21 +675,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:658: checking for a BSD compatible install" >&5
+echo "configure:685: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -702,13 +729,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:712: checking whether build environment is sane" >&5
+echo "configure:741: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -765,7 +794,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:769: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:798: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -811,7 +840,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:815: checking for working aclocal" >&5
+echo "configure:844: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -824,7 +853,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:828: checking for working autoconf" >&5
+echo "configure:857: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -837,7 +866,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:841: checking for working automake" >&5
+echo "configure:870: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -850,7 +879,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:854: checking for working autoheader" >&5
+echo "configure:883: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -863,7 +892,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:867: checking for working makeinfo" >&5
+echo "configure:896: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -926,15 +955,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:930: checking for $ac_word" >&5
+echo "configure:959: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -955,15 +985,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:959: checking for $ac_word" >&5
+echo "configure:989: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -981,19 +1012,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1019: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1052: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1081: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:988: checking for $ac_word" >&5
+echo "configure:1114: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1028,25 +1155,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1166: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1036: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1197: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1046 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1208 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1060,18 +1223,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1239: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1075: checking whether we are using GNU C" >&5
+echo "configure:1244: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1080,7 +1249,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1091,11 +1260,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1099: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1272: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1110,18 +1283,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1135,7 +1335,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1139: checking for ld used by GCC" >&5
+echo "configure:1339: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1153,10 +1353,10 @@ echo "configure:1139: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1157: checking for GNU ld" >&5
+echo "configure:1357: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1160: checking for non-GNU ld" >&5
+echo "configure:1360: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1192,7 +1392,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1196: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1396: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1208,7 +1408,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1212: checking for BSD-compatible nm" >&5
+echo "configure:1412: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1245,7 +1445,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1249: checking whether ln -s works" >&5
+echo "configure:1449: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1255,14 +1455,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1281,8 +1491,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1285 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1495 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1319,15 +1529,16 @@ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1323: checking for $ac_word" >&5
+echo "configure:1533: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1345,19 +1556,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1563: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1596: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1625: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1352: checking for $ac_word" >&5
+echo "configure:1658: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1392,25 +1699,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1710: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1400: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1410 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1752 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1424,18 +1767,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1434: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1783: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1439: checking whether we are using GNU C" >&5
+echo "configure:1788: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1444,7 +1793,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1455,11 +1804,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1463: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1816: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1474,24 +1827,51 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1495: checking for POSIXized ISC" >&5
+echo "configure:1875: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -1521,8 +1901,20 @@ EOF
   ;;
 esac
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+echo $ac_n "checking for host dependent CFLAGS""... $ac_c" 1>&6
+echo "configure:1908: checking for host dependent CFLAGS" >&5
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+echo "$ac_t""$other_host_cflags" 1>&6
+### end-GG-local
+
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1526: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1918: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1540,19 +1932,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1544: checking for Cygwin32 environment" >&5
+echo "configure:1936: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1549 "configure"
+#line 1941 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1569,19 +1961,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1573: checking for Mingw32 environment" >&5
+echo "configure:1965: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1578 "configure"
+#line 1970 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1600,7 +1992,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1604: checking for executable suffix" >&5
+echo "configure:1996: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1647,7 +2039,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -1693,7 +2085,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -1714,7 +2108,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -1738,6 +2132,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -1755,6 +2150,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -1772,8 +2171,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -1784,6 +2183,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -1932,6 +2332,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -1977,6 +2378,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2008,6 +2410,7 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/gprof/configure.in b/gprof/configure.in
index 46c01eb..cd28723 100644
--- binutils-2.9.1.orig/gprof/configure.in
+++ binutils-2.9.1/gprof/configure.in
@@ -28,6 +28,17 @@ case "${target}" in
   ;;
 esac
 
+### begin-GG-local
+# Check for additional host specific CFLAGS.
+AC_MSG_CHECKING(for host dependent CFLAGS)
+other_host_cflags=""
+case "${host}" in
+	m68*-*-amigaos*)	other_host_cflags="-mstackextend" ;;
+esac
+test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
+AC_MSG_RESULT($other_host_cflags)
+### end-GG-local
+
 AM_MAINTAINER_MODE
 AM_CYGWIN32
 AM_EXEEXT
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 21ef0bc..41a1bfd 100644
--- binutils-2.9.1.orig/include/coff/ChangeLog
+++ binutils-2.9.1/include/coff/ChangeLog
@@ -1,3 +1,12 @@
+Tue Jun 30 11:43:05 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* internal.h (BEOS_DLL_IMAGE_BASE): Change to 0x80000000.
+
+Mon Jun  1 18:37:34 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* internal.h (BEOS_EXE_IMAGE_BASE, BEOS_DLL_IMAGE_BASE):
+	Define values for BeOS prefered loading addresses.
+
 Fri Mar 27 17:16:57 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* internal.h (ISPTR, ISFCN, ISARY): Add casts to unsigned long.
diff --git a/include/coff/internal.h b/include/coff/internal.h
index d873f28..2e7a2b1 100644
--- binutils-2.9.1.orig/include/coff/internal.h
+++ binutils-2.9.1/include/coff/internal.h
@@ -92,6 +92,10 @@ typedef struct _IMAGE_DATA_DIRECTORY
 #define NT_EXE_IMAGE_BASE 0x400000
 #define NT_DLL_IMAGE_BASE 0x10000000
 
+/* default image base for BeOS */
+#define BEOS_EXE_IMAGE_BASE 0x80000000
+#define BEOS_DLL_IMAGE_BASE 0x80000000
+
 /* Extra stuff in a PE aouthdr */
 
 #define PE_DEF_SECTION_ALIGNMENT 0x1000
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index a9e3b24..c8bbec4 100644
--- binutils-2.9.1.orig/include/opcode/ppc.h
+++ binutils-2.9.1/include/opcode/ppc.h
@@ -85,6 +85,12 @@ extern const int powerpc_num_opcodes;
    for the assembler's -many option, and it eliminates duplicates).  */
 #define PPC_OPCODE_ANY (0200)
 
+/* Opcode is supported as part of the 64-bit bridge.  */
+#define PPC_OPCODE_64_BRIDGE (0400)
+
+/* Opcode is part of the optional AltiVec extension.  */
+#define PPC_OPCODE_VEC (01000)
+
 /* A macro to extract the major opcode from an instruction.  */
 #define PPC_OP(i) (((i) >> 26) & 0x3f)
 
@@ -218,6 +224,10 @@ extern const struct powerpc_operand powerpc_operands[];
    number is allowed).  This flag will only be set for a signed
    operand.  */
 #define PPC_OPERAND_NEGATIVE (04000)
+
+/* This operand names a vector register.  The disassembler
+   prints these with a leading 'v'.  */
+#define PPC_OPERAND_VR (010000)
 
 /* The POWER and PowerPC assemblers use a few macros.  We keep them
    with the operands table for simplicity.  The macro table is an
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6baf1f4..d93106c 100644
--- binutils-2.9.1.orig/ld/ChangeLog
+++ binutils-2.9.1/ld/ChangeLog
@@ -1,3 +1,89 @@
+Thu Jun 18 10:09:36 1998  Mumit Khan  <khan@dhaka.xraylith.wisc.edu>
+
+	pei-i386 changes from Mikey <jeffdb@netzone.com>.
+
+	* emultempl/pe.em (set_pe_subsystem): Add new --subsystem args
+	-wwindows and -wconsole to allow easier use of Unicode objs. 
+	Delete call to ldlang_add_undef() and move undef of entry point to
+	ldlang.c so that it works globally.
+	(sort_by_filename): Terminate HNT and IAT properly for .LIB files.
+	(sort_by_section): Sort .stab and .stabstr to end of output to
+	allow stripping of relocatable execs and DLLs.
+
+	* scripttempl/pe.sc (__fltused, __ldused): New global headers at
+	end to correctly initialize floating point for MSVC and to resolve
+	all undefs in output.
+	(SECTIONS): Add explicit references to .CRT$X{CA,CZ,IA,IZ} to force 
+	linking in .CRT$XXX sections for _initterm.
+	Add explicit .reloc terminator.
+
+	* ldcref.c (output_cref): Cast cref_symcount to get elimiate compiler 
+	warning.
+
+	* ldlang.c (sectin_already_linked): Handle PE comdat.
+	(ldlang_switch_undef_entry): New function to exchange an older
+	undefined entry point for a newer one. 
+	(lang_add_entry): Use when entry_symbol already defined. This avoids 
+	pulling in the wrong startups from msvcrt.lib.
+
+	* ldfile.c (ldfile_open_file): Search for XXX.lib as well on a
+	pei-i386 target.
+
+Wed Jun 17 23:11:36 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* ldlang.c (section_already_linked): Guard against pe_comdat_info
+	being NULL.
+
+Sat Jun 13 10:06:06 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* scripttempl/i386beos.sc: Add symbols __text_start__ and
+	__text_end__ to mark start and end of .text section.
+
+Fri Jun  5 21:41:11 1998  Fred Fish  <fnf@ninemoons.com>
+
+	* ldfile.c (ldfile_open_file): When searching for libraries 
+	specified with -lfoo, prepend "lib" and append ".so.LIB".
+	* configure.host:  Add entry for i[3456]86-*-beos* and set
+	NATIVE_LIB_DIRS to /boot/develop/lib/x86.
+
+Mon Jun  1 17:39:25 1998  Fred Fish  <fnf@ninemoons.com>
+
+	Integrate PE changes from jeffdb@goodnet.com and adapt to use
+	on BeOS:
+	* Makefile.am (ALL_EMULATIONS): Add ei386beos.o.
+	(ei386beos.c): Add rule to build.
+	* Makefile.in: Regenerated.
+	* emulparms/i386beos.sh: New file for x86 BeOS, based on i386pe.sh.
+	* emultempl/beos.em: New file, for x86 BeOS.  Modified version
+	of pe.em, with changes to init array, added code to mark dll's
+	correctly as dll's, changed set_pe_subsystem, added wconsole &
+ 	wwindows to --subsystem arg to allow easier use of UNICODE
+ 	startup obj's, move undef of entry point into ldlang.c, so
+	it works globally, modified sort_by_file_name to sort the tail
+ 	.idata$4/5's to the end of each .lib's idata$4/5 section to
+ 	terminate the HNT and IAT properly for .lib files, modified
+ 	sort_by_section_name to sort .stab and .stabstr to the end of
+ 	the output sections so strip dosen't have to recalc vma for
+ 	.reloc sections in relocatable dll/exe's (FIXME ld.exe needs to
+ 	call res2coff.exe or winres.exe to convert res files to .o files
+ 	directly, otherwise debugging information won't be last and exe's
+	with .rsrc sections won't load/be debugable on NT.
+	* scripttempl/i386beos.sc: New file, for x86 BeOS.  Modified copy
+	of pe.sc, added globals header __fltused __ldused end to correct
+ 	init of floating point for vc++ and resolve all undefs in output
+	sorted sections in output order to make finding them easier,
+	explicit reference to .CRT\$XXX to force linking in .CRT$XXX
+ 	sections for _initterm, added explicit .idata$3 terminator from
+ 	gas-971123 pe.sc, added explicit .reloc terminator.
+	* configure.tgt (i[3456]98-*-beos*): Target emulation is i386beos.
+	* ldfile.c (ldfile_open_file): Look for .lib file on BeOS or
+	CYGWIN32.
+	* ldlang.c (section_already_linked): Use asection->pe_comdat_info
+ 	to determine whether to link in a given section.
+	(ldlang_switch_undef_entry): New function.
+	(lang_add_entry):  Use ldlang_switch_undef_entry when entry_symbol
+ 	already defined, avoids pulling in wrong startups from msvcrt.lib
+
 Mon Apr 27 11:56:21 1998  Ian Lance Taylor  <ian@cygnus.com>
 
 	* configure.in: Set version number to 2.9.1.
@@ -126,6 +212,11 @@ Sun Mar  8 23:34:14 1998  Stan Cox  <scox@equinox.cygnus.com>
 
 	* configure.tgt (sparclite*-*-elf): Added.
 
+Sun Mar  8 20:25:09 1998  Daniel Verite  <daniel@brainstorm.fr>
+
+	* ldlang.c (new_afile): Remove obsolete references to
+ 	amiga_attribute.
+
 Mon Mar  2 19:24:08 1998  Michael Meissner  <meissner@cygnus.com>
 
 	* ldlang.c (lang_size_sections): If the default memory region is
@@ -363,6 +454,32 @@ Sat Nov 22 15:23:19 1997  Ian Lance Taylor  <ian@cygnus.com>
 	correctly.  Pass 0 rather than hex_mode to bfd_scan_vma.
 	* ldlex.h (hex_mode): Don't declare.
 
+Wed Nov 19 08:15:36 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (CROSS_LINKER): Define this when configuring
+	a cross linker.
+	* configure: Regenerate with autoconf.
+	* acconfig.h (CROSS_LINKER): Add new possible define.
+	* config.in: Regenerate with current autoheader.
+	* beos-ld.c (CROSS_LINKER): Define to 0 if not defined.
+	(RUN_MWLD): Remove and replace with CROSS_LINKER tests.
+	(LD_COFF): Renamed to LDNAME.
+	(TARGET_ALIAS): Define as empty string if not defined.
+	(main): Add ldname, build by concatenating TARGET_ALIAS
+	and LDNAME, and use to set name of GNU linker to exec.
+	(BEOS_STUBS): Rework hack for cross environment configs
+	to use this environment variable.
+	(mapfile): Fix bug in computation of file name length.
+	* Makefile.in (beos-ld): Define LDNAME and TARGET_ALIAS at
+	compile time.
+	(install-beos-ld): Use INSTALL_XFORM to install linker
+	frontend in bindir.  Install linker frontend in tooldir
+	as just "ld".
+
+Sat Nov 15 09:24:13 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.tgt (i[3456]86-*-beos*): New config for x86 BeOS.
+
 Thu Nov 13 13:45:00 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
 	* configure.tgt (targ_extra_emuls): Make FreeBSD a i386bsd
@@ -383,6 +500,21 @@ Thu Oct 30 12:25:55 1997  Ian Lance Taylor  <ian@cygnus.com>
 	mismatched input files.
 	* ld.texinfo, ld.1: Document new option.
 
+Tue Oct 28 09:01:02 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (BFDLIB): For BeOS hosts, directly include
+ 	libbfd.a rather than using -L search paths.
+	* configure: Regenerated.
+	* Makefile.in (EXTRA_PROGS): Add new macro, set by configure.
+	(EXTRA_INSTALL): Ditto.
+	(LDNAME): Ditto.
+	(all): Depends upon $(EXTRA_PROGS)
+	(install-beos-ld): New target and rules to install the BeOS ld
+	frontend in place of the real GNU ld, which becomes ld-coff.
+	(install): Use LDNAME to set basename of installed GNU ld, to
+	either just "ld" (default) or "ld-coff" (for BeOS).  Other normal
+	name transformations still apply.
+
 Thu Oct 23 14:38:18 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* scripttempl/v850.sc: Rename linker symbol '_stack' to '__stack'
@@ -405,21 +537,42 @@ Wed Oct 22 11:29:25 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* scripttempl/pe.sc: Put .eh_frame in .rdata.
 
+Mon Oct 20 11:15:13 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* Makefile.in (AR, ARFLAGS): Remove, not used.
+
 Fri Oct 17 00:00:13 1997  Richard Henderson  <rth@cygnus.com>
 
 	* ldlang.c (lang_register_vers_node): Only check globals<=>locals,
 	since we need to be able to export different versions of the same
 	symbol.
 
+Thu Oct 16 13:21:14 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* ldlang.c (new_afile): Only reference amiga_attribute when
+	the target is AmigaOS.
+
 Wed Oct 15 14:52:36 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* scripttempl/pe.sc: Put .stab and .stabstr sections at end.
 
+Sat Oct 11 17:41:24 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* beos-ld.c (gflag): Add static flag variable.
+	(main): Set gflag if we find -g input arg.
+	(main): Pass -g option on to mwld if gflag set.
+	(main): Add code to create and pass -map arg to
+	mwld if also passing -g arg.
+	
 Wed Oct  8 12:37:05 1997  Richard Henderson  <rth@cygnus.com>
 
 	* configure.tgt, configure.host: Change alpha-*-* to alpha*-*-*;
 	config.guess now recognizes alphaev5 etc.
 
+Mon Oct  6 09:28:18 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configdoc.texi: Remove file created at build time.
+
 Fri Oct  3 14:23:02 1997  Ian Lance Taylor  <ian@cygnus.com>
 
 	* emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Don't treat
@@ -1033,6 +1186,10 @@ Mon Dec 30 13:55:57 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
 
 	* scripttempl/v850.sc (.tdata) Add .tbss and .tbyte sections.
 
+Sun Dec 22 10:45:58 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.tgt: Treat BeOS just like AIX.
+
 Wed Dec 18 22:57:35 1996  Stan Shebs  <shebs@andros.cygnus.com>
 
 	* mpw-make.sed: Use NewFolderRecursive for installation.
@@ -1078,6 +1235,11 @@ Mon Dec  2 11:43:50 1996  Ian Lance Taylor  <ian@cygnus.com>
 	* emulparams/*.sh: Make sure that each set of parameters which
 	uses the elf.sc script sets MACHINE.
 
+Sat Nov 30 01:33:26 1996  Fred Fish  <fnf@ninemoons.com>
+
+	From KUNISAWA Ryota <kunisawa@is.s.u-tokyo.ac.jp>:
+	* genscripts.sh: Avoid bug with some shells for $10 and up.
+
 Wed Nov 27 03:22:05 1996  Jason Merrill  <jason@yorick.cygnus.com>
 
 	* scripttempl/elf{,mips,ppc}.sc: Add the remaining DWARF sections.
@@ -1494,6 +1656,12 @@ Mon Aug  5 16:26:14 1996  Ian Lance Taylor  <ian@cygnus.com>
 	* ldcref.c (check_nocrossref): Skip symbols with no output
 	sections.
 
+Sun Aug  4 22:15:56 1996  Fred Fish  <fnf@ninemoons.com>
+
+	* ldfile.c (ldfile_open_file_search): Use alloca to allocate
+	dynamically sized array, rather than using a GNU C extension that
+	is not portable.	
+
 Fri Aug  2 14:57:49 1996  Ian Lance Taylor  <ian@cygnus.com>
 
 	* ldgram.y (LOADADDR): New terminal.
@@ -1720,6 +1888,10 @@ Mon Jun 24 12:00:32 1996  Ian Lance Taylor  <ian@cygnus.com>
 	using shared libraries.
 	* configure: Rebuild with autoconf 2.10.
 
+Sat Jun 22 21:41:37 1996 Daniel Verite <daniel@brainstorm.eu.org>
+
+	* ldfile.c, lexsup.c: Sort the flavors.
+
 Fri Jun 21 17:40:56 1996  Joel Sherrill  <joel@merlin.gcs.redstone.army.mil>
 
 	* configure.tgt: Add support for *-*-rtems* configurations.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index e5be23d..9f1b860 100644
--- binutils-2.9.1.orig/ld/Makefile.am
+++ binutils-2.9.1/ld/Makefile.am
@@ -93,6 +93,8 @@ ALL_EMULATIONS = \
 	ea29k.o \
 	eaixppc.o \
 	eaixrs6.o \
+	eamiga.o \
+	eamiga_bss.o \
 	ealpha.o \
 	earcelf.o \
 	earmaoutb.o \
@@ -128,6 +130,7 @@ ALL_EMULATIONS = \
 	ehp3hpux.o \
 	ehppaelf.o \
 	ei386aout.o \
+	ei386beos.o \
 	ei386bsd.o \
 	ei386coff.o \
 	ei386go32.o \
@@ -159,6 +162,8 @@ ALL_EMULATIONS = \
 	enews.o \
 	ens32knbsd.o \
 	epc532macha.o \
+	eppcamiga.o \
+	eppcamiga_bss.o \
 	eppcmacos.o \
 	eppcnw.o \
 	eppcpe.o \
@@ -225,10 +230,22 @@ ldemul-list.h: Makefile
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" "$(LIB_PATH)"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 @TDIRS@
 
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} amiga "$(tdir_amiga)"
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
+eppcamiga.c: $(srcdir)/emulparams/ppcamiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} ppcamiga "$(tdir_ppcamiga)"
+eppcamiga_bss.c: $(srcdir)/emulparams/ppcamiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} ppcamiga_bss "$(tdir_ppcamiga_bss)"
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} a29k "$(tdir_a29k)"
@@ -358,6 +375,9 @@ ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
+  $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} i386beos "$(tdir_i386beos)"
 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
@@ -543,6 +563,16 @@ $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
   ldctor.h ldexp.h ldlang.h ldgram.h
 
+# GG-local: For BeOS, we use a fake ld that calls GNU ld and then mwld.
+beos-ld: beos-ld.c
+	$(CC) -I. -I$(INCDIR) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -DLDNAME='"@LDNAME@"' -DTARGET_ALIAS='"@target_alias@"' -o $@ $(srcdir)/beos-ld.c
+
+install-beos-ld:
+	test -d $(tooldir) || mkdir $(tooldir)
+	test -d $(tooldir)/bin || mkdir $(tooldir)/bin
+	$(INSTALL_XFORM) beos-ld $(bindir)/ld
+	$(INSTALL_PROGRAM) beos-ld $(tooldir)/bin/ld
+
 # This is the real libbfd.a created by libtool.
 TESTBFDLIB = @TESTBFDLIB@
 
diff --git a/ld/Makefile.in b/ld/Makefile.in
index c37aab3..54702a3 100644
--- binutils-2.9.1.orig/ld/Makefile.in
+++ binutils-2.9.1/ld/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -62,19 +68,17 @@ host_triplet = @host@
 target_alias = @target_alias@
 target_triplet = @target@
 CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
+EXTRA_INSTALL = @EXTRA_INSTALL@
+EXTRA_PROGS = @EXTRA_PROGS@
 HDEFINES = @HDEFINES@
-LD = @LD@
+LDNAME = @LDNAME@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
 NATIVE_LIB_DIRS = @NATIVE_LIB_DIRS@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 TDIRS = @TDIRS@
-VERSION = @VERSION@
 
 AUTOMAKE_OPTIONS = cygnus dejagnu
 
@@ -169,6 +173,8 @@ ALL_EMULATIONS = \
 	ea29k.o \
 	eaixppc.o \
 	eaixrs6.o \
+	eamiga.o \
+	eamiga_bss.o \
 	ealpha.o \
 	earcelf.o \
 	earmaoutb.o \
@@ -204,6 +210,7 @@ ALL_EMULATIONS = \
 	ehp3hpux.o \
 	ehppaelf.o \
 	ei386aout.o \
+	ei386beos.o \
 	ei386bsd.o \
 	ei386coff.o \
 	ei386go32.o \
@@ -232,9 +239,13 @@ ALL_EMULATIONS = \
 	emipsidtl.o \
 	emipslit.o \
 	emipslnews.o \
+	emorphos.o \
+	emorphos_baserel.o \
 	enews.o \
 	ens32knbsd.o \
 	epc532macha.o \
+	eppcamiga.o \
+	eppcamiga_bss.o \
 	eppcmacos.o \
 	eppcnw.o \
 	eppcpe.o \
@@ -283,7 +294,7 @@ STAGESTUFF = *.o ldscripts/* e*.c
 
 # These all start with e so 'make clean' can find them.
 
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" "$(LIB_PATH)"
 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
 
 ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
@@ -324,12 +335,20 @@ CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then echo $(top_builddir)/../texinfo/makeinfo/makeinfo; else echo makeinfo; fi`
 TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
 TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
 INFO_DEPS = ld.info
 DVIS = ld.dvi
 TEXINFOS = ld.texinfo
-MANS = ld.1
+GUIDES = ld.guide
+GUIDE_DEPS = ld.guide
+HTMLS = ld.html
+HTML_DEPS = ld.html
+PS_S = ld.ps
+PS_DEPS = ld.ps
+man1dir = $(mandir)/man1
+MANS = $(man_MANS)
 
 NROFF = nroff
 DIST_COMMON =  README ChangeLog Makefile.am Makefile.in NEWS TODO \
@@ -337,21 +356,24 @@ acconfig.h acinclude.m4 aclocal.m4 config.in configure configure.in \
 ldgram.c ldlex.c stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = $(ld_new_SOURCES)
 OBJECTS = $(ld_new_OBJECTS)
 
-default: all
+all: Makefile $(PROGRAMS) $(MANS) config.h
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+.SUFFIXES: .S .c .dvi .guide .html .info .l .lo .o .ps .s .texi .texinfo .txi .y
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -445,6 +467,9 @@ ldgram.h: ldgram.c
 	$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
 
 ld.info: ld.texinfo
+ld.guide: ld.texinfo
+ld.html: ld.texinfo
+ld.ps: ld.dvi
 ld.dvi: ld.texinfo
 
 
@@ -452,7 +477,7 @@ DVIPS = dvips
 
 .texi.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I$(srcdir) $< --output=$@
 
 .texi.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
@@ -460,39 +485,51 @@ DVIPS = dvips
 
 .texi:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.info:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo:
 	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
-	$(MAKEINFO) -I $(srcdir) $<
+	$(MAKEINFO) -I $(srcdir) $< --output=$@
 
 .texinfo.dvi:
 	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
 	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
+
+.txi.dvi:
+	TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
+	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+	@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+	$(MAKEINFO) -I $(srcdir) $<
 .dvi.ps:
 	$(DVIPS) $< -o $@
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(infodir)
+	$(mkinstalldirs) $(DESTDIR)$(infodir)
 	@for file in $(INFO_DEPS); do \
 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
 	  for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
 	    if test -f $$d/$$ifile; then \
-	      echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
-	      $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
 	    else : ; fi; \
 	  done; \
 	done
 	@$(POST_INSTALL)
 	@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
 	  for file in $(INFO_DEPS); do \
-	    echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
-	    install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+	    echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+	    install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
 	  done; \
 	else : ; fi
 
@@ -503,11 +540,11 @@ uninstall-info:
 	else ii=; fi; \
 	for file in $(INFO_DEPS); do \
 	  test -z "$ii" \
-	    || install-info --info-dir=$(infodir) --remove $$file; \
+	    || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
 	done
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	for file in $(INFO_DEPS); do \
-	  (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+	  (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
 	done
 
 dist-info: $(INFO_DEPS)
@@ -520,10 +557,140 @@ dist-info: $(INFO_DEPS)
 	  done; \
 	done
 
+MAKEGUIDE= $(MAKEINFO) --amiga
+
+MAKEHTML = texi2html -number -split_chapter
+
+.texi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texinfo.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.txi.guide:
+	$(MAKEGUIDE) -I$(srcdir) $< -o $@
+
+.texi.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+.texinfo.html:
+	$(MAKEHTML) -I$(srcdir) $< 
+
+install-guide: $(GUIDE_DEPS)
+	$(mkinstalldirs) $(guidedir)
+	for file in $(GUIDE_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(guidedir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-guide:
+	for file in *.guide*; do	\
+	  rm -f $(guidedir)/$$file; \
+	done
+
+install-ps: $(PS_S)
+	$(mkinstalldirs) $(psdir)
+	for file in $(PS_DEPS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(psdir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-ps:
+	for file in *.ps*; do	\
+	  rm -f $(psdir)/$$file; \
+	done
+
+install-dvi: $(DVIS)
+	$(mkinstalldirs) $(dvidir)
+	for file in $(DVIS); do		\
+	  for ifile in `echo $$file*`; do \
+	    $(INSTALL_DATA) $$ifile $(dvidir)/$$ifile; \
+	  done;					\
+	done
+
+uninstall-dvi:
+	for file in *.dvi*; do	\
+	  rm -f $(dvidir)/$$file; \
+	done
+
+install-html: $(HTML_DEPS)
+	$(mkinstalldirs) $(htmldir)
+	@touch $(HTML_DEPS)
+	@for file in $(HTML_DEPS); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $$d && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    if test -f $$d/$$ifile; then \
+	      echo " $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile"; \
+	      $(INSTALL_DATA) $$d/$$ifile $(htmldir)/$$ifile; \
+	    else : ; fi; \
+	  done; \
+	done
+	@rm -f $(htmldir)/$(HTML_DEPS)
+
+uninstall-html:
+	@for file in $(HTML_DEPS); do \
+	  bfile=`basename $$file .html`; \
+	  for ifile in `cd $(htmldir) && echo $$file $$bfile'_toc.html' $$bfile'_foot.html' $$bfile'_[0-9].html' $$bfile'_[0-9][0-9].html'`; do \
+	    echo "removing: $(htmldir)/$$ifile"; \
+	    rm -f $(htmldir)/$$ifile; \
+	  done; \
+	done
+
+mostlyclean-guide:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-guide:
+
+distclean-guide:
+
+maintainer-clean-guide:
+	rm -f $(GUIDES)
+
+mostlyclean-html:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-html:
+
+distclean-html:
+
+maintainer-clean-html:
+	rm -f $(HTMLS)
+
+mostlyclean-ps:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-ps:
+
+distclean-ps:
+
+maintainer-clean-ps:
+	rm -f $(PS_S)
+
+mostlyclean-dvi:
+	rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps ld.log \
+	  ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr ld.cv \
+	  ld.cn ld.guide ld.html ld.ps
+
+clean-dvi:
+
+distclean-dvi:
+
+maintainer-clean-dvi:
+	rm -f $(DVIS)
+
 mostlyclean-aminfo:
 	-rm -f ld.aux ld.cp ld.cps ld.dvi ld.fn ld.fns ld.ky ld.kys ld.ps \
 	  ld.log ld.pg ld.toc ld.tp ld.tps ld.vr ld.vrs ld.op ld.tr \
-	  ld.cv ld.cn
+	  ld.cv ld.cn ld.guide ld.html ld.ps
 
 clean-aminfo:
 
@@ -537,21 +704,45 @@ maintainer-clean-aminfo:
 	  fi; \
 	done
 clean-info: mostlyclean-aminfo
-install-man: $(MANS)
-	$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(mandir)/man1
-	@sect=1;				\
-	inst=`echo "ld" | sed '$(transform)'`.1; \
-	if test -f $(srcdir)/ld.1; then file=$(srcdir)/ld.1; \
-	else file=ld.1; fi; \
-	echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
-	$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
 
-uninstall-man:
-	$(NORMAL_UNINSTALL)
-	-inst=`echo "ld" | sed '$(transform)'`.1; \
-	rm -f $(mandir)/man1/$$inst
+install-man1:
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
 
+uninstall-man1:
+	@list='$(man1_MANS)'; \
+	l2='$(man_MANS)'; for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+install-man: $(MANS)
+	@$(NORMAL_INSTALL)
+	$(MAKE) install-man1
+uninstall-man:
+	@$(NORMAL_UNINSTALL)
+	$(MAKE) uninstall-man1
 
 tags: TAGS
 
@@ -645,6 +836,9 @@ site.exp: Makefile
 	-@mv site.exp site.bak
 	@mv $@-t site.exp
 info: $(INFO_DEPS)
+guide: $(GUIDE_DEPS)
+html: $(HTML_DEPS)
+ps: $(PS_DEPS)
 dvi: $(DVIS)
 check:
 	$(MAKE) check-DEJAGNU
@@ -661,12 +855,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-man
 
-all: Makefile $(PROGRAMS) $(MANS) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(mandir)/man1
+	$(mkinstalldirs)  $(DESTDIR)$(mandir)/man1
 
 
 mostlyclean-generic:
@@ -685,39 +877,50 @@ maintainer-clean-generic:
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 mostlyclean:  mostlyclean-hdr mostlyclean-noinstPROGRAMS \
 		mostlyclean-compile mostlyclean-libtool \
-		mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
-		mostlyclean-local
+		mostlyclean-aminfo mostlyclean-guide mostlyclean-html \
+		mostlyclean-dvi mostlyclean-ps mostlyclean-tags \
+		mostlyclean-generic mostlyclean-local
 
 clean:  clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \
-		clean-aminfo clean-tags clean-generic mostlyclean
+		clean-aminfo clean-guide clean-html clean-dvi clean-ps \
+		clean-tags clean-generic mostlyclean
 
 distclean:  distclean-hdr distclean-noinstPROGRAMS distclean-compile \
-		distclean-libtool distclean-aminfo distclean-tags \
-		distclean-generic clean distclean-local
+		distclean-libtool distclean-aminfo distclean-guide \
+		distclean-html distclean-dvi distclean-ps \
+		distclean-tags distclean-generic clean distclean-local
 	-rm -f config.status
 	-rm -f libtool
 
 maintainer-clean:  maintainer-clean-hdr maintainer-clean-noinstPROGRAMS \
 		maintainer-clean-compile maintainer-clean-libtool \
-		maintainer-clean-aminfo maintainer-clean-tags \
+		maintainer-clean-aminfo maintainer-clean-guide \
+		maintainer-clean-html maintainer-clean-dvi \
+		maintainer-clean-ps maintainer-clean-tags \
 		maintainer-clean-generic distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstPROGRAMS \
-distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
-clean-aminfo maintainer-clean-aminfo install-man uninstall-man tags \
-mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir check-DEJAGNU info dvi installcheck install-info install-exec \
-install-data install uninstall all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
+install-guide uninstall-guide install-ps uninstall-ps install-html \
+uninstall-html install-dvi uninstall-dvi mostlyclean-guide \
+distclean-guide clean-guide maintainer-clean-guide mostlyclean-html \
+distclean-html clean-html maintainer-clean-html mostlyclean-ps \
+distclean-ps clean-ps maintainer-clean-ps mostlyclean-dvi distclean-dvi \
+clean-dvi maintainer-clean-dvi mostlyclean-aminfo distclean-aminfo \
+clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \
+install-man uninstall-man tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir check-DEJAGNU info guide html \
+ps dvi installcheck install-info install-exec install-data install \
+uninstall all installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
 
 
 ldmain.o: ldmain.c config.status
@@ -739,6 +942,18 @@ ldemul-list.h: Makefile
 	mv ldemul-tmp.h ldemul-list.h
 @TDIRS@
 
+eamiga.c: $(srcdir)/emulparams/amiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} amiga "$(tdir_amiga)"
+eamiga_bss.c: $(srcdir)/emulparams/amiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} amiga_bss "$(tdir_amiga_bss)"
+eppcamiga.c: $(srcdir)/emulparams/ppcamiga.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga.sc ${GEN_DEPENDS} 
+	${GENSCRIPTS} ppcamiga "$(tdir_ppcamiga)"
+eppcamiga_bss.c: $(srcdir)/emulparams/ppcamiga_bss.sh\
+   $(srcdir)/emultempl/amiga.em $(srcdir)/scripttempl/amiga_bss.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} ppcamiga_bss "$(tdir_ppcamiga_bss)"
 ea29k.c: $(srcdir)/emulparams/a29k.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} a29k "$(tdir_a29k)"
@@ -868,6 +1083,9 @@ ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386aout "$(tdir_i386aout)"
+ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
+  $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} i386beos "$(tdir_i386beos)"
 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
@@ -958,6 +1176,12 @@ emn10300.c: $(srcdir)/emulparams/mn10300.sh \
 emn10200.c: $(srcdir)/emulparams/mn10200.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
+emorphos.c: $(srcdir)/emulparams/morphos.sh \
+  $(srcdir)/emultempl/morphos.em $(srcdir)/scripttempl/morphos.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} morphos "$(tdir_morphos)"
+emorphos_baserel.c: $(srcdir)/emulparams/morphos_baserel.sh \
+  $(srcdir)/emultempl/morphos.em $(srcdir)/scripttempl/morphos_baserel.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} morphos_baserel "$(tdir_morphos)"
 enews.c: $(srcdir)/emulparams/news.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} news "$(tdir_news)"
@@ -1048,6 +1272,16 @@ $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
   ldctor.h ldexp.h ldlang.h ldgram.h
 
+# GG-local: For BeOS, we use a fake ld that calls GNU ld and then mwld.
+beos-ld: beos-ld.c
+	$(CC) -I. -I$(INCDIR) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -DLDNAME='"@LDNAME@"' -DTARGET_ALIAS='"@target_alias@"' -o $@ $(srcdir)/beos-ld.c
+
+install-beos-ld:
+	test -d $(tooldir) || mkdir $(tooldir)
+	test -d $(tooldir)/bin || mkdir $(tooldir)/bin
+	$(INSTALL_XFORM) beos-ld $(bindir)/ld
+	$(INSTALL_PROGRAM) beos-ld $(tooldir)/bin/ld
+
 check-DEJAGNU: site.exp
 	srcroot=`cd $(srcdir) && pwd`; export srcroot; \
 	r=`pwd`; export r; \
diff --git a/ld/acconfig.h b/ld/acconfig.h
index c627d7f..5a09157 100644
--- binutils-2.9.1.orig/ld/acconfig.h
+++ binutils-2.9.1/ld/acconfig.h
@@ -20,3 +20,6 @@
 
 /* Do we need to use the b modifier when opening binary files?  */
 #undef USE_BINARY_FOPEN
+
+/* Are we building a cross linker */
+#undef CROSS_LINKER
diff --git a/ld/beos-ld.c b/ld/beos-ld.c
new file mode 100644
index 0000000..ec82677
--- /dev/null
+++ binutils-2.9.1/ld/beos-ld.c
@@ -0,0 +1,395 @@
+/*  Linker front end for BeOS.
+
+    Copyright (C) 1997 Free Software Foundation, Inc.
+
+    BeOS uses a proprietary Apple executable format called PEF.  However the
+    Metrowerks linker that is supplied with the system also reads XCOFF so
+    the gcc port generates XCOFF object files, which can be linked together,
+    along with other XCOFF objects from libraries, using the GNU linker with
+    the "-r" option to generate a single relocatable object file.  That file
+    can then be passed to the Metrowerks linker to add the BeOS runtime
+    support and generate a PEF executable.
+
+    This front end is compiled and installed in place of the regular GNU
+    linker, which is moved to ld-coff.  It first runs ld-coff with the args
+    that it is given, except that -o options are redirected to a temporary
+    file, and then it runs mwld to covert the relocatable temporary file
+    into a PEF executable in the file specified by the -o option (or "a.out"
+    as the default).
+
+    This front end was written by Fred Fish (fnf@cygnus.com) using various
+    pieces from gcc's "collect2.c".  Contributers to collect2.c include
+    Chris Smith (csmith@convex.com), Michael Meissner (meissner@cygnus.com),
+    Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
+
+    This is expected to be only a temporary solution.  I have formally
+    requested (9/96) a license from Apple to incorporate PEF support into
+    BFD using information from their licensed PEF documentation, and to have
+    that code covered *only* by the GNU General Public License.  That
+    request is still pending.  If PEF support is installed, then this useful
+    hack will go away.  Or perhaps Be will migrate to more open standards
+    first.
+
+This file is part of GLD, the Gnu Linker.
+
+GLD 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, or (at your option)
+any later version.
+
+GLD 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 GLD; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+
+#include "ansidecl.h"
+#include "config.h"
+
+#ifndef CROSS_LINKER
+#define CROSS_LINKER 0
+#endif
+
+#define TEMP_FILE_TEMPLATE "/tmp/ldhackXXXXXX"
+
+#ifndef LDNAME
+#define LDNAME "ld-coff"		/* The renamed GNU linker */
+#endif
+
+#ifndef TARGET_ALIAS
+#define TARGET_ALIAS ""
+#endif
+
+#define MW_LD "mwld"			/* The Metrowerks linker */
+#define DEFAULT_OFILE "a.out"		/* Default output file name */
+
+static int gflag = 0;			/* Non-zero if user specified -g flag */
+static int vflag = 0;			/* Non-zero if user specified -v flag */
+static int rflag = 0;			/* Non-zero if user specified -r flag or we are a cross linker */
+static char *ofile = NULL;		/* Output file name */
+static char *scratchfile;		/* Temporary file name */
+
+static void do_wait PARAMS ((char *));
+static void fork_execute PARAMS ((char *, char **));
+static void collect_exit PARAMS ((int));
+
+extern void *malloc ();
+extern char *getenv ();
+
+
+/* Die when sys call fails.  */
+
+static void
+fatal_perror (string, arg1, arg2, arg3)
+     char *string, *arg1, *arg2, *arg3;
+{
+  int e = errno;
+
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3);
+  fprintf (stderr, ": %s\n", strerror (e));
+  collect_exit (1);
+}
+
+/* Just die.  */
+
+static void
+fatal (string, arg1, arg2, arg3)
+     char *string, *arg1, *arg2, *arg3;
+{
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3);
+  fprintf (stderr, "\n");
+  collect_exit (1);
+}
+
+/* Write error message.  */
+
+static void
+error (string, arg1, arg2, arg3, arg4)
+     char *string, *arg1, *arg2, *arg3, *arg4;
+{
+  fprintf (stderr, "ld: ");
+  fprintf (stderr, string, arg1, arg2, arg3, arg4);
+  fprintf (stderr, "\n");
+}
+
+main (argc, argv)
+     int argc;
+     char *argv[];
+{
+  char **argp;
+  char **ldargs;
+  char **ldargp;
+  char **tmp_ofile;
+  char *ldname;
+  int offset;
+
+  argp = &argv[1];
+
+  /* Find the GNU linker. */
+
+  ldname = malloc (strlen (TARGET_ALIAS) + strlen (LDNAME) + 2);
+  if (strlen (TARGET_ALIAS) > 0)
+    {
+      sprintf (ldname, "%s-%s", TARGET_ALIAS, LDNAME);
+    }
+  else
+    {
+      strcpy (ldname, LDNAME);
+    }
+
+  /* Build the temporary file name, being careful to ensure that the
+     template is writable and not in const data. */
+
+  scratchfile = malloc (strlen (TEMP_FILE_TEMPLATE));
+  strcpy (scratchfile, TEMP_FILE_TEMPLATE);
+  mktemp (scratchfile);
+
+  /* Just add enough slop that we don't have to worry about being
+     off a little bit. */
+  ldargs = malloc ((argc + 16) * sizeof (char *));
+  ldargp = ldargs;
+
+  /* The first arg is the name of the GNU linker */
+
+  *ldargp++ = ldname;
+
+  while (*argp)
+    {
+      if (strcmp ("-g", *argp) == 0)
+	{
+	  gflag = 1;
+	}
+      else if (strcmp ("-v", *argp) == 0)
+	{
+	  vflag = 1;
+	}
+      else if (strcmp ("-r", *argp) == 0)
+	{
+	  /* Always pass explicit -r option on to GNU linker */
+	  rflag = 1;
+	  *ldargp++ = "-r";
+	}
+      else if (strcmp ("-o", *argp) == 0)
+	{
+	  /* Save the real output filename in ofile and
+	     substitute our temporary file name. */
+	  *ldargp++ = *argp++;
+	  ofile = *argp++;
+	  tmp_ofile = ldargp;
+	  *ldargp++ = scratchfile;
+	  /* Already handled args, skip to next */
+	  continue;
+	}
+      *ldargp++ = *argp++;
+    }
+
+  /* Now check to see if we saw an explicit -o option.  If so, it currently
+     points to the temporary file.  Leave it alone unless we also saw a -r
+     option, in which case redirect it back to the real output file since
+     we won't be running mwld.  If no explicit -o, need to add one unless
+     we are only running the GNU linker and not mwld. */
+
+  if (ofile == NULL)
+    {
+      /* No explicit -o option.  If not generating a relocatable
+	 file then need to use the temporary file between passes. */
+      if (!rflag && !CROSS_LINKER)
+	{
+	  *ldargp++ = "-o";
+	  *ldargp++ = scratchfile;
+	}
+    }
+  else
+    {
+      /* Got explicit -o option so it currently points to our scratch file.
+	 If also got -r option, need to point it back to our real output
+	 file. */
+      if (rflag || CROSS_LINKER)
+	{
+	  *tmp_ofile = ofile;
+	}
+    }
+  
+  /* Generally we always want to supply a "-r" option to the GNU linker,
+     unless we either got one on the input command line and thus already
+     have one, or else the environment variable BEOS_STUBS is given
+     which means that we are probably trying to find out what symbols are
+     undefined in the BeOS runtime by supplying a stub object that defines
+     the ones that are, and thus we don't want to supply "-r". */
+
+  if (!rflag)
+    {
+      char *stubs = getenv ("BEOS_STUBS");
+      *ldargp++ = stubs ? stubs : "-r";
+    }
+
+  /* Terminate the arg list to the GNU ld and run it. */
+
+  *ldargp++ = NULL;
+  fork_execute (ldargs[0], ldargs);
+
+  /* If we are not generating a relocatable output file, then we need
+     to run the Metrowerks linker to generate the final executable. */
+
+  if (!rflag && !CROSS_LINKER)
+    {
+      char *mapfile;
+      ldargp = ldargs;
+      *ldargp++ = MW_LD;
+      *ldargp++ = "-o";
+      *ldargp++ = ofile;
+      if (gflag)
+	{
+	  *ldargp++ = "-g";
+	  mapfile = malloc (strlen (ofile) + 6);
+	  sprintf (mapfile, "%s.xMAP", ofile);
+	  *ldargp++ = "-map";
+	  *ldargp++ = mapfile;
+	}
+      *ldargp++ = "-nodup";
+      *ldargp++ = scratchfile;
+      *ldargp++ = NULL;
+      fork_execute (ldargs[0], ldargs);
+
+      /* Since mwld doesn't make a file executable, we need to do that ourselves. */
+      ldargp = ldargs;
+      *ldargp++ = "chmod";
+      *ldargp++ = "+x";
+      *ldargp++ = ofile;
+      *ldargp++ = NULL;
+      fork_execute (ldargs[0], ldargs);
+    }
+
+  collect_exit (0);
+}
+
+/* Wait for a process to finish, and exit if a non-zero status is found.  */
+
+int
+collect_wait (prog)
+     char *prog;
+{
+  int status;
+
+  wait (&status);
+  if (status)
+    {
+      if (WIFSIGNALED (status))
+	{
+	  int sig = WTERMSIG (status);
+	  error ("%s terminated with signal %d %s",
+		 prog,
+		 sig,
+		 (status & 0200) ? ", core dumped" : "");
+	  collect_exit (127);
+	}
+
+      if (WIFEXITED (status))
+	return WEXITSTATUS (status);
+    }
+  return 0;
+}
+
+static void
+do_wait (prog)
+     char *prog;
+{
+  int ret = collect_wait (prog);
+  if (ret != 0)
+    {
+      error ("%s returned %d exit status", prog, ret);
+      collect_exit (ret);
+    }
+}
+
+/* Fork and execute a program, and wait for the reply.  */
+
+static void
+collect_execute (prog, argv, redir)
+     char *prog;
+     char **argv;
+     char *redir;
+{
+  int pid;
+
+  if (vflag)
+    {
+      char **p_argv;
+      char *str;
+
+      if (argv[0])
+	fprintf (stderr, "%s", argv[0]);
+      else
+	fprintf (stderr, "[cannot find %s]", prog);
+
+      for (p_argv = &argv[1]; (str = *p_argv) != (char *) 0; p_argv++)
+	fprintf (stderr, " %s", str);
+
+      fprintf (stderr, "\n");
+    }
+
+  fflush (stdout);
+  fflush (stderr);
+
+  /* If we can't find a program we need, complain error.  Do this here
+     since we might not end up needing something that we couldn't find.  */
+
+  if (argv[0] == 0)
+    fatal ("cannot find `%s'", prog);
+
+  pid = fork ();
+  if (pid == -1)
+    {
+      fatal_perror ("fork");
+    }
+
+  if (pid == 0)			/* child context */
+    {
+      if (redir)
+	{
+	  unlink (redir);
+	  if (freopen (redir, "a", stdout) == NULL)
+	    fatal_perror ("redirecting stdout");
+	  if (freopen (redir, "a", stderr) == NULL)
+	    fatal_perror ("redirecting stderr");
+	}
+
+      execvp (argv[0], argv);
+      fatal_perror ("executing %s", prog);
+    }
+}
+
+static void
+fork_execute (prog, argv)
+     char *prog;
+     char **argv;
+{
+  collect_execute (prog, argv, NULL);
+  do_wait (prog);
+}
+
+/* Delete tempfiles and exit function.  */
+
+void
+collect_exit (status)
+     int status;
+{
+  if (status > 0)
+    {
+      unlink (ofile);
+    }
+  unlink (scratchfile);
+  exit (status);
+}
+
diff --git a/ld/config.in b/ld/config.in
index a9de5b8..247cf18 100644
--- binutils-2.9.1.orig/ld/config.in
+++ binutils-2.9.1/ld/config.in
@@ -24,6 +24,9 @@
 /* Do we need to use the b modifier when opening binary files?  */
 #undef USE_BINARY_FOPEN
 
+/* Are we building a cross linker */
+#undef CROSS_LINKER
+
 /* Define if you have the sbrk function.  */
 #undef HAVE_SBRK
 
diff --git a/ld/configure b/ld/configure
index d15e3d2..c0c2943 100755
--- binutils-2.9.1.orig/ld/configure
+++ binutils-2.9.1/ld/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -653,21 +679,22 @@ test "$host_alias" != "$target_alias" &&
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:662: checking for a BSD compatible install" >&5
+echo "configure:689: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -706,13 +733,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:716: checking whether build environment is sane" >&5
+echo "configure:745: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -769,7 +798,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:773: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:802: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -815,7 +844,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:819: checking for working aclocal" >&5
+echo "configure:848: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -828,7 +857,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:832: checking for working autoconf" >&5
+echo "configure:861: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -841,7 +870,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:845: checking for working automake" >&5
+echo "configure:874: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -854,7 +883,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:858: checking for working autoheader" >&5
+echo "configure:887: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -867,7 +896,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:871: checking for working makeinfo" >&5
+echo "configure:900: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -930,15 +959,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:934: checking for $ac_word" >&5
+echo "configure:963: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -959,15 +989,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:963: checking for $ac_word" >&5
+echo "configure:993: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -985,19 +1016,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1056: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1085: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1118: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1032,25 +1159,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1170: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1201: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1050 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1212 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1064,18 +1227,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1074: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1243: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1079: checking whether we are using GNU C" >&5
+echo "configure:1248: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1084,7 +1253,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1095,11 +1264,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1103: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1276: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1114,18 +1287,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1139,7 +1339,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1143: checking for ld used by GCC" >&5
+echo "configure:1343: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1157,10 +1357,10 @@ echo "configure:1143: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1161: checking for GNU ld" >&5
+echo "configure:1361: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1164: checking for non-GNU ld" >&5
+echo "configure:1364: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1196,7 +1396,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1200: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1400: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1212,7 +1412,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1216: checking for BSD-compatible nm" >&5
+echo "configure:1416: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1249,7 +1449,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1253: checking whether ln -s works" >&5
+echo "configure:1453: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1259,14 +1459,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1285,8 +1495,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1289 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1499 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1354,15 +1564,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1358: checking for $ac_word" >&5
+echo "configure:1568: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1380,19 +1591,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1598: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1631: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1660: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1387: checking for $ac_word" >&5
+echo "configure:1693: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1427,25 +1734,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1745: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1435: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1776: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1445 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1787 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1459,18 +1802,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1469: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1818: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1474: checking whether we are using GNU C" >&5
+echo "configure:1823: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1479,7 +1828,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1490,11 +1839,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1498: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1851: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1509,35 +1862,62 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1529: checking for Cygwin32 environment" >&5
+echo "configure:1909: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1534 "configure"
+#line 1914 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1554,19 +1934,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1558: checking for Mingw32 environment" >&5
+echo "configure:1938: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1563 "configure"
+#line 1943 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1585,7 +1965,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1589: checking for executable suffix" >&5
+echo "configure:1969: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1614,15 +1994,16 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1618: checking for $ac_word" >&5
+echo "configure:1998: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_YACC="$ac_prog"
@@ -1646,15 +2027,16 @@ test -n "$YACC" || YACC="yacc"
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1650: checking for $ac_word" >&5
+echo "configure:2031: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$LEX"; then
   ac_cv_prog_LEX="$LEX" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_LEX="flex"
@@ -1679,7 +2061,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1683: checking for yywrap in -l$ac_lib" >&5
+echo "configure:2065: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1687,7 +2069,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1691 "configure"
+#line 2073 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1698,7 +2080,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1721,7 +2103,7 @@ fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1725: checking how to run the C preprocessor" >&5
+echo "configure:2107: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1736,14 +2118,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1740 "configure"
+#line 2122 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1753,14 +2135,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1757 "configure"
+#line 2139 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2156 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1773,6 +2172,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1782,7 +2183,7 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1786: checking lex output file root" >&5
+echo "configure:2187: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1803,7 +2204,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:1807: checking whether yytext is a pointer" >&5
+echo "configure:2208: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1815,14 +2216,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 1819 "configure"
+#line 2220 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -1844,8 +2245,23 @@ EOF
 fi
 
 
+# begin-GG-local
+echo $ac_n "checking whether compiling a cross-linker""... $ac_c" 1>&6
+echo "configure:2251: checking whether compiling a cross-linker" >&5
+if test "${host}" = "${target}"; then
+  cross_linker=no
+else
+  cross_linker=yes
+  cat >> confdefs.h <<\EOF
+#define CROSS_LINKER 1
+EOF
+
+fi
+echo "$ac_t""$cross_linker" 1>&6
+# end-GG-local
+
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1849: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2265: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1874,18 +2290,18 @@ for ac_hdr in string.h strings.h stdlib.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1878: checking for $ac_hdr" >&5
+echo "configure:2294: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1883 "configure"
+#line 2299 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1913,12 +2329,12 @@ done
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1917: checking for $ac_func" >&5
+echo "configure:2333: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1922 "configure"
+#line 2338 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1941,7 +2357,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1970,12 +2386,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1974: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2390: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1979 "configure"
+#line 2395 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1983,7 +2399,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2008,7 +2424,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2012: checking for opendir in -ldir" >&5
+echo "configure:2428: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2016,7 +2432,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2020 "configure"
+#line 2436 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2027,7 +2443,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2049,7 +2465,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2053: checking for opendir in -lx" >&5
+echo "configure:2469: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2057,7 +2473,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2061 "configure"
+#line 2477 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2068,7 +2484,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2101,12 +2517,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:2105: checking whether strstr must be declared" >&5
+echo "configure:2521: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2110 "configure"
+#line 2526 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2127,7 +2543,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -2149,12 +2565,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2153: checking whether free must be declared" >&5
+echo "configure:2569: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2158 "configure"
+#line 2574 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2175,7 +2591,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -2197,12 +2613,12 @@ EOF
 fi
 
 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
-echo "configure:2201: checking whether sbrk must be declared" >&5
+echo "configure:2617: checking whether sbrk must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2622 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2223,7 +2639,7 @@ int main() {
 char *(*pfn) = (char *(*)) sbrk
 ; return 0; }
 EOF
-if { (eval echo configure:2227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_sbrk=no
 else
@@ -2245,12 +2661,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:2249: checking whether getenv must be declared" >&5
+echo "configure:2665: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2254 "configure"
+#line 2670 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2271,7 +2687,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -2337,6 +2753,9 @@ done
 
 
 
+
+
+
 if test x${all_targets} = xtrue; then
   if test x${want64} = xtrue; then
     EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
@@ -2378,7 +2797,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2424,7 +2843,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2445,7 +2866,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2469,6 +2890,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2486,6 +2908,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2503,8 +2929,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2515,6 +2941,7 @@ s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
+s%@AR@%$AR%g
 s%@LD@%$LD%g
 s%@NM@%$NM%g
 s%@LN_S@%$LN_S%g
@@ -2532,6 +2959,9 @@ s%@HOSTING_LIBS@%$HOSTING_LIBS%g
 s%@NATIVE_LIB_DIRS@%$NATIVE_LIB_DIRS%g
 s%@EMUL@%$EMUL%g
 s%@TDIRS@%$TDIRS%g
+s%@LDNAME@%$LDNAME%g
+s%@EXTRA_PROGS@%$EXTRA_PROGS%g
+s%@EXTRA_INSTALL@%$EXTRA_INSTALL%g
 s%@EMULATION_OFILES@%$EMULATION_OFILES%g
 s%@TESTBFDLIB@%$TESTBFDLIB%g
 
@@ -2676,6 +3106,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -2721,6 +3152,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2752,6 +3184,7 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/ld/configure.host b/ld/configure.host
index 883ce67..f0810fc 100644
--- binutils-2.9.1.orig/ld/configure.host
+++ binutils-2.9.1/ld/configure.host
@@ -35,6 +35,10 @@ alpha*-*-*)
   NATIVE_LIB_DIRS=/usr/ccs/lib
   ;;
 
+i[3456]86-*-beos*)
+  NATIVE_LIB_DIRS=/boot/develop/lib/x86
+  ;;
+
 i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*)
   # The new BSD `make' has a bug: it doesn't pass empty arguments in
   # shell commands.  So we need to make this value non-empty in order
@@ -114,6 +118,10 @@ mips*-sgi-irix[56]*)
   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
   ;;
 
+m68*-*-amigaos*)
+  HDEFINES=-mstackextend
+  ;;
+
 m68*-*-linux*aout*)
   HOSTING_CRT0=/usr/lib/crt0.o
   ;;
diff --git a/ld/configure.in b/ld/configure.in
index dbadbe0..cfb9ef2 100644
--- binutils-2.9.1.orig/ld/configure.in
+++ binutils-2.9.1/ld/configure.in
@@ -45,6 +45,17 @@ AC_PROG_YACC
 AC_PROG_LEX
 AC_DECL_YYTEXT
 
+# begin-GG-local
+AC_MSG_CHECKING(whether compiling a cross-linker)
+if test "${host}" = "${target}"; then
+  cross_linker=no
+else
+  cross_linker=yes
+  AC_DEFINE(CROSS_LINKER)
+fi
+AC_MSG_RESULT($cross_linker)
+# end-GG-local
+
 AM_MAINTAINER_MODE
 
 . ${srcdir}/configure.host
@@ -108,6 +119,9 @@ done
 
 AC_SUBST(EMUL)
 AC_SUBST(TDIRS)
+AC_SUBST(LDNAME)
+AC_SUBST(EXTRA_PROGS)
+AC_SUBST(EXTRA_INSTALL)
 
 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
 dnl target, and in those cases we should also build the 64 bit
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 18c74c4..fd6a33d 100644
--- binutils-2.9.1.orig/ld/configure.tgt
+++ binutils-2.9.1/ld/configure.tgt
@@ -97,6 +97,7 @@ i[3456]86-*-winnt*)	targ_emul=i386pe ;;
 i[3456]86-*-pe)		targ_emul=i386pe ;;
 i[3456]86-*-cygwin32*)	targ_emul=i386pe ;;
 i[3456]86-*-mingw32*)	targ_emul=i386pe ;;
+i[3456]86-*-beos*)	targ_emul=i386beos ;;
 m8*-*-*)		targ_emul=m88kbcs ;;
 a29k-*-udi)		targ_emul=sa29200 ;;
 a29k-*-ebmon)		targ_emul=ebmon29k ;;
@@ -119,6 +120,7 @@ sh-*-*|sh-*-rtems*)	targ_emul=sh; targ_extra_emuls=shl ;;
 m68k-sony-*)		targ_emul=news ;;
 m68k-hp-bsd*)		targ_emul=hp300bsd ;;
 m68*-motorola-sysv*)	targ_emul=delta68 ;;
+m68*-*-amigaos*)	targ_emul=amiga ; targ_extra_emuls=amiga_bss;;
 m68*-*-aout)		targ_emul=m68kaout ;;
 m68*-*-coff)		targ_emul=m68kcoff ;;
 m68*-*-elf)		targ_emul=m68kelf ;;
@@ -180,6 +182,9 @@ alpha*-*-netbsd*)	targ_emul=elf64alpha ;;
 z8k-*-coff) 		targ_emul=z8002; targ_extra_emuls=z8001 ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)	targ_emul=pc532macha ;;
 ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
+powerpc-*-amigaos*)	targ_emul=elf32ppc ;;
+powerpc-*-amigaoshunk*)	targ_emul=ppcamiga ; targ_extra_emuls=ppcamiga_bss;;
+powerpc-*-morphos*)	targ_emul=morphos ; targ_extra_emuls=morphos_baserel;;
 powerpc-*-elf* | powerpc-*-eabi* | powerpc-*-linux-gnu* | powerpc-*-sysv* \
   | powerpc-*-netbsd*)
 	targ_emul=elf32ppc ;;
@@ -208,3 +213,24 @@ w65-*-*)		targ_emul=w65 ;;
   exit 1
 
 esac
+
+# Begin GG local change
+#
+# Note that you might think we could override program_transform_name in order to
+# force the installed GNU ld binary to be ld-coff for BeOS.  This actually does
+# work, until you configure and build the linker as part of a larger source
+# tree and INSTALL_XFORM is passed down from above and wipes out your change.
+# So we need an out-of-band method of renaming the installed binary that is
+# not affected by any other name transformation rules.
+
+case "${targ}" in
+powerpc-*-beos*)	LDNAME=ld-coff
+			EXTRA_PROGS=beos-ld
+			EXTRA_INSTALL=install-beos-ld
+			;;
+*)			LDNAME=ld
+			EXTRA_PROGS=
+			EXTRA_INSTALL=
+			;;
+esac
+# End GG local change
diff --git a/ld/emulparams/amiga.sh b/ld/emulparams/amiga.sh
new file mode 100755
index 0000000..42f1c021
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/amiga.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x0
+PAGE_SIZE=0x0
+SEGMENT_SIZE=0x0
+NONPAGED_TEXT_START_ADDR=0x0
+TEMPLATE_NAME=amiga
+ARCH=m68k
diff --git a/ld/emulparams/amiga_bss.sh b/ld/emulparams/amiga_bss.sh
new file mode 100755
index 0000000..acc5185
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/amiga_bss.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga_bss
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x0
+PAGE_SIZE=0x0
+SEGMENT_SIZE=0x0
+NONPAGED_TEXT_START_ADDR=0x0
+TEMPLATE_NAME=amiga
+ARCH=m68k
diff --git a/ld/emulparams/i386beos.sh b/ld/emulparams/i386beos.sh
new file mode 100755
index 0000000..869da5f
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/i386beos.sh
@@ -0,0 +1,5 @@
+ARCH=i386
+SCRIPT_NAME=i386beos
+OUTPUT_FORMAT="pei-i386"
+RELOCATEABLE_OUTPUT_FORMAT="pe-i386"
+TEMPLATE_NAME=beos
diff --git a/ld/emulparams/morphos.sh b/ld/emulparams/morphos.sh
new file mode 100755
index 0000000..fcb849a
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/morphos.sh
@@ -0,0 +1,8 @@
+TEMPLATE_NAME=morphos
+SCRIPT_NAME=morphos
+OUTPUT_FORMAT="elf32-morphos"
+MAXPAGESIZE=0x10000
+ARCH=powerpc
+MACHINE=
+LIB_PATH=/gg/lib:/gg/usr/lib
+
diff --git a/ld/emulparams/morphos_baserel.sh b/ld/emulparams/morphos_baserel.sh
new file mode 100755
index 0000000..c7cc4f0
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/morphos_baserel.sh
@@ -0,0 +1,8 @@
+TEMPLATE_NAME=morphos
+SCRIPT_NAME=morphos_baserel
+OUTPUT_FORMAT="elf32-morphos"
+MAXPAGESIZE=0x10000
+ARCH=powerpc
+MACHINE=
+LIB_PATH=/gg/lib:/gg/usr/lib
+
diff --git a/ld/emulparams/ppcamiga.sh b/ld/emulparams/ppcamiga.sh
new file mode 100755
index 0000000..3f266cf
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/ppcamiga.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x400
+PAGE_SIZE=0x400
+SEGMENT_SIZE=0x400
+NONPAGED_TEXT_START_ADDR=0x400
+TEMPLATE_NAME=amiga
+ARCH=powerpc
diff --git a/ld/emulparams/ppcamiga_bss.sh b/ld/emulparams/ppcamiga_bss.sh
new file mode 100755
index 0000000..8d1720f
--- /dev/null
+++ binutils-2.9.1/ld/emulparams/ppcamiga_bss.sh
@@ -0,0 +1,8 @@
+SCRIPT_NAME=amiga_bss
+OUTPUT_FORMAT="amiga"
+TEXT_START_ADDR=0x400
+PAGE_SIZE=0x400
+SEGMENT_SIZE=0x400
+NONPAGED_TEXT_START_ADDR=0x400
+TEMPLATE_NAME=amiga
+ARCH=powerpc
diff --git a/ld/emultempl/amiga.em b/ld/emultempl/amiga.em
new file mode 100755
index 0000000..b593296
--- /dev/null
+++ binutils-2.9.1/ld/emultempl/amiga.em
@@ -0,0 +1,290 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is is generated by a shell script.  DO NOT EDIT! */
+
+/* emulate the original gld for the given ${EMULATION_NAME}
+   Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+   Written by Steve Chamberlain steve@cygnus.com
+
+This file is part of GLD, the Gnu Linker.
+
+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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#define TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+
+#include "getopt.h"
+#include "ld.h"
+#include "config.h"
+#include "ldmain.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldmisc.h"
+#include "ldexp.h"
+#include "ldlang.h"
+
+#if defined(TARGET_IS_amiga) || defined (TARGET_IS_ppcamiga)
+#include "libamiga.h"
+#else
+extern int amiga_base_relative; /* defined in amigaoslink.c */
+#endif
+
+/* 1 means, write out debug hunk, when producing a load file */
+extern int write_debug_hunk;
+
+/* This is the attribute to use for the next file */
+extern int amiga_attribute;
+
+/* generate a resident executable */
+extern int amiga_resident;
+
+/* generate a pOS executable */
+extern int amiga_pOS_flg;
+
+static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+static int gld${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+
+/* Handle amiga specific options */
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+     int argc;
+     char **argv;
+{
+  int prevoptind = optind;
+  int prevopterr = opterr;
+  int indx;
+  int longind;
+  int optc;
+  long val;
+  char *end;
+
+#define OPTION_IGNORE (300)
+#define OPTION_AMIGA_CHIP               (OPTION_IGNORE + 1)
+#define OPTION_AMIGA_FAST               (OPTION_AMIGA_CHIP + 1)
+#define OPTION_AMIGA_ATTRIBUTE          (OPTION_AMIGA_FAST + 1)
+#define OPTION_AMIGA_DEBUG              (OPTION_AMIGA_ATTRIBUTE + 1)
+#define OPTION_AMIGA_DATADATA_RELOC     (OPTION_AMIGA_DEBUG + 1)
+#define OPTION_FLAVOR			(OPTION_AMIGA_DATADATA_RELOC + 1)
+#define OPTION_AMIGA_POS		(OPTION_FLAVOR + 1)
+
+  static struct option longopts[] = {
+    {"amiga-datadata-reloc", no_argument, NULL, OPTION_AMIGA_DATADATA_RELOC},
+    /*    '\0', NULL, "Relocate for resident program", ONE_DASH },*/
+    {"amiga-debug-hunk", no_argument, NULL, OPTION_AMIGA_DEBUG},
+    /*    '\0', NULL, "Output encapsulated stabs in debug hunk", ONE_DASH },*/
+    {"attribute", required_argument, NULL, OPTION_AMIGA_ATTRIBUTE},
+    /*'\0', NULL, "Set section attributes", ONE_DASH },*/
+    {"chip", no_argument, NULL, OPTION_AMIGA_CHIP},
+    /*'\0', NULL, "Force sections in chip memory", ONE_DASH },*/
+    {"fast", no_argument, NULL, OPTION_AMIGA_FAST},
+    /*'\0', NULL, "Force sections in fast memory", ONE_DASH },*/
+    {"flavor", required_argument, NULL, OPTION_FLAVOR},
+    /*'\0', NULL, "Select a library flavor", ONE_DASH },*/
+    {"pos", no_argument, NULL, OPTION_AMIGA_POS},
+    /*'\0', NULL, "Output a pOS executable", ONE_DASH },*/
+    {NULL, no_argument, NULL, 0}
+  };
+
+  indx = optind;
+  if (indx == 0)
+    indx = 1;
+
+  opterr = 0;
+  optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+  opterr = prevopterr;
+  switch (optc)
+    {
+    default:
+      optind = prevoptind;
+      return 0;
+
+    case 0:
+      /* Long option which just sets a flag.  */
+      break;
+
+    case OPTION_AMIGA_CHIP:
+      amiga_attribute=2; /* We do not use MEMF_FAST, so we do not have to include exec/memory.h*/
+      break;
+    case OPTION_AMIGA_FAST:
+      amiga_attribute=4;
+      break;
+    case OPTION_AMIGA_ATTRIBUTE:
+      {
+	char *end;
+	amiga_attribute = strtoul (optarg, &end, 0);
+	if (*end)
+	  einfo ("%P%F: invalid number \`%s\'\n", optarg);
+      }
+      break;
+    case OPTION_AMIGA_DEBUG:
+      write_debug_hunk=1; /* Write out debug hunk */
+      break;
+
+    case OPTION_AMIGA_DATADATA_RELOC:
+      amiga_resident=1; /* Write out datadata_reloc array */
+      break;
+
+    case OPTION_FLAVOR:
+      {
+	extern void ldfile_add_flavor (char*);
+	ldfile_add_flavor (optarg);
+      }
+      break;
+
+    case OPTION_AMIGA_POS:
+      amiga_pOS_flg = 1;
+      break;
+    }
+  return 1;
+}
+
+static void
+gld${EMULATION_NAME}_before_parse()
+{
+#if defined(TARGET_IS_amiga_bss) || defined (TARGET_IS_ppcamiga_bss)
+  amiga_base_relative=1;
+  amiga_resident=0;
+#endif
+
+#ifndef TARGET_			/* I.e., if not generic.  */
+  ldfile_output_architecture = bfd_arch_${ARCH};
+#endif /* not TARGET_ */
+}
+
+static void 
+gld${EMULATION_NAME}_after_parse()
+{
+  sort_flavors();
+}
+
+static void 
+gld${EMULATION_NAME}_after_open()
+{
+  ldctor_build_sets ();
+}
+
+#if defined(TARGET_IS_amiga) || defined (TARGET_IS_ppcamiga)
+
+static void
+ amiga_assign_attribute(lang_input_statement_type *);
+
+void
+amiga_after_allocation()
+{
+#if 0 /* Does not work at the moment */
+  lang_for_each_input_file (amiga_assign_attribute);
+#endif
+}
+
+static void
+amiga_assign_attribute(inp)
+     lang_input_statement_type *inp;
+{
+  asection *s;
+
+  if (inp->the_bfd->xvec->flavour==bfd_target_amiga_flavour)
+    {
+      for (s=inp->the_bfd->sections;s!=NULL;s=s->next)
+	amiga_per_section(s)->attribute=inp->amiga_attribute;
+    }
+
+}
+#else
+extern void
+amiga_after_allocation();
+#endif
+
+static char *
+gld${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc="-f ${srcdir}/emultempl/stringify.sed"
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+echo '  ; else return'                                     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
+echo '; }'                                                 >> e${EMULATION_NAME}.c
+
+else
+# Scripts read from the filesystem.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 1;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return "ldscripts/${EMULATION_NAME}.xu";
+  else if (link_info.relocateable == true)
+    return "ldscripts/${EMULATION_NAME}.xr";
+  else if (!config.text_read_only)
+    return "ldscripts/${EMULATION_NAME}.xbn";
+  else if (!config.magic_demand_paged)
+    return "ldscripts/${EMULATION_NAME}.xn";
+  else
+    return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld${EMULATION_NAME}_before_parse,	/* before_parse */
+  syslib_default,			/* syslib */
+  hll_default,				/* hll */
+  gld${EMULATION_NAME}_after_parse,
+  gld${EMULATION_NAME}_after_open,
+  amiga_after_allocation,		/* after_allocation */
+  set_output_arch_default,		/* set_output_arch */
+  ldemul_default_target,		/* choose_target */
+  before_allocation_default,		/* before_allocation */
+  gld${EMULATION_NAME}_get_script,	/* get_script */
+  "${EMULATION_NAME}",			/* emulation_name */
+  "${OUTPUT_FORMAT}",			/* target_name */
+  NULL,					/* finish */
+  NULL,					/* create_output_section_statements */
+  NULL,					/* open_dynamic_library */
+  NULL,					/* place_orphan */
+  NULL,					/* set_symbols */
+  gld${EMULATION_NAME}_parse_args,
+  NULL,					/* unrecognized file */
+};
+EOF
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em
new file mode 100644
index 0000000..c2b3ec2
--- /dev/null
+++ binutils-2.9.1/ld/emultempl/beos.em
@@ -0,0 +1,837 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is part of GLD, the Gnu Linker.
+   Copyright 1995, 96, 97, 1998 Free Software Foundation, Inc.
+
+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.  */
+
+/* For WINDOWS_NT */
+/* The original file generated returned different default scripts depending
+   on whether certain switches were set, but these switches pertain to the
+   Linux system and that particular version of coff.  In the NT case, we
+   only determine if the subsystem is console or windows in order to select
+   the correct entry point by default. */ 
+  
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "getopt.h"
+#include "libiberty.h"
+#include "ld.h"
+#include "ldmain.h"
+#include "ldgram.h"
+#include "ldexp.h"
+#include "ldlang.h"
+#include "ldemul.h"
+#include "ldlex.h"
+#include "ldmisc.h"
+#include "ldctor.h"
+#include "ldfile.h"
+#include "coff/internal.h"
+#include "../bfd/libcoff.h"
+
+#define TARGET_IS_${EMULATION_NAME}
+
+static void gld_${EMULATION_NAME}_set_symbols PARAMS ((void));
+static void gld_${EMULATION_NAME}_after_open PARAMS ((void));
+static void gld_${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld_${EMULATION_NAME}_before_allocation PARAMS ((void));
+static boolean gld${EMULATION_NAME}_place_orphan
+  PARAMS ((lang_input_statement_type *, asection *));
+static char *gld_${EMULATION_NAME}_get_script PARAMS ((int *));
+static int gld_${EMULATION_NAME}_parse_args PARAMS ((int, char **));
+
+#if 0 /* argument to qsort so don't prototype */
+static int sort_by_file_name PARAMS ((void *, void *));
+static int sort_by_section_name PARAMS ((void *, void *));
+#endif
+static lang_statement_union_type **sort_sections_1
+  PARAMS ((lang_statement_union_type **, lang_statement_union_type *, int,
+	   int (*)()));
+static void sort_sections PARAMS ((lang_statement_union_type *));
+
+static struct internal_extra_pe_aouthdr pe;
+static int dll;
+
+extern const char *output_filename;
+
+static void
+gld_${EMULATION_NAME}_before_parse()
+{
+  output_filename = "a.exe";
+  ldfile_output_architecture = bfd_arch_${ARCH};
+}
+
+/* PE format extra command line options.  */
+
+/* Used for setting flags in the PE header. */
+#define OPTION_BASE_FILE		(300  + 1)
+#define OPTION_DLL			(OPTION_BASE_FILE + 1)
+#define OPTION_FILE_ALIGNMENT		(OPTION_DLL + 1)
+#define OPTION_IMAGE_BASE		(OPTION_FILE_ALIGNMENT + 1)
+#define OPTION_MAJOR_IMAGE_VERSION	(OPTION_IMAGE_BASE + 1)
+#define OPTION_MAJOR_OS_VERSION		(OPTION_MAJOR_IMAGE_VERSION + 1)
+#define OPTION_MAJOR_SUBSYSTEM_VERSION	(OPTION_MAJOR_OS_VERSION + 1)
+#define OPTION_MINOR_IMAGE_VERSION	(OPTION_MAJOR_SUBSYSTEM_VERSION + 1)
+#define OPTION_MINOR_OS_VERSION		(OPTION_MINOR_IMAGE_VERSION + 1)
+#define OPTION_MINOR_SUBSYSTEM_VERSION	(OPTION_MINOR_OS_VERSION + 1)
+#define OPTION_SECTION_ALIGNMENT	(OPTION_MINOR_SUBSYSTEM_VERSION + 1)
+#define OPTION_STACK                    (OPTION_SECTION_ALIGNMENT + 1)
+#define OPTION_SUBSYSTEM                (OPTION_STACK + 1)
+#define OPTION_HEAP			(OPTION_SUBSYSTEM + 1)
+
+static struct option longopts[] = {
+  /* PE options */
+    {"base-file", required_argument, NULL, OPTION_BASE_FILE},
+    {"dll", no_argument, NULL, OPTION_DLL},
+    {"file-alignment", required_argument, NULL, OPTION_FILE_ALIGNMENT},
+    {"heap", required_argument, NULL, OPTION_HEAP}, 
+    {"image-base", required_argument, NULL, OPTION_IMAGE_BASE}, 
+    {"major-image-version", required_argument, NULL, OPTION_MAJOR_IMAGE_VERSION},
+    {"major-os-version", required_argument, NULL, OPTION_MAJOR_OS_VERSION},
+    {"major-subsystem-version", required_argument, NULL, OPTION_MAJOR_SUBSYSTEM_VERSION},
+    {"minor-image-version", required_argument, NULL, OPTION_MINOR_IMAGE_VERSION},
+    {"minor-os-version", required_argument, NULL, OPTION_MINOR_OS_VERSION},
+    {"minor-subsystem-version", required_argument, NULL, OPTION_MINOR_SUBSYSTEM_VERSION},
+    {"section-alignment", required_argument, NULL, OPTION_SECTION_ALIGNMENT},
+    {"stack", required_argument, NULL, OPTION_STACK},
+    {"subsystem", required_argument, NULL, OPTION_SUBSYSTEM},
+   {NULL, no_argument, NULL, 0}
+  };
+
+
+/* PE/WIN32; added routines to get the subsystem type, heap and/or stack
+   parameters which may be input from the command line */
+
+typedef struct {
+  void *ptr;
+  int size;
+  int value;
+  char *symbol;
+  int inited;
+} definfo;
+
+#define D(field,symbol,def)  {&pe.field,sizeof(pe.field), def, symbol,0}
+
+static definfo init[] =
+{
+  /* imagebase must be first */
+#define IMAGEBASEOFF 0
+  D(ImageBase,"__image_base__", BEOS_EXE_IMAGE_BASE),
+#define DLLOFF 1
+  {&dll, sizeof(dll), 0, "__dll__"},
+  D(SectionAlignment,"__section_alignment__", PE_DEF_SECTION_ALIGNMENT),
+  D(FileAlignment,"__file_alignment__", PE_DEF_FILE_ALIGNMENT),
+  D(MajorOperatingSystemVersion,"__major_os_version__", 4),
+  D(MinorOperatingSystemVersion,"__minor_os_version__", 0),
+  D(MajorImageVersion,"__major_image_version__", 1),
+  D(MinorImageVersion,"__minor_image_version__", 0),
+  D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
+  D(MinorSubsystemVersion,"__minor_subsystem_version__", 0),
+  D(Subsystem,"__subsystem__", 3),
+  D(SizeOfStackReserve,"__size_of_stack_reserve__", 0x2000000),
+  D(SizeOfStackCommit,"__size_of_stack_commit__", 0x1000),
+  D(SizeOfHeapReserve,"__size_of_heap_reserve__", 0x100000),
+  D(SizeOfHeapCommit,"__size_of_heap_commit__", 0x1000),
+  D(LoaderFlags,"__loader_flags__", 0x0),
+  { NULL, 0, 0, NULL, 0 }
+};
+
+
+static void
+set_pe_name (name, val)
+     char *name;
+     long val;
+{
+  int i;
+  /* Find the name and set it. */
+  for (i = 0; init[i].ptr; i++)
+    {
+      if (strcmp (name, init[i].symbol) == 0)
+	{
+	  init[i].value = val;
+	  init[i].inited = 1;
+	  return;
+	}
+    }
+  abort();
+}
+
+
+static void
+set_pe_subsystem ()
+{
+  const char *sver;
+  int len;
+  int i;
+  static const struct 
+    {
+      const char *name;
+      const int value;
+      const char *entry;
+    }
+  v[] =
+    {
+      { "native", 1, "_NtProcessStartup" },
+      { "windows", 2, "_WinMainCRTStartup" },
+      { "wwindows", 2, "_wWinMainCRTStartup" },
+      { "console", 3, "_mainCRTStartup" },
+      { "wconsole", 3, "_wmainCRTStartup" },
+#if 0
+      /* The Microsoft linker does not recognize this.  */
+      { "os2", 5, "" },
+#endif
+      { "posix", 7, "___PosixProcessStartup"},
+      { 0, 0, 0 }
+    };
+
+  sver = strchr (optarg, ':');
+  if (sver == NULL)
+    len = strlen (optarg);
+  else
+    {
+      char *end;
+
+      len = sver - optarg;
+      set_pe_name ("__major_subsystem_version__",
+		   strtoul (sver + 1, &end, 0));
+      if (*end == '.')
+	set_pe_name ("__minor_subsystem_version__",
+		     strtoul (end + 1, &end, 0));
+      if (*end != '\0')
+	einfo ("%P: warning: bad version number in -subsystem option\n");
+    }
+
+  for (i = 0; v[i].name; i++)
+    {
+      if (strncmp (optarg, v[i].name, len) == 0
+	  && v[i].name[len] == '\0')
+	{
+	  set_pe_name ("__subsystem__", v[i].value);
+
+	  /* If the subsystem is windows, we use a different entry
+	     point.  We also register the entry point as an undefined
+	     symbol. from lang_add_entry() The reason we do
+	     this is so that the user
+	     doesn't have to because they would have to use the -u
+	     switch if they were specifying an entry point other than
+	     _mainCRTStartup.  Specifically, if creating a windows
+	     application, entry point _WinMainCRTStartup must be
+	     specified.  What I have found for non console
+	     applications (entry not _mainCRTStartup) is that the .obj
+	     that contains mainCRTStartup is brought in since it is
+	     the first encountered in libc.lib and it has other
+	     symbols in it which will be pulled in by the link
+	     process.  To avoid this, adding -u with the entry point
+	     name specified forces the correct .obj to be used.  We
+	     can avoid making the user do this by always adding the
+	     entry point name as an undefined symbol.  */
+	  lang_add_entry (v[i].entry, 1);
+
+	  return;
+	}
+    }
+  einfo ("%P%F: invalid subsystem type %s\n", optarg);
+}
+
+
+
+static void
+set_pe_value (name)
+     char *name;
+     
+{
+  char *end;
+  set_pe_name (name,  strtoul (optarg, &end, 0));
+  if (end == optarg)
+    {
+      einfo ("%P%F: invalid hex number for PE parameter '%s'\n", optarg);
+    }
+
+  optarg = end;
+}
+
+static void
+set_pe_stack_heap (resname, comname)
+     char *resname;
+     char *comname;
+{
+  set_pe_value (resname);
+  if (*optarg == ',')
+    {
+      optarg++;
+      set_pe_value (comname);
+    }
+  else if (*optarg)
+    {
+      einfo ("%P%F: strange hex info for PE parameter '%s'\n", optarg);
+    }
+}
+
+
+
+static int
+gld_${EMULATION_NAME}_parse_args(argc, argv)
+     int argc;
+     char **argv;
+{
+  int longind;
+  int optc;
+  int prevoptind = optind;
+  int prevopterr = opterr;
+  int wanterror;
+  static int lastoptind = -1;
+
+  if (lastoptind != optind)
+    opterr = 0;
+  wanterror = opterr;
+
+  lastoptind = optind;
+
+  optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+  opterr = prevopterr;
+
+  switch (optc)
+    {
+    default:
+      if (wanterror)
+	xexit (1);
+      optind =  prevoptind;
+      return 0;
+
+    case OPTION_BASE_FILE:
+      link_info.base_file = (PTR) fopen (optarg, FOPEN_WB);
+      if (link_info.base_file == NULL)
+	{
+	  fprintf (stderr, "%s: Can't open base file %s\n",
+		   program_name, optarg);
+	  xexit (1);
+	}
+      break;
+
+      /* PE options */
+    case OPTION_HEAP: 
+      set_pe_stack_heap ("__size_of_heap_reserve__", "__size_of_heap_commit__");
+      break;
+    case OPTION_STACK: 
+      set_pe_stack_heap ("__size_of_stack_reserve__", "__size_of_stack_commit__");
+      break;
+    case OPTION_SUBSYSTEM:
+      set_pe_subsystem ();
+      break;
+    case OPTION_MAJOR_OS_VERSION:
+      set_pe_value ("__major_os_version__");
+      break;
+    case OPTION_MINOR_OS_VERSION:
+      set_pe_value ("__minor_os_version__");
+      break;
+    case OPTION_MAJOR_SUBSYSTEM_VERSION:
+      set_pe_value ("__major_subsystem_version__");
+      break;
+    case OPTION_MINOR_SUBSYSTEM_VERSION:
+      set_pe_value ("__minor_subsystem_version__");
+      break;
+    case OPTION_MAJOR_IMAGE_VERSION:
+      set_pe_value ("__major_image_version__");
+      break;
+    case OPTION_MINOR_IMAGE_VERSION:
+      set_pe_value ("__minor_image_version__");
+      break;
+    case OPTION_FILE_ALIGNMENT:
+      set_pe_value ("__file_alignment__");
+      break;
+    case OPTION_SECTION_ALIGNMENT:
+      set_pe_value ("__section_alignment__");
+      break;
+    case OPTION_DLL:
+      set_pe_name ("__dll__", 1);
+      break;
+    case OPTION_IMAGE_BASE:
+      set_pe_value ("__image_base__");
+      break;
+    }
+  return 1;
+}
+
+/* Assign values to the special symbols before the linker script is
+   read.  */
+
+static void
+gld_${EMULATION_NAME}_set_symbols()
+{
+  /* Run through and invent symbols for all the
+     names and insert the defaults. */
+  int j;
+  lang_statement_list_type *save;
+
+  if (!init[IMAGEBASEOFF].inited)
+    {
+      if (link_info.relocateable)
+	init[IMAGEBASEOFF].value = 0;
+      else if (init[DLLOFF].value)
+	init[IMAGEBASEOFF].value = BEOS_DLL_IMAGE_BASE;
+      else
+	init[IMAGEBASEOFF].value = BEOS_EXE_IMAGE_BASE;
+    }
+
+  /* Don't do any symbol assignments if this is a relocateable link.  */
+  if (link_info.relocateable)
+    return;
+
+  /* Glue the assignments into the abs section */
+  save = stat_ptr;
+
+  stat_ptr = &(abs_output_section->children);
+
+  for (j = 0; init[j].ptr; j++)
+    {
+      long val = init[j].value;
+      lang_add_assignment (exp_assop ('=' ,init[j].symbol, exp_intop (val)));
+      if (init[j].size == sizeof(short))
+	*(short *)init[j].ptr = val;
+      else if (init[j].size == sizeof(int))
+	*(int *)init[j].ptr = val;
+      else if (init[j].size == sizeof(long))
+	*(long *)init[j].ptr = val;
+      /* This might be a long long or other special type.  */
+      else if (init[j].size == sizeof(bfd_vma))
+	*(bfd_vma *)init[j].ptr = val;
+      else	abort();
+    }
+  /* Restore the pointer. */
+  stat_ptr = save;
+  
+  if (pe.FileAlignment >
+      pe.SectionAlignment)
+    {
+      einfo ("%P: warning, file alignment > section alignment.\n");
+    }
+}
+
+static void
+gld_${EMULATION_NAME}_after_open()
+{
+  /* Pass the wacky PE command line options into the output bfd.
+     FIXME: This should be done via a function, rather than by
+     including an internal BFD header.  */
+  if (!coff_data(output_bfd)->pe)
+    {
+      einfo ("%F%P: PE operations on non PE file.\n");
+    }
+
+  pe_data(output_bfd)->pe_opthdr = pe;
+  pe_data(output_bfd)->dll = init[DLLOFF].value;
+
+}
+
+/* Callback functions for qsort in sort_sections. */
+
+static int
+sort_by_file_name (a, b)
+     void *a;
+     void *b;
+{
+  lang_statement_union_type **ra = a;
+  lang_statement_union_type **rb = b;
+  int i, a_sec, b_sec;
+
+  i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename,
+	      (*rb)->input_section.ifile->the_bfd->my_archive->filename);
+  if (i != 0)
+    return i;
+
+  i = strcmp ((*ra)->input_section.ifile->filename,
+		 (*rb)->input_section.ifile->filename);
+  if (i != 0)
+    return i;
+  /* the tail idata4/5 are the only ones without relocs to an
+     idata$6 section unless we are importing by ordinal, 
+     so sort them to last to terminate the IAT
+     and HNT properly. if no reloc this one is import by ordinal
+     so we have to sort by section contents */
+
+  if ( ((*ra)->input_section.section->reloc_count + (*rb)->input_section.section->reloc_count) )
+    {
+       i =  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? -1 : 0);
+       if ( i != 0)
+         return i;
+
+        return  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? 0 : 1);
+    }
+  else
+    {
+       if ( (strcmp( (*ra)->input_section.section->name, ".idata$6") == 0) )
+          return 0; /* don't sort .idata$6 or .idata$7 FIXME dlltool eliminate .idata$7 */
+
+       if (! bfd_get_section_contents ((*ra)->input_section.ifile->the_bfd, 
+         (*ra)->input_section.section, &a_sec, (file_ptr) 0, (bfd_size_type)sizeof(a_sec)))
+            einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                 (*ra)->input_section.ifile->the_bfd);
+
+       if (! bfd_get_section_contents ((*rb)->input_section.ifile->the_bfd, 
+        (*rb)->input_section.section, &b_sec, (file_ptr) 0, (bfd_size_type)sizeof(b_sec) ))
+           einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                (*rb)->input_section.ifile->the_bfd);
+
+      i =  ((a_sec < b_sec) ? -1 : 0);
+      if ( i != 0)
+        return i;
+      return  ((a_sec < b_sec) ? 0 : 1);
+   }
+return 0;
+}
+
+static int
+sort_by_section_name (a, b)
+     void *a;
+     void *b;
+{
+  lang_statement_union_type **ra = a;
+  lang_statement_union_type **rb = b;
+  int i;
+  i = strcmp ((*ra)->input_section.section->name,
+		 (*rb)->input_section.section->name);
+/* this is a hack to make .stab and .stabstr last, so we don't have
+   to fix strip/objcopy for .reloc sections.
+   FIXME stripping images with a .rsrc section still needs to be fixed */
+  if ( i != 0)
+    {
+      if ((strncmp ((*ra)->input_section.section->name, ".stab", 5) == 0)
+           && (strncmp ((*rb)->input_section.section->name, ".stab", 5) != 0))
+         return 1;
+      return i;
+    }
+  return i;
+}
+
+/* Subroutine of sort_sections to a contiguous subset of a list of sections.
+   NEXT_AFTER is the element after the last one to sort.
+   The result is a pointer to the last element's "next" pointer.  */
+
+static lang_statement_union_type **
+sort_sections_1 (startptr, next_after, count, sort_func)
+     lang_statement_union_type **startptr,*next_after;
+     int count;
+     int (*sort_func) ();
+{
+  lang_statement_union_type **vec;
+  lang_statement_union_type *p;
+  int i;
+  lang_statement_union_type **ret;
+
+  if (count == 0)
+    return startptr;
+
+  vec = ((lang_statement_union_type **)
+	 xmalloc (count * sizeof (lang_statement_union_type *)));
+
+  for (p = *startptr, i = 0; i < count; i++, p = p->next)
+    vec[i] = p;
+
+  qsort (vec, count, sizeof (vec[0]), sort_func);
+
+  /* Fill in the next pointers again. */
+  *startptr = vec[0];
+  for (i = 0; i < count - 1; i++)
+    vec[i]->header.next = vec[i + 1];
+  vec[i]->header.next = next_after;
+  ret = &vec[i]->header.next;
+  free (vec);
+  return ret;
+}
+
+/* Sort the .idata\$foo input sections of archives into filename order.
+   The reason is so dlltool can arrange to have the pe dll import information
+   generated correctly - the head of the list goes into dh.o, the tail into
+   dt.o, and the guts into ds[nnnn].o.  Note that this is only needed for the
+   .idata section.
+   FIXME: This may no longer be necessary with grouped sections.  Instead of
+   sorting on dh.o, ds[nnnn].o, dt.o, one could, for example, have dh.o use
+   .idata\$4h, have ds[nnnn].o use .idata\$4s[nnnn], and have dt.o use .idata\$4t.
+   This would have to be elaborated upon to handle multiple dll's
+   [assuming such an eloboration is possible of course].
+
+   We also sort sections in '\$' wild statements.  These are created by the
+   place_orphans routine to implement grouped sections.  */
+
+static void
+sort_sections (s)
+     lang_statement_union_type *s;
+{
+  for (; s ; s = s->next)
+    switch (s->header.type)
+      {
+      case lang_output_section_statement_enum:
+	sort_sections (s->output_section_statement.children.head);
+	break;
+      case lang_wild_statement_enum:
+	{
+	  lang_statement_union_type **p = &s->wild_statement.children.head;
+
+	  /* Is this the .idata section?  */
+	  if (s->wild_statement.section_name != NULL
+	      && strncmp (s->wild_statement.section_name, ".idata", 6) == 0)
+	    {
+	      /* Sort the children.  We want to sort any objects in
+                 the same archive.  In order to handle the case of
+                 including a single archive multiple times, we sort
+                 all the children by archive name and then by object
+                 name.  After sorting them, we re-thread the pointer
+                 chain.  */
+
+	      while (*p)
+		{
+		  lang_statement_union_type *start = *p;
+		  if (start->header.type != lang_input_section_enum
+		      || !start->input_section.ifile->the_bfd->my_archive)
+		    p = &(start->header.next);
+		  else
+		    {
+		      lang_statement_union_type *end;
+		      int count;
+
+		      for (end = start, count = 0;
+			   end && end->header.type == lang_input_section_enum;
+			   end = end->next)
+			count++;
+
+		      p = sort_sections_1 (p, end, count, sort_by_file_name);
+		    }
+		}
+	      break;
+	    }
+
+	  /* If this is a collection of grouped sections, sort them.
+	     The linker script must explicitly mention "*(.foo\$)" or
+	     "*(.foo\$*)".  Don't sort them if \$ is not the last
+	     character (not sure if this is really useful, but it
+	     allows explicitly mentioning some \$ sections and letting
+	     the linker handle the rest).  */
+	  if (s->wild_statement.section_name != NULL)
+	    {
+	      char *q = strchr (s->wild_statement.section_name, '\$');
+
+	      if (q != NULL
+		  && (q[1] == '\0'
+		      || (q[1] == '*' && q[2] == '\0')))
+		{
+		  lang_statement_union_type *end;
+		  int count;
+
+		  for (end = *p, count = 0; end; end = end->next)
+		    {
+		      if (end->header.type != lang_input_section_enum)
+			abort ();
+		      count++;
+		    }
+		  (void) sort_sections_1 (p, end, count, sort_by_section_name);
+		}
+	      break;
+	    }
+	}
+	break;
+      default:
+	break;
+      }
+}
+
+static void  
+gld_${EMULATION_NAME}_before_allocation()
+{
+  extern lang_statement_list_type *stat_ptr;
+
+#ifdef TARGET_IS_ppcpe
+  /* Here we rummage through the found bfds to collect toc information */
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (!ppc_process_before_allocation(is->the_bfd, &link_info))
+	  {
+	    einfo("Errors encountered processing file %s\n", is->filename);
+	  }
+      }
+  }
+
+  /* We have seen it all. Allocate it, and carry on */
+  ppc_allocate_toc_section (&link_info);
+#else
+#ifdef TARGET_IS_armpe
+  /* FIXME: we should be able to set the size of the interworking stub
+     section.
+
+     Here we rummage through the found bfds to collect glue
+     information.  FIXME: should this be based on a command line
+     option?  krk@cygnus.com */
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	if (!arm_process_before_allocation (is->the_bfd, & link_info))
+	  {
+	    einfo ("Errors encountered processing file %s", is->filename);
+	  }
+      }
+  }
+
+  /* We have seen it all. Allocate it, and carry on */
+  arm_allocate_interworking_sections (& link_info);
+#endif /* TARGET_IS_armpe */
+#endif /* TARGET_IS_ppcpe */
+
+  sort_sections (stat_ptr->head);
+}
+
+/* Place an orphan section.  We use this to put sections with a '\$' in them
+   into the right place.  Any section with a '\$' in them (e.g. .text\$foo)
+   gets mapped to the output section with everything from the '\$' on stripped
+   (e.g. .text).
+   See the Microsoft Portable Executable and Common Object File Format
+   Specification 4.1, section 4.2, Grouped Sections.
+
+   FIXME: This is now handled by the linker script using wildcards,
+   but I'm leaving this here in case we want to enable it for sections
+   which are not mentioned in the linker script.  */
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+     lang_input_statement_type *file;
+     asection *s;
+{
+  const char *secname;
+  char *output_secname, *ps;
+  lang_output_section_statement_type *os;
+  lang_statement_union_type *l;
+
+  if ((s->flags & SEC_ALLOC) == 0)
+    return false;
+
+  /* Don't process grouped sections unless doing a final link.
+     If they're marked as COMDAT sections, we don't want .text\$foo to
+     end up in .text and then have .text disappear because it's marked
+     link-once-discard.  */
+  if (link_info.relocateable)
+    return false;
+
+  secname = bfd_get_section_name (s->owner, s);
+
+  /* Everything from the '\$' on gets deleted so don't allow '\$' as the
+     first character.  */
+  if (*secname == '\$')
+    einfo ("%P%F: section %s has '\$' as first character\n", secname);
+  if (strchr (secname + 1, '\$') == NULL)
+    return false;
+
+  /* Look up the output section.  The Microsoft specs say sections names in
+     image files never contain a '\$'.  Fortunately, lang_..._lookup creates
+     the section if it doesn't exist.  */
+  output_secname = buystring (secname);
+  ps = strchr (output_secname + 1, '\$');
+  *ps = 0;
+  os = lang_output_section_statement_lookup (output_secname);
+
+  /* Find the '\$' wild statement for this section.  We currently require the
+     linker script to explicitly mention "*(.foo\$)".
+     FIXME: ppcpe.sc has .CRT\$foo in the .rdata section.  According to the
+     Microsoft docs this isn't correct so it's not (currently) handled.  */
+
+  ps[0] = '\$';
+  ps[1] = 0;
+  for (l = os->children.head; l; l = l->next)
+    {
+      if (l->header.type == lang_wild_statement_enum
+	  && strcmp (l->wild_statement.section_name, output_secname) == 0)
+	break;
+    }
+  ps[0] = 0;
+  if (l == NULL)
+#if 1
+    einfo ("%P%F: *(%s\$) missing from linker script\n", output_secname);
+#else /* FIXME: This block is untried.  It exists to convey the intent,
+	 should one decide to not require *(.foo\$) to appear in the linker
+	 script.  */
+    {
+      lang_wild_statement_type *new = new_stat (lang_wild_statement,
+						&os->children);
+      new->section_name = xmalloc (strlen (output_secname) + 2);
+      sprintf (new->section_name, "%s\$", output_secname);
+      new->filename = NULL;
+      lang_list_init (&new->children);
+      l = new;
+    }
+#endif
+
+  /* Link the input section in and we're done for now.
+     The sections still have to be sorted, but that has to wait until
+     all such sections have been processed by us.  The sorting is done by
+     sort_sections.  */
+  wild_doit (&l->wild_statement.children, s, os, file);
+
+  return true;
+}
+
+static char *
+gld_${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+# Scripts compiled in.
+# sed commands to quote an ld script as a C string.
+sc="-f ${srcdir}/emultempl/stringify.sed"
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn                    >> e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn                     >> e${EMULATION_NAME}.c
+echo '  ; else return'                                     >> e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                      >> e${EMULATION_NAME}.c
+echo '; }'                                                 >> e${EMULATION_NAME}.c
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld_${EMULATION_NAME}_before_parse,
+  syslib_default,
+  hll_default,
+  after_parse_default,
+  gld_${EMULATION_NAME}_after_open,
+  after_allocation_default,
+  set_output_arch_default,
+  ldemul_default_target,
+  gld_${EMULATION_NAME}_before_allocation,
+  gld_${EMULATION_NAME}_get_script,
+  "${EMULATION_NAME}",
+  "${OUTPUT_FORMAT}",
+  NULL, /* finish */
+  NULL, /* create output section statements */
+  NULL, /* open dynamic archive */
+  gld${EMULATION_NAME}_place_orphan,
+  gld_${EMULATION_NAME}_set_symbols,
+  gld_${EMULATION_NAME}_parse_args
+};
+EOF
diff --git a/ld/emultempl/morphos.em b/ld/emultempl/morphos.em
new file mode 100755
index 0000000..9d9fc31
--- /dev/null
+++ binutils-2.9.1/ld/emultempl/morphos.em
@@ -0,0 +1,661 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+# ELF emulations.
+test -z "${ELFSIZE}" && ELFSIZE=32
+cat >e${EMULATION_NAME}.c <<EOF
+/* This file is is generated by a shell script.  DO NOT EDIT! */
+
+/* ${ELFSIZE} bit ELF emulation code for ${EMULATION_NAME}
+   Copyright (C) 1991, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Written by Steve Chamberlain <sac@cygnus.com>
+   ELF support by Ian Lance Taylor <ian@cygnus.com>
+   MorphoS support by Emmanuel Lesueur <lesueur@club-internet.fr>
+
+This file is part of GLD, the Gnu Linker.
+
+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 TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#include <ctype.h>
+
+#include "bfdlink.h"
+#include "getopt.h"
+#include "ld.h"
+#include "ldmain.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldmisc.h"
+#include "ldexp.h"
+#include "ldlang.h"
+#include "ldgram.h"
+
+static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld${EMULATION_NAME}_set_symbols PARAMS ((void));
+static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
+static boolean gld${EMULATION_NAME}_place_orphan
+  PARAMS ((lang_input_statement_type *, asection *));
+static void gld${EMULATION_NAME}_place_section
+  PARAMS ((lang_statement_union_type *));
+static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+
+static int morphos_resident;
+ 
+/* Handle MorphOS specific options */
+static int
+gld${EMULATION_NAME}_parse_args (argc, argv)
+     int argc;
+     char **argv;
+{
+  int prevoptind = optind;
+  int prevopterr = opterr;
+  int indx;
+  int longind;
+  int optc;
+  long val;
+  char *end;
+
+#define OPTION_IGNORE (300)
+#define OPTION_MORPHOS_DATADATA_RELOC	(OPTION_IGNORE + 1)
+#define OPTION_MORPHOS_BASEREL32	(OPTION_IGNORE + 2)
+#define OPTION_FLAVOR			(OPTION_IGNORE + 3)
+
+  static struct option longopts[] = {
+    {"datadata-reloc", no_argument, NULL, OPTION_MORPHOS_DATADATA_RELOC},
+    /*    '\0', NULL, "Relocate for resident program", ONE_DASH },*/
+    {"flavor", required_argument, NULL, OPTION_FLAVOR},
+    /*'\0', NULL, "Select a library flavor", ONE_DASH },*/
+    /*{"baserel32", no_argument, NULL, OPTION_MORPHOS_BASEREL32},*/
+    /*    '\0', NULL, "Build a large-data base relative executable", ONE_DASH },*/
+    {NULL, no_argument, NULL, 0}
+  };
+
+  indx = optind;
+  if (indx == 0)
+    indx = 1;
+
+  opterr = 0;
+  optc = getopt_long_only (argc, argv, "-", longopts, &longind);
+  opterr = prevopterr;
+  switch (optc)
+    {
+    default:
+      optind = prevoptind;
+      return 0;
+
+    case 0:
+      /* Long option which just sets a flag.  */
+      break;
+
+    case OPTION_MORPHOS_DATADATA_RELOC:
+      morphos_resident=1; /* Write out datadata_reloc array */
+      break;
+
+      /*case OPTION_MORPHOS_BASEREL32:
+      morphos_baserel32=1;
+      break;*/
+
+    case OPTION_FLAVOR:
+      {
+	extern void ldfile_add_flavor (char*);
+	ldfile_add_flavor (optarg);
+      }
+      break;
+    }
+  return 1;
+}
+
+static void
+gld${EMULATION_NAME}_before_parse()
+{
+  ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
+  config.dynamic_link = ${DYNAMIC_LINK-true};
+  sort_flavors();
+}
+
+static void
+gld${EMULATION_NAME}_set_symbols()
+{
+  if (link_info.strip == strip_all)
+    {
+      link_info.keep_hash = ((struct bfd_hash_table *)
+			     xmalloc (sizeof (struct bfd_hash_table)));
+
+      if (! bfd_hash_table_init (link_info.keep_hash, bfd_hash_newfunc))
+	einfo ("%P%F: bfd_hash_table_init failed: %E\n");
+ 
+      if (bfd_hash_lookup (link_info.keep_hash, "__amigappc__", true, true) == (struct bfd_hash_entry *) NULL
+       || bfd_hash_lookup (link_info.keep_hash, "__abox__", true, true) == (struct bfd_hash_entry *) NULL)
+	einfo ("%P%F: bfd_hash_lookup for insertion failed: %E\n");
+
+      link_info.strip = strip_some;
+    }
+}
+
+
+/* These variables are required to pass information back and forth
+   between after_open and check_needed and stat_needed and vercheck.  */
+
+static struct bfd_link_needed_list *global_needed;
+static struct stat global_stat;
+static boolean global_found;
+static struct bfd_link_needed_list *global_vercheck_needed;
+static boolean global_vercheck_failed;
+
+
+/* This is called after all the input files have been opened.  */
+
+static void
+gld${EMULATION_NAME}_after_open ()
+{
+  struct bfd_link_needed_list *needed, *l;
+
+  /* We only need to worry about this when doing a final link.  */
+  if (link_info.relocateable || link_info.shared)
+    return;
+
+  /* Get the list of files which appear in DT_NEEDED entries in
+     dynamic objects included in the link (often there will be none).
+     For each such file, we want to track down the corresponding
+     library, and include the symbol table in the link.  This is what
+     the runtime dynamic linker will do.  Tracking the files down here
+     permits one dynamic object to include another without requiring
+     special action by the person doing the link.  Note that the
+     needed list can actually grow while we are stepping through this
+     loop.  */
+  needed = bfd_elf_get_needed_list (output_bfd, &link_info);
+  for (l = needed; l != NULL; l = l->next)
+    {
+      struct bfd_link_needed_list *ll;
+      int force;
+
+      /* If we've already seen this file, skip it.  */
+      for (ll = needed; ll != l; ll = ll->next)
+	if (strcmp (ll->name, l->name) == 0)
+	  break;
+      if (ll != l)
+	continue;
+
+      /* See if this file was included in the link explicitly.  */
+      global_needed = l;
+      global_found = false;
+      /*lang_for_each_input_file (gld${EMULATION_NAME}_check_needed);*/
+      if (global_found)
+	continue;
+#if 0
+      /* We need to find this file and include the symbol table.  We
+	 want to search for the file in the same way that the dynamic
+	 linker will search.  That means that we want to use
+	 rpath_link, rpath, then the environment variable
+	 LD_LIBRARY_PATH (native only), then the linker script
+	 LIB_SEARCH_DIRS.  We do not search using the -L arguments.
+
+	 We search twice.  The first time, we skip objects which may
+	 introduce version mismatches.  The second time, we force
+	 their use.  See gld${EMULATION_NAME}_vercheck comment.  */
+      for (force = 0; force < 2; force++)
+	{
+	  const char *lib_path;
+	  size_t len;
+	  search_dirs_type *search;
+
+	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
+						  l->name, force))
+	    break;
+	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
+						  l->name, force))
+	    break;
+	  if (command_line.rpath_link == NULL
+	      && command_line.rpath == NULL)
+	    {
+	      lib_path = (const char *) getenv ("LD_RUN_PATH");
+	      if (gld${EMULATION_NAME}_search_needed (lib_path, l->name,
+						      force))
+		break;
+	    }
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+	  lib_path = (const char *) getenv ("LD_LIBRARY_PATH");
+	  if (gld${EMULATION_NAME}_search_needed (lib_path, l->name, force))
+	    break;
+EOF
+  fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+	  len = strlen (l->name);
+	  for (search = search_head; search != NULL; search = search->next)
+	    {
+	      char *filename;
+
+	      if (search->cmdline)
+		continue;
+	      filename = (char *) xmalloc (strlen (search->name) + len + 2);
+	      sprintf (filename, "%s/%s", search->name, l->name);
+	      if (gld${EMULATION_NAME}_try_needed (filename, force))
+		break;
+	      free (filename);
+	    }
+	  if (search != NULL)
+	    break;
+EOF
+if [ "x${host}" = "x${target}" ] ; then
+  if [ "x${DEFAULT_EMULATION}" = "x${EMULATION_NAME}" ] ; then
+cat >>e${EMULATION_NAME}.c <<EOF
+	  if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
+	    break;
+EOF
+  fi
+fi
+cat >>e${EMULATION_NAME}.c <<EOF
+	}
+#endif
+      if (force < 2)
+	continue;
+
+      einfo ("%P: warning: %s, needed by %B, not found (try using --rpath)\n",
+	     l->name, l->by);
+    }
+}
+
+
+/* This is called after the sections have been attached to output
+   sections, but before any sizes or addresses have been set.  */
+
+static void
+gld${EMULATION_NAME}_before_allocation ()
+{
+  const char *rpath;
+  asection *sinterp;
+
+  /* If we are going to make any variable assignments, we need to let
+     the ELF backend know about them in case the variables are
+     referred to by dynamic objects.  */
+  /*lang_for_each_statement (gld${EMULATION_NAME}_find_statement_assignment);*/
+
+  /* Add the data->data relocation table... */
+  if (morphos_resident)
+    {
+      asection *sec = bfd_make_section(output_bfd, "ddrelocs");
+      struct bfd_link_hash_entry *sym;
+
+      if (sec)
+	{
+	  bfd_set_section_flags(output_bfd, sec, SEC_ALLOC | SEC_LOAD | SEC_READONLY | 
+				SEC_DATA | SEC_HAS_CONTENTS);
+	  sec->output_section = sec;
+	  sec->output_offset = 0;
+	  sym = bfd_link_hash_lookup(link_info.hash, "__datadata_relocs", true, false, false);
+	  if (sym)
+	    {
+	      sym->type = bfd_link_hash_defined;
+	      sym->u.def.value = 0;
+	      sym->u.def.section = sec;
+	    }
+	}
+    }
+
+  /* Let the ELF backend work out the sizes of any sections required
+     by dynamic linking.  */
+  rpath = command_line.rpath;
+  /*if (rpath == NULL)
+    rpath = (const char *) getenv ("LD_RUN_PATH");*/
+  if (! (bfd_elf${ELFSIZE}_size_dynamic_sections
+         (output_bfd, command_line.soname, rpath,
+	  command_line.export_dynamic, command_line.filter_shlib,
+	  (const char * const *) command_line.auxiliary_filters,
+	  &link_info, &sinterp, lang_elf_version_info)))
+    einfo ("%P%F: failed to set dynamic section sizes: %E\n");
+
+  /* Let the user override the dynamic linker we are using.  */
+  if (command_line.interpreter != NULL
+      && sinterp != NULL)
+    {
+      sinterp->contents = (bfd_byte *) command_line.interpreter;
+      sinterp->_raw_size = strlen (command_line.interpreter) + 1;
+    }
+
+  /* Look for any sections named .gnu.warning.  As a GNU extensions,
+     we treat such sections as containing warning messages.  We print
+     out the warning message, and then zero out the section size so
+     that it does not get copied into the output file.  */
+
+  {
+    LANG_FOR_EACH_INPUT_STATEMENT (is)
+      {
+	asection *s;
+	bfd_size_type sz;
+	char *msg;
+	boolean ret;
+
+	if (is->just_syms_flag)
+	  continue;
+
+	s = bfd_get_section_by_name (is->the_bfd, ".gnu.warning");
+	if (s == NULL)
+	  continue;
+
+	sz = bfd_section_size (is->the_bfd, s);
+	msg = xmalloc ((size_t) sz + 1);
+	if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz))
+	  einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
+		 is->the_bfd);
+	msg[sz] = '\0';
+	ret = link_info.callbacks->warning (&link_info, msg,
+					    (const char *) NULL,
+					    is->the_bfd, (asection *) NULL,
+					    (bfd_vma) 0);
+	ASSERT (ret);
+	free (msg);
+
+	/* Clobber the section size, so that we don't waste copying the
+	   warning into the output file.  */
+	s->_raw_size = 0;
+      }
+  }
+}
+
+/* Place an orphan section.  We use this to put random SHF_ALLOC
+   sections in the right segment.  */
+
+static asection *hold_section;
+static lang_output_section_statement_type *hold_use;
+static lang_output_section_statement_type *hold_text;
+static lang_output_section_statement_type *hold_rodata;
+static lang_output_section_statement_type *hold_data;
+static lang_output_section_statement_type *hold_bss;
+static lang_output_section_statement_type *hold_rel;
+static lang_output_section_statement_type *hold_interp;
+
+/*ARGSUSED*/
+static boolean
+gld${EMULATION_NAME}_place_orphan (file, s)
+     lang_input_statement_type *file;
+     asection *s;
+{
+  lang_output_section_statement_type *place;
+  asection *snew, **pps;
+  lang_statement_list_type *old;
+  lang_statement_list_type add;
+  etree_type *address;
+  const char *secname, *ps;
+  const char *outsecname;
+  lang_output_section_statement_type *os;
+
+  if ((s->flags & SEC_ALLOC) == 0)
+    return false;
+
+  /* Look through the script to see where to place this section.  */
+  hold_section = s;
+  hold_use = NULL;
+  lang_for_each_statement (gld${EMULATION_NAME}_place_section);
+
+  if (hold_use != NULL)
+    {
+      /* We have already placed a section with this name.  */
+      wild_doit (&hold_use->children, s, hold_use, file);
+      return true;
+    }
+
+  secname = bfd_get_section_name (s->owner, s);
+
+  /* If this is a final link, then always put .gnu.warning.SYMBOL
+     sections into the .text section to get them out of the way.  */
+  if (! link_info.shared
+      && ! link_info.relocateable
+      && strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
+      && hold_text != NULL)
+    {
+      wild_doit (&hold_text->children, s, hold_text, file);
+      return true;
+    }
+
+  /* Decide which segment the section should go in based on the
+     section name and section flags.  We put loadable .note sections
+     right after the .interp section, so that the PT_NOTE segment is
+     stored right after the program headers where the OS can read it
+     in the first page.  */
+  place = NULL;
+  if ((s->flags & SEC_LOAD) != 0
+      && strncmp (secname, ".note", 4) == 0
+      && hold_interp != NULL)
+    place = hold_interp;
+  else if ((s->flags & SEC_HAS_CONTENTS) == 0
+	   && hold_bss != NULL)
+    place = hold_bss;
+  else if ((s->flags & SEC_READONLY) == 0
+	   && hold_data != NULL)
+    place = hold_data;
+  else if (strncmp (secname, ".rel", 4) == 0
+	   && hold_rel != NULL)
+    place = hold_rel;
+  else if ((s->flags & SEC_CODE) == 0
+	   && (s->flags & SEC_READONLY) != 0
+	   && hold_rodata != NULL)
+    place = hold_rodata;
+  else if ((s->flags & SEC_READONLY) != 0
+	   && hold_text != NULL)
+    place = hold_text;
+  if (place == NULL)
+    return false;
+
+  /* Choose a unique name for the section.  This will be needed if the
+     same section name appears in the input file with different
+     loadable or allocateable characteristics.  */
+  outsecname = secname;
+  if (bfd_get_section_by_name (output_bfd, outsecname) != NULL)
+    {
+      unsigned int len;
+      char *newname;
+      unsigned int i;
+
+      len = strlen (outsecname);
+      newname = xmalloc (len + 5);
+      strcpy (newname, outsecname);
+      i = 0;
+      do
+	{
+	  sprintf (newname + len, "%d", i);
+	  ++i;
+	}
+      while (bfd_get_section_by_name (output_bfd, newname) != NULL);
+
+      outsecname = newname;
+    }
+
+  /* Create the section in the output file, and put it in the right
+     place.  This shuffling is to make the output file look neater.  */
+  snew = bfd_make_section (output_bfd, outsecname);
+  if (snew == NULL)
+      einfo ("%P%F: output format %s cannot represent section called %s\n",
+	     output_bfd->xvec->name, outsecname);
+  if (place->bfd_section != NULL)
+    {
+      for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next)
+	;
+      *pps = snew->next;
+      snew->next = place->bfd_section->next;
+      place->bfd_section->next = snew;
+    }
+
+  /* Start building a list of statements for this section.  */
+  old = stat_ptr;
+  stat_ptr = &add;
+  lang_list_init (stat_ptr);
+
+  /* If the name of the section is representable in C, then create
+     symbols to mark the start and the end of the section.  */
+  for (ps = outsecname; *ps != '\0'; ps++)
+    if (! isalnum ((unsigned char) *ps) && *ps != '_')
+      break;
+  if (*ps == '\0' && config.build_constructors)
+    {
+      char *symname;
+
+      symname = (char *) xmalloc (ps - outsecname + sizeof "__start_");
+      sprintf (symname, "__start_%s", outsecname);
+      lang_add_assignment (exp_assop ('=', symname,
+				      exp_unop (ALIGN_K,
+						exp_intop ((bfd_vma) 1
+							   << s->alignment_power))));
+    }
+
+  if (! link_info.relocateable)
+    address = NULL;
+  else
+    address = exp_intop ((bfd_vma) 0);
+
+  lang_enter_output_section_statement (outsecname, address, 0,
+				       (bfd_vma) 0,
+				       (etree_type *) NULL,
+				       (etree_type *) NULL,
+				       (etree_type *) NULL);
+
+  os = lang_output_section_statement_lookup (outsecname);
+  wild_doit (&os->children, s, os, file);
+
+  lang_leave_output_section_statement
+    ((bfd_vma) 0, "*default*", (struct lang_output_section_phdr_list *) NULL);
+  stat_ptr = &add;
+
+  if (*ps == '\0' && config.build_constructors)
+    {
+      char *symname;
+
+      symname = (char *) xmalloc (ps - outsecname + sizeof "__stop_");
+      sprintf (symname, "__stop_%s", outsecname);
+      lang_add_assignment (exp_assop ('=', symname,
+				      exp_nameop (NAME, ".")));
+    }
+
+  /* Now stick the new statement list right after PLACE.  */
+  *add.tail = place->header.next;
+  place->header.next = add.head;
+
+  stat_ptr = old;
+
+  return true;
+}
+
+static void
+gld${EMULATION_NAME}_place_section (s)
+     lang_statement_union_type *s;
+{
+  lang_output_section_statement_type *os;
+
+  if (s->header.type != lang_output_section_statement_enum)
+    return;
+
+  os = &s->output_section_statement;
+
+  if (strcmp (os->name, hold_section->name) == 0
+      && os->bfd_section != NULL
+      && ((hold_section->flags & (SEC_LOAD | SEC_ALLOC))
+	  == (os->bfd_section->flags & (SEC_LOAD | SEC_ALLOC))))
+    hold_use = os;
+
+  if (strcmp (os->name, ".text") == 0)
+    hold_text = os;
+  else if (strcmp (os->name, ".rodata") == 0)
+    hold_rodata = os;
+  else if (strcmp (os->name, ".data") == 0)
+    hold_data = os;
+  else if (strcmp (os->name, ".bss") == 0)
+    hold_bss = os;
+  else if (hold_rel == NULL
+	   && os->bfd_section != NULL
+	   && (os->bfd_section->flags & SEC_ALLOC) != 0
+	   && strncmp (os->name, ".rel", 4) == 0)
+    hold_rel = os;
+  else if (strcmp (os->name, ".interp") == 0)
+    hold_interp = os;
+}
+
+static char *
+gld${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc='s/["\\]/\\&/g
+s/$/\\n\\/
+1s/^/"/
+$s/$/n"/
+'
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
+  else if (link_info.relocateable == true)
+    return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
+  else
+    return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
+}
+EOF
+
+else
+# Scripts read from the filesystem.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+{			     
+  *isfile = 1;
+
+  if (link_info.relocateable == true && config.build_constructors == true)
+    return "ldscripts/${EMULATION_NAME}.xu";
+  else if (link_info.relocateable == true)
+    return "ldscripts/${EMULATION_NAME}.xr";
+  else
+    return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat >>e${EMULATION_NAME}.c <<EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld${EMULATION_NAME}_before_parse,
+  syslib_default,
+  hll_default,
+  after_parse_default,
+  gld${EMULATION_NAME}_after_open,
+  after_allocation_default,
+  set_output_arch_default,
+  ldemul_default_target,
+  gld${EMULATION_NAME}_before_allocation,
+  gld${EMULATION_NAME}_get_script,
+  "${EMULATION_NAME}",
+  "${OUTPUT_FORMAT}",
+  NULL,
+  NULL,
+  NULL,
+  gld${EMULATION_NAME}_place_orphan,
+  gld${EMULATION_NAME}_set_symbols,
+  gld${EMULATION_NAME}_parse_args,
+  NULL
+};
+EOF
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index fcabcbd..468e9f8 100644
--- binutils-2.9.1.orig/ld/emultempl/pe.em
+++ binutils-2.9.1/ld/emultempl/pe.em
@@ -187,7 +187,9 @@ set_pe_subsystem ()
     {
       { "native", 1, "_NtProcessStartup" },
       { "windows", 2, "_WinMainCRTStartup" },
+      { "wwindows", 2, "_wWinMainCRTStartup" },
       { "console", 3, "_mainCRTStartup" },
+      { "wconsole", 3, "_wmainCRTStartup" },
 #if 0
       /* The Microsoft linker does not recognize this.  */
       { "os2", 5, "" },
@@ -222,7 +224,8 @@ set_pe_subsystem ()
 
 	  /* If the subsystem is windows, we use a different entry
 	     point.  We also register the entry point as an undefined
-	     symbol.  The reason we do this is so that the user
+	     symbol. from lang_add_entry() The reason we do
+	     this is so that the user
 	     doesn't have to because they would have to use the -u
 	     switch if they were specifying an entry point other than
 	     _mainCRTStartup.  Specifically, if creating a windows
@@ -237,7 +240,6 @@ set_pe_subsystem ()
 	     can avoid making the user do this by always adding the
 	     entry point name as an undefined symbol.  */
 	  lang_add_entry (v[i].entry, 1);
-	  ldlang_add_undef (v[i].entry);
 
 	  return;
 	}
@@ -444,15 +446,54 @@ sort_by_file_name (a, b)
 {
   lang_statement_union_type **ra = a;
   lang_statement_union_type **rb = b;
-  int i;
+  int i, a_sec, b_sec;
 
   i = strcmp ((*ra)->input_section.ifile->the_bfd->my_archive->filename,
 	      (*rb)->input_section.ifile->the_bfd->my_archive->filename);
   if (i != 0)
     return i;
 
-  return strcmp ((*ra)->input_section.ifile->filename,
+  i = strcmp ((*ra)->input_section.ifile->filename,
 		 (*rb)->input_section.ifile->filename);
+  if (i != 0)
+    return i;
+  /* the tail idata4/5 are the only ones without relocs to an
+     idata$6 section unless we are importing by ordinal, 
+     so sort them to last to terminate the IAT
+     and HNT properly. if no reloc this one is import by ordinal
+     so we have to sort by section contents */
+
+  if ( ((*ra)->input_section.section->reloc_count + (*rb)->input_section.section->reloc_count) )
+    {
+       i =  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? -1 : 0);
+       if ( i != 0)
+         return i;
+
+        return  (((*ra)->input_section.section->reloc_count > 
+		 (*rb)->input_section.section->reloc_count) ? 0 : 1);
+    }
+  else
+    {
+       if ( (strcmp( (*ra)->input_section.section->name, ".idata$6") == 0) )
+          return 0; /* don't sort .idata$6 or .idata$7 FIXME dlltool eliminate .idata$7 */
+
+       if (! bfd_get_section_contents ((*ra)->input_section.ifile->the_bfd, 
+         (*ra)->input_section.section, &a_sec, (file_ptr) 0, (bfd_size_type)sizeof(a_sec)))
+            einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                 (*ra)->input_section.ifile->the_bfd);
+
+       if (! bfd_get_section_contents ((*rb)->input_section.ifile->the_bfd, 
+        (*rb)->input_section.section, &b_sec, (file_ptr) 0, (bfd_size_type)sizeof(b_sec) ))
+           einfo ("%F%B: Can't read contents of section .idata: %E\n",
+                (*rb)->input_section.ifile->the_bfd);
+
+      i =  ((a_sec < b_sec) ? -1 : 0);
+      if ( i != 0)
+        return i;
+      return  ((a_sec < b_sec) ? 0 : 1);
+   }
+return 0;
 }
 
 static int
@@ -462,8 +503,20 @@ sort_by_section_name (a, b)
 {
   lang_statement_union_type **ra = a;
   lang_statement_union_type **rb = b;
-  return strcmp ((*ra)->input_section.section->name,
+  int i;
+  i = strcmp ((*ra)->input_section.section->name,
 		 (*rb)->input_section.section->name);
+/* this is a hack to make .stab and .stabstr last, so we don't have
+   to fix strip/objcopy for .reloc sections.
+   FIXME stripping images with a .rsrc section still needs to be fixed */
+  if ( i != 0)
+    {
+      if ((strncmp ((*ra)->input_section.section->name, ".stab", 5) == 0)
+           && (strncmp ((*rb)->input_section.section->name, ".stab", 5) != 0))
+         return 1;
+      return i;
+    }
+  return i;
 }
 
 /* Subroutine of sort_sections to a contiguous subset of a list of sections.
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index eea5401..3abb532 100755
--- binutils-2.9.1.orig/ld/genscripts.sh
+++ binutils-2.9.1/ld/genscripts.sh
@@ -16,7 +16,9 @@ target=$4
 target_alias=$5
 DEFAULT_EMULATION=$6
 NATIVE_LIB_DIRS=$7
-EMULATION_NAME=$8
+LIB_PATH=$8
+EMULATION_NAME=$9
+shift
 tool_lib=`echo ${libdir} | sed -e 's|/lib$||'`/${9-$target_alias}/lib
 
 # Include the emulation-specific parameters:
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 05f3984..b10a30c 100644
--- binutils-2.9.1.orig/ld/ld.texinfo
+++ binutils-2.9.1/ld/ld.texinfo
@@ -1834,11 +1834,11 @@ other places they can appear for aesthetic reasons but are otherwise ignored.
 @table @code
 @item Assignment
 Semicolons must appear at the end of assignment expressions.
-@xref{Assignment}
+@xref{Assignment}.
 
 @item PHDRS
 Semicolons must appear at the end of a @code{PHDRS} statement.
-@xref{PHDRS}
+@xref{PHDRS}.
 @end table
 
 @node MEMORY
diff --git a/ld/ldctor.c b/ld/ldctor.c
index 6e40938..d2a6b86 100644
--- binutils-2.9.1.orig/ld/ldctor.c
+++ binutils-2.9.1/ld/ldctor.c
@@ -144,10 +144,13 @@ ldctor_build_sets ()
       /* If the symbol is defined, we may have been invoked from
 	 collect, and the sets may already have been built, so we do
 	 not do anything.  */
-      if (p->h->type == bfd_link_hash_defined
-	  || p->h->type == bfd_link_hash_defweak)
+      /* dgv -- libnix v1.1 uses absolute sets that are also explicitly
+	 defined in the library so that the sets need to be build even
+	 if the symbol is defined */
+      if ((output_bfd->xvec->flavour != bfd_target_amiga_flavour) &&
+	  (p->h->type == bfd_link_hash_defined
+	  || p->h->type == bfd_link_hash_defweak))
 	continue;
-
       /* For each set we build:
 	   set:
 	     .long number_of_elements
@@ -239,10 +242,17 @@ ldctor_build_sets ()
 	      if (e->name != NULL)
 		minfo ("%T\n", e->name);
 	      else
-		minfo ("%G\n", e->section->owner, e->section, e->value);
+		if (e->section->owner)
+		  minfo ("%G\n", e->section->owner, e->section, e->value);
+		else
+		  minfo ("%s\n", "** ABS **");
 	    }
 
-	  if (link_info.relocateable)
+	  /* dgv -- on the amiga, we want the constructors to be relocateable
+	     objects. However, this should be arranged somewhere else (FIXME) */
+	  if (link_info.relocateable ||
+	      (output_bfd->xvec->flavour == bfd_target_amiga_flavour &&
+	       e->section != bfd_abs_section_ptr))
 	    lang_add_reloc (p->reloc, howto, e->section, e->name,
 			    exp_intop (e->value));
 	  else
diff --git a/ld/ldfile.c b/ld/ldfile.c
index 3597c4e..9f52e7f 100644
--- binutils-2.9.1.orig/ld/ldfile.c
+++ binutils-2.9.1/ld/ldfile.c
@@ -39,6 +39,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include <ctype.h>
 
+static int n_flavors, flavors_len;
+char **flavors;
+
 const char *ldfile_input_filename;
 boolean ldfile_assumed_script = false;
 const char *ldfile_output_machine_name = "";
@@ -79,6 +82,32 @@ static boolean ldfile_open_file_search
 	   const char *lib, const char *suffix));
 static FILE *try_open PARAMS ((const char *name, const char *exten));
 
+static int flavors_cmp (f1, f2)
+     const void *f1, *f2;
+{
+  return strcmp (*(char**)f1, *(char**)f2);
+}
+
+void
+sort_flavors ()
+{
+  if (n_flavors > 1)
+    qsort ((void*)flavors, n_flavors, sizeof(char**), flavors_cmp);
+}
+
+void
+ldfile_add_flavor (name)
+     char *name;
+{
+  n_flavors++;
+  if (flavors)
+    flavors = (char**) xrealloc ((PTR)flavors, n_flavors*sizeof (char*));
+  else
+    flavors = (char**) xmalloc (sizeof (char*));
+  flavors [n_flavors-1] = name;
+  flavors_len += strlen (name);
+}
+
 void
 ldfile_add_library_path (name, cmdline)
      const char *name;
@@ -128,6 +157,7 @@ ldfile_open_file_search (arch, entry, lib, suffix)
      const char *suffix;
 {
   search_dirs_type *search;
+  char *flavor_dir = (char *) alloca (flavors_len + n_flavors + 1);
 
   /* If this is not an archive, try to open it in the current
      directory first.  */
@@ -142,6 +172,7 @@ ldfile_open_file_search (arch, entry, lib, suffix)
        search = search->next) 
     {
       char *string;
+      int i, count=n_flavors;
 
       if (entry->dynamic && ! link_info.relocateable)
 	{
@@ -171,15 +202,40 @@ ldfile_open_file_search (arch, entry, lib, suffix)
       else
 	sprintf (string, "%s%s%s", search->name, slash, entry->filename);
 
-      if (ldfile_try_open_bfd (string, entry))
-	{
-	  entry->filename = string;
-	  return true;
+      for (count = n_flavors; count>=0; count--) {
+	*flavor_dir = '\0';
+	for (i=0; i<count; i++) {
+	  strcat (flavor_dir, flavors[i]);
+	  strcat (flavor_dir, slash);
 	}
 
-      free (string);
+	string = (char *) xmalloc (strlen (search->name)
+				   + strlen (slash)
+				   + strlen (flavor_dir)
+				   + strlen (lib)
+				   + strlen (entry->filename)
+				   + strlen (arch)
+				   + strlen (suffix)
+				   + 1);
+	
+	if (entry->is_archive)
+	  sprintf (string, "%s%s%s%s%s%s%s", search->name, slash, flavor_dir,
+		   lib, entry->filename, arch, suffix);
+	else if (entry->filename[0] == '/' || entry->filename[0] == '.')
+	  strcpy (string, entry->filename);
+	else
+	  sprintf (string, "%s%s%s%s", search->name, slash, flavor_dir,
+		   entry->filename);
+	
+	if (ldfile_try_open_bfd (string, entry))
+	  {
+	    entry->filename = string;
+	    return true;
+	  }
+	
+	free (string);
+      }
     }
-
   return false;
 }
 
@@ -206,6 +262,15 @@ ldfile_open_file (entry)
 	   arch != (search_arch_type *) NULL;
 	   arch = arch->next)
 	{
+#if (defined (__BEOS__) && defined (__INTEL__))
+          if (ldfile_open_file_search (arch->name, entry, "lib", ".so.LIB"))
+            return;
+#endif
+#if defined (__CYGWIN32__)
+	  if (strcmp (default_target, "pei-i386") == 0
+	      && (ldfile_open_file_search (arch->name, entry, "", ".lib")))
+            return;
+#endif
 	  if (ldfile_open_file_search (arch->name, entry, "lib", ".a"))
 	    return;
 #ifdef VMS
diff --git a/ld/ldint.texinfo b/ld/ldint.texinfo
index 612fc2a..b6d56d3 100644
--- binutils-2.9.1.orig/ld/ldint.texinfo
+++ binutils-2.9.1/ld/ldint.texinfo
@@ -43,7 +43,7 @@ regarded as a program in the language TeX).
 
 @tex
 \def\$#1${{#1}}  % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.10 $}  % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.1.1.1 $}  % For use in headers, footers too
 {\parskip=0pt
 \hfill Cygnus Support\par
 \hfill \manvers\par
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 6cdab2b..2839f94 100644
--- binutils-2.9.1.orig/ld/ldlang.c
+++ binutils-2.9.1/ld/ldlang.c
@@ -745,12 +745,32 @@ section_already_linked (abfd, sec, data)
 
   if ((flags & SEC_LINK_ONCE) == 0)
     return;
-
+  pei_get_comdat_info(sec);
   name = bfd_get_section_name (abfd, sec);
+  if (sec->pe_comdat_info != NULL)
+    {
+      if (sec->pe_comdat_info && sec->pe_comdat_info->asoc_sec != (int)NULL)
+	{
+	  /* .idata$2 & .idata$3 are not marked SEC_LINK_ONCE in MS .lib's
+	     assuming that any SEC_LINK_ONCE section that dosen't have a
+	     comdat symbol is an associated section and that the 
+	     section with the symbol has already been processed */
+	  for (l = sec_link_once_list; l != NULL; l = l->next)
+	    {
+	      if ((abfd == l->sec->owner) && (sec->pe_comdat_info->asoc_sec == l->sec->index + 1))
+		return;
+	    }
+	  sec->output_section = bfd_abs_section_ptr;
+	  return;
+	}
+    }
 
   for (l = sec_link_once_list; l != NULL; l = l->next)
     {
-      if (strcmp (name, bfd_get_section_name (l->sec->owner, l->sec)) == 0)
+     if ((strcmp (name, bfd_get_section_name (l->sec->owner, l->sec)) == 0)
+	 && sec->pe_comdat_info != NULL
+	 && (strcmp (sec->pe_comdat_info->name_buf, l->sec->pe_comdat_info->name_buf) == 0)
+	 && (strcmp (sec->pe_comdat_info->comdat_sym, l->sec->pe_comdat_info->comdat_sym) == 0))
 	{
 	  /* The section has already been linked.  See if we should
              issue a warning.  */
@@ -790,7 +810,7 @@ section_already_linked (abfd, sec, data)
 	}
     }
 
-  /* This is the first section with this name.  Record it.  */
+  /* This is the first section with this name and symbol.  Record it.  */
 
   l = (struct sec_link_once *) xmalloc (sizeof *l);
   l->sec = sec;
@@ -1442,6 +1462,27 @@ ldlang_add_undef (name)
   new->name = buystring (name);
 }
 
+/* exchange an older undefined entry point for a newer one
+   this will avoid dragging in the extra .o files
+   when the entry point is in a lib file */
+void
+ldlang_switch_undef_entry (name)
+     CONST char *CONST name;
+{
+  ldlang_undef_chain_list_type *new = ldlang_undef_chain_list_head;
+  while (new != (ldlang_undef_chain_list_type *) NULL)
+  {
+  if (strcmp (new->name, entry_symbol) == 0)
+     {
+     free(new->name);
+     new->name = buystring (name);
+     }
+  new = new->next;
+  }
+
+}
+
+
 /* Run through the list of undefineds created above and place them
    into the linker hash table as undefined symbols belonging to the
    script file.
@@ -3389,17 +3430,13 @@ lang_add_entry (name, cmdline)
       || cmdline
       || ! entry_from_cmdline)
     {
+      if (entry_symbol != NULL)
+         ldlang_switch_undef_entry (name);
+      else
+         ldlang_add_undef(name);
       entry_symbol = name;
       entry_from_cmdline = cmdline;
     }
-#if 0 
-  /* don't do this yet.  It seems to work (the executables run), but the 
-     image created is very different from what I was getting before indicating
-     that something else is being pulled in.  When everything else is working,
-     then try to put this back in to see if it will do the right thing for
-     other more complicated applications */
-  ldlang_add_undef (name);
-#endif
 }
 
 void
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 60edc0f..f510809 100644
--- binutils-2.9.1.orig/ld/ldlang.h
+++ binutils-2.9.1/ld/ldlang.h
@@ -256,6 +256,8 @@ typedef struct lang_input_statement_struct
   /*    unsigned int globals_in_this_file;*/
   const char *target;
   boolean real;
+  /* Added for AMIGA support of section attributes */
+  int amiga_attribute;
 } lang_input_statement_type;
 
 typedef struct
diff --git a/ld/ldlex.l b/ld/ldlex.l
index dfdf737..73f0062 100644
--- binutils-2.9.1.orig/ld/ldlex.l
+++ binutils-2.9.1/ld/ldlex.l
@@ -570,7 +570,7 @@ yy_input (buf, result, max_size)
      int max_size;
 {
   *result = 0; 
-  if (yy_current_buffer->yy_input_file)
+  if (YY_CURRENT_BUFFER->yy_input_file)
     {
       if (yyin)
 	{
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 97fed9d..f0429d8 100644
--- binutils-2.9.1.orig/ld/ldmain.c
+++ binutils-2.9.1/ld/ldmain.c
@@ -147,8 +147,10 @@ remove_output ()
 {
   if (output_filename) 
     {
-      if (output_bfd && output_bfd->iostream)
+      if (output_bfd && output_bfd->iostream) {
 	fclose((FILE *)(output_bfd->iostream));
+	output_bfd->iostream = NULL;
+      }
       if (delete_output_file_on_failure)
 	unlink (output_filename);
     }
@@ -328,10 +330,10 @@ main (argc, argv)
 	}
     }
 
-  if (link_info.relocateable)
+  /*if (link_info.relocateable)*/
     output_bfd->flags &= ~EXEC_P;
-  else
-    output_bfd->flags |= EXEC_P;
+    /*else
+      output_bfd->flags |= EXEC_P;*/
 
   ldwrite ();
 
@@ -362,7 +364,7 @@ main (argc, argv)
     {
       if (! bfd_close (output_bfd))
 	einfo ("%F%B: final close failed: %E\n", output_bfd);
-
+      
       /* If the --force-exe-suffix is enabled, and we're making an
 	 executable file and it doesn't end in .exe, copy it to one which does. */
 
diff --git a/ld/scripttempl/amiga.sc b/ld/scripttempl/amiga.sc
new file mode 100755
index 0000000..5759078
--- /dev/null
+++ binutils-2.9.1/ld/scripttempl/amiga.sc
@@ -0,0 +1,48 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${STACKZERO+${RELOCATING+${STACKZERO}}}
+${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
+
+SECTIONS
+{
+  ${RELOCATING+. = ${TEXT_START_ADDR};}
+  .text :
+  {
+    ${RELOCATING+___machtype = ABSOLUTE(0x0);}
+    ${RELOCATING+__stext = .;}
+    *(.text)
+    ${RELOCATING+__etext = .;}
+    ${RELOCATING+___text_size = ABSOLUTE(__etext - __stext);}
+    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
+  }
+  ${RELOCATING+. = ${DATA_ALIGNMENT};}
+  .data :
+  {
+    ${RELOCATING+__sdata = .;}
+    ${CONSTRUCTING+CONSTRUCTORS}
+    *(.data)
+    ${RELOCATING+__edata = .;}
+    ${RELOCATING+___data_size = ABSOLUTE(__edata - __sdata);}
+  }
+  ${RELOCATING+. = ALIGN(0x0);}
+  .bss :
+  {
+    ${RELOCATING+ __bss_start = .};
+    *(.bss)
+    *(COMMON)
+    ${RELOCATING+__end = . };
+    ${RELOCATING+___bss_size = ABSOLUTE(__end - __bss_start);}
+  }
+  .data_chip :
+  {
+    *(.data_chip)
+  }
+  .bss_chip :
+  {
+    *(.bss_chip)
+  }
+}
+EOF
diff --git a/ld/scripttempl/amiga_bss.sc b/ld/scripttempl/amiga_bss.sc
new file mode 100755
index 0000000..95d0588
--- /dev/null
+++ binutils-2.9.1/ld/scripttempl/amiga_bss.sc
@@ -0,0 +1,41 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${STACKZERO+${RELOCATING+${STACKZERO}}}
+${SHLIB_PATH+${RELOCATING+${SHLIB_PATH}}}
+
+SECTIONS
+{
+  ${RELOCATING+. = ${TEXT_START_ADDR};}
+  .text :
+  {
+    ${RELOCATING+___machtype = ABSOLUTE(0x0);}
+    ${RELOCATING+__stext = .;}
+    *(.text)
+    ${RELOCATING+___datadata_relocs = .;}
+    ${RELOCATING+__etext = .;}
+    ${RELOCATING+___text_size = ABSOLUTE(__etext - __stext);}
+    ${PAD_TEXT+${RELOCATING+. = ${DATA_ALIGNMENT};}}
+  }
+  ${RELOCATING+. = ${DATA_ALIGNMENT};}
+  .data :
+  {
+    ${RELOCATING+__sdata = .;}
+    ${CONSTRUCTING+CONSTRUCTORS}
+    *(.data)
+    ${RELOCATING+___a4_init = 0x7ffe;}
+    ${RELOCATING+___data_size = ABSOLUTE(__edata - __sdata);}
+    ${RELOCATING+___bss_size = ABSOLUTE(0);}
+  }
+  .bss :
+  {
+    *(.bss)
+    *(COMMON)
+    ${RELOCATING+__edata  =  .;}
+    ${RELOCATING+__bss_start  =  .;}
+    ${RELOCATING+__end = ALIGN(4) };
+  }
+}
+EOF
diff --git a/ld/scripttempl/i386beos.sc b/ld/scripttempl/i386beos.sc
new file mode 100644
index 0000000..4e43806
--- /dev/null
+++ binutils-2.9.1/ld/scripttempl/i386beos.sc
@@ -0,0 +1,165 @@
+# Linker script for PE.
+
+if test -z "${RELOCATEABLE_OUTPUT_FORMAT}"; then
+  RELOCATEABLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+fi
+
+# We can't easily and portably get an unquoted $ in a shell
+# substitution, so we do this instead.
+if test "${RELOCATING}"; then
+  R_TEXT='*(.text$*)'
+  R_DATA='*(.data$*)'
+  R_RDATA='*(.rdata$*)'
+  R_IDATA='
+    *(.idata$2)
+    *(.idata$3)
+    /* These zeroes mark the end of the import list.  */
+    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
+    *(.idata$4)
+    *(.idata$5)
+    *(.idata$6)
+    *(.idata$7)'
+  R_CRT='*(.CRT$*)'
+  R_RSRC='*(.rsrc$*)'
+  R_EXC='*(.exc$*)'
+else
+  R_TEXT=
+  R_DATA=
+  R_RDATA=
+  R_IDATA=
+  R_CRT=
+  R_RSRC=
+  R_EXC=
+fi
+
+cat <<EOF
+${RELOCATING+OUTPUT_FORMAT(${OUTPUT_FORMAT})}
+${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
+
+${LIB_SEARCH_DIRS}
+
+ENTRY(__start)
+${RELOCATING+header = .;}
+${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */}
+${RELOCATING+__ldused = .;}
+SECTIONS
+{
+  .text ${RELOCATING+ __image_base__ + __section_alignment__ } : 
+  {
+    ${RELOCATING+ __text_start__ = . ;}
+    ${RELOCATING+ *(.init)}
+    *(.text)
+    ${R_TEXT}
+    *(.glue_7t)
+    *(.glue_7)
+    ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; 
+			LONG (-1); *(.ctors); *(.ctor); LONG (0); }
+    ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; 
+			LONG (-1); *(.dtors); *(.dtor);  LONG (0); }
+    ${RELOCATING+ *(.fini)}
+    /* ??? Why is .gcc_exc here?  */
+    ${RELOCATING+ *(.gcc_exc)}
+    ${RELOCATING+ etext = .;}
+    ${RELOCATING+ __text_end__ = .;}
+    *(.gcc_except_table)
+  }
+
+  /* The Cygwin32 library uses a section to avoid copying certain data
+     on fork.  This used to be named ".data$nocopy".  The linker used
+     to include this between __data_start__ and __data_end__, but that
+     breaks building the cygwin32 dll.  Instead, we name the section
+     ".data_cygwin_nocopy" and explictly include it after __data_end__. */
+
+  .data ${RELOCATING+BLOCK(__section_alignment__)} : 
+  {
+    ${RELOCATING+__data_start__ = . ;}
+    *(.data)
+    *(.data2)
+    ${R_DATA}
+    ${RELOCATING+__data_end__ = . ;}
+    ${RELOCATING+*(.data_cygwin_nocopy)}
+  }
+
+  .bss ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    ${RELOCATING+__bss_start__ = . ;}
+    *(.bss)
+    *(COMMON)
+    /* link.exe apparently pulls in .obj's because of UNDEF common
+	symbols, which is not the coff way, but that's MS for you. */
+    *(.CRT\$XCA)
+    *(.CRT\$XCZ)
+    *(.CRT\$XIA)
+    *(.CRT\$XIZ)
+    ${RELOCATING+__bss_end__ = . ;}
+  }
+
+  .rdata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    *(.rdata)
+    ${R_RDATA}
+    *(.eh_frame)
+  }
+
+  .edata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    *(.edata)
+  }
+
+  /DISCARD/ :
+  {
+    *(.debug\$S)
+    *(.debug\$T)
+    *(.debug\$F)
+    *(.drectve)
+  }
+
+  .idata ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    /* This cannot currently be handled with grouped sections.
+	See pe.em:sort_sections.  */
+    ${R_IDATA}
+  }
+  .CRT ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    ${R_CRT}
+  }
+
+  .endjunk ${RELOCATING+BLOCK(__section_alignment__)} :
+  {
+    /* end is deprecated, don't use it */
+    ${RELOCATING+ end = .;}
+    ${RELOCATING+ __end__ = .;}
+  }
+
+  .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.reloc)
+    ${RELOCATING+ /* These zeroes mark the end of the reloc section.  */}
+    ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
+  }
+
+  .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.rsrc)
+    ${R_RSRC}
+  }
+
+  .exc ${RELOCATING+BLOCK(__section_alignment__)} :
+  { 					
+    *(.exc)
+    ${R_EXC}
+  }
+
+  .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    [ .stab ]
+  }
+
+  .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
+  {
+    [ .stabstr ]
+  }
+${RELOCATING+end = .; /* MS startup code needs this */}
+}
+EOF
diff --git a/ld/scripttempl/morphos.sc b/ld/scripttempl/morphos.sc
new file mode 100755
index 0000000..b8f03fc
--- /dev/null
+++ binutils-2.9.1/ld/scripttempl/morphos.sc
@@ -0,0 +1,243 @@
+#
+# Unusual variables checked by this code:
+#	NOP - two byte opcode for no-op (defaults to 0)
+#	DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+#	OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
+#		(e.g., .PARISC.milli)
+#	OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
+#		(e.g., .PARISC.global)
+#	OTHER_SECTIONS - at the end
+#	EXECUTABLE_SYMBOLS - symbols that must be defined for an
+#		executable (e.g., _DYNAMIC_LINK)
+#	TEXT_START_SYMBOLS - symbols that appear at the start of the
+#		.text section.
+#	DATA_START_SYMBOLS - symbols that appear at the start of the
+#		.data section.
+#	OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+#		.bss section besides __bss_start.
+#
+# When adding sections, do note that the names of some sections are used
+# when specifying the start address of the next.
+#
+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test "$LD_FLAG" = "N" && DATA_ADDR=.
+SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) *(.sbss2.*) }"
+SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) *(.sdata2.*) }"
+INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
+PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+	      "${LITTLE_OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+/* Do we need any of these for elf?
+   __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */}
+${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
+  if gld -r is used and the intermediate file has sections starting
+  at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
+  bug.  But for now assigning the zero vmas works.  */}
+
+${RELOCATING+PROVIDE (__stack = 0);}
+PROVIDE (__machtype = 0x1);
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
+  ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
+  ${CREATE_SHLIB-${INTERP}}
+  .hash		${RELOCATING-0} : { *(.hash)		}
+  .dynsym	${RELOCATING-0} : { *(.dynsym)		}
+  .dynstr	${RELOCATING-0} : { *(.dynstr)		}
+  .gnu.version ${RELOCATING-0} : { *(.gnu.version)      }
+  .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d)  }
+  .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r)  }
+  .rela.text   ${RELOCATING-0} :
+    { *(.rela.text) *(.rela.text.*) *(.rela.gnu.linkonce.t*) }
+  .rela.data   ${RELOCATING-0} :
+    { *(.rela.data) *(.rela.data.*) *(.rela.gnu.linkonce.d*) }
+  .rela.rodata ${RELOCATING-0} :
+    { *(.rela.rodata) *(.rela.rodata.*) *(.rela.gnu.linkonce.r*) }
+  .rela.got	${RELOCATING-0} : { *(.rela.got)	}
+  .rela.got1	${RELOCATING-0} : { *(.rela.got1)	}
+  .rela.got2	${RELOCATING-0} : { *(.rela.got2)	}
+  .rela.ctors	${RELOCATING-0} : { *(.rela.ctors)	}
+  .rela.dtors	${RELOCATING-0} : { *(.rela.dtors)	}
+  .rela.init	${RELOCATING-0} : { *(.rela.init)	}
+  .rela.fini	${RELOCATING-0} : { *(.rela.fini)	}
+  .rela.bss	${RELOCATING-0} :
+    { *(.rela.bss) *(.rela.bss.*) *(.rela.gnu.linkonce.b.*) }
+  .rela.plt	${RELOCATING-0} : { *(.rela.plt)	}
+  .rela.sdata	${RELOCATING-0} :
+    { *(.rela.sdata) *(.rela.sdata.*) *(.rela.gnu.linkonce.s.*) }
+  .rela.sbss	${RELOCATING-0} :
+    { *(.rela.sbss) *(.rela.sbss.*) *(.rela.gnu.linkonce.sb.*) }
+  .rela.sdata2	${RELOCATING-0} : { *(.rela.sdata2)	*(.rela.sdata2.*) }
+  .rela.sbss2	${RELOCATING-0} : { *(.rela.sbss2) *(.rela.sbss2.*)	}
+  .text    ${RELOCATING-0} :
+  {
+    PROVIDE (__text_start = .);
+    ${RELOCATING+${TEXT_START_SYMBOLS}}
+    *(.text)
+    *(.text.*)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+    *(.gnu.linkonce.t*)
+    PROVIDE (__text_end = .);
+  } =${NOP-0}
+  PROVIDE (__text_size = SIZEOF(.text));
+  .init		${RELOCATING-0} : { *(.init)		} =${NOP-0}
+  .fini		${RELOCATING-0} : { *(.fini)		} =${NOP-0}
+  .rodata	${RELOCATING-0} : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
+  .rodata1	${RELOCATING-0} : { *(.rodata1) *(.rodata1.*) }
+  ${RELOCATING+_etext = .;}
+  ${RELOCATING+PROVIDE (etext = .);}
+  ${CREATE_SHLIB-${SDATA2}}
+  ${CREATE_SHLIB-${SBSS2}}
+  ${RELOCATING+${OTHER_READONLY_SECTIONS}}
+
+  /* Adjust the address for the data segment.  We want to adjust up to
+     the same address within the page on the next page up.  It would
+     be more correct to do this:
+       ${RELOCATING+. = ${DATA_ADDR-ALIGN(${MAXPAGESIZE}) + (ALIGN(8) & (${MAXPAGESIZE} - 1))};}
+     The current expression does not correctly handle the case of a
+     text segment ending precisely at the end of a page; it causes the
+     data segment to skip a page.  The above expression does not have
+     this problem, but it will currently (2/95) cause BFD to allocate
+     a single segment, combining both text and data, for this case.
+     This will prevent the text segment from being shared among
+     multiple executions of the program; I think that is more
+     important than losing a page of the virtual address space (note
+     that no actual memory is lost; the page which is skipped can not
+     be referenced).  */
+  ${RELOCATING+. = ${DATA_ADDR- ALIGN(8) + ${MAXPAGESIZE}};}
+
+  .data  ${RELOCATING-0} :
+  {
+    PROVIDE (__data_start = .);
+    ${RELOCATING+${DATA_START_SYMBOLS}}
+    *(.data)
+    *(.data.*)
+    *(.gnu.linkonce.d*)
+    ${CONSTRUCTING+CONSTRUCTORS}
+    PROVIDE (__data_end = .);
+  }
+  PROVIDE (__data_size = SIZEOF(.data));
+  .data1 ${RELOCATING-0} : { *(.data1) *(.data1.*) }
+  ${RELOCATING+${OTHER_READWRITE_SECTIONS}}
+
+  .got1		${RELOCATING-0} : { *(.got1) }
+  .dynamic	${RELOCATING-0} : { *(.dynamic) }
+
+  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+     get relocated with -mrelocatable. Also put in the .fixup pointers.
+     The current compiler no longer needs this, but keep it around for 2.7.2  */
+
+		${RELOCATING+PROVIDE (_GOT2_START_ = .);}
+  .got2		${RELOCATING-0} :  { *(.got2) }
+
+		${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
+  .ctors	${RELOCATING-0} : { *(.ctors) }
+		${RELOCATING+PROVIDE (__CTOR_END__ = .);}
+
+		${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
+  .dtors	${RELOCATING-0} : { *(.dtors) }
+		${RELOCATING+PROVIDE (__DTOR_END__ = .);}
+
+		${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
+  .fixup	${RELOCATING-0} : { *(.fixup) }
+		${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
+		${RELOCATING+PROVIDE (_GOT2_END_ = .);}
+
+		${RELOCATING+PROVIDE (_GOT_START_ = .);}
+  .got		${RELOCATING-0} : { *(.got) }
+  .got.plt	${RELOCATING-0} : { *(.got.plt) }
+  ${CREATE_SHLIB+${SDATA2}}
+  ${CREATE_SHLIB+${SBSS2}}
+		${RELOCATING+PROVIDE (_GOT_END_ = .);}
+
+  /* We want the small data sections together, so single-instruction offsets
+     can access them all, and initialized data all before uninitialized, so
+     we can shorten the on-disk segment size.  */
+  .sdata	${RELOCATING-0} :
+  {
+    PROVIDE (__sdata_start = .);
+    *(.sdata)
+    *(.sdata.*)
+    *(.gnu.linkonce.s.*)
+    PROVIDE (__r13_init = 0x8000);
+    PROVIDE (__sdata_end = .);
+  }
+  PROVIDE (__sdata_size = SIZEOF(.sdata));
+  ${RELOCATING+_edata  =  .;}
+  ${RELOCATING+PROVIDE (edata = .);}
+  .sbss    ${RELOCATING-0} :
+  {
+    PROVIDE (__sbss_start = .);
+    *(.sbss)
+    *(.sbss.*)
+    *(.gnu.linkonce.sb.*)
+    *(.scommon)
+    *(.dynsbss)
+    PROVIDE (__sbss_end = .);
+  }
+  PROVIDE (__sbss_size = SIZEOF(.sbss));
+  ${PLT}
+  .bss     ${RELOCATING-0} :
+  {
+    PROVIDE (__bss_start = .);
+    ${RELOCATING+${OTHER_BSS_SYMBOLS}}
+    ${RELOCATING+PROVIDE (__bss_start = .);}
+    *(.dynbss)
+    *(.bss)
+    *(.bss.*)
+    *(.gnu.linkonce.b.*)
+    *(COMMON)
+    PROVIDE (__bss_end = .);
+  }
+  PROVIDE (__bss_size = SIZEOF(.bss));
+  ${RELOCATING+_end = . ;}
+  ${RELOCATING+PROVIDE (end = .);}
+
+  /* These are needed for ELF backends which have not yet been
+     converted to the new style linker.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+
+  /* These must appear regardless of ${RELOCATING}.  */
+  ${OTHER_SECTIONS}
+}
+EOF
diff --git a/ld/scripttempl/morphos_baserel.sc b/ld/scripttempl/morphos_baserel.sc
new file mode 100755
index 0000000..84d627e
--- /dev/null
+++ binutils-2.9.1/ld/scripttempl/morphos_baserel.sc
@@ -0,0 +1,227 @@
+#
+# Unusual variables checked by this code:
+#	NOP - two byte opcode for no-op (defaults to 0)
+#	DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
+#	OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
+#		(e.g., .PARISC.milli)
+#	OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
+#		(e.g., .PARISC.global)
+#	OTHER_SECTIONS - at the end
+#	EXECUTABLE_SYMBOLS - symbols that must be defined for an
+#		executable (e.g., _DYNAMIC_LINK)
+#	TEXT_START_SYMBOLS - symbols that appear at the start of the
+#		.text section.
+#	DATA_START_SYMBOLS - symbols that appear at the start of the
+#		.data section.
+#	OTHER_BSS_SYMBOLS - symbols that appear at the start of the
+#		.bss section besides __bss_start.
+#
+# When adding sections, do note that the names of some sections are used
+# when specifying the start address of the next.
+#
+test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
+test "$LD_FLAG" = "N" && DATA_ADDR=.
+SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2) *(.sbss2.*) }"
+SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2) *(.sdata2.*) }"
+INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
+PLT=".plt ${RELOCATING-0} : { *(.plt) }"
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
+	      "${LITTLE_OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+/* Do we need any of these for elf?
+   __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}}  */}
+${RELOCATING+${EXECUTABLE_SYMBOLS}}
+${RELOCATING- /* For some reason, the Solaris linker makes bad executables
+  if gld -r is used and the intermediate file has sections starting
+  at non-zero addresses.  Could be a Solaris ld bug, could be a GNU ld
+  bug.  But for now assigning the zero vmas works.  */}
+
+${RELOCATING+PROVIDE (__stack = 0);}
+PROVIDE (__machtype = 0x1);
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  ${CREATE_SHLIB-${RELOCATING+. = ${TEXT_START_ADDR} + SIZEOF_HEADERS;}}
+  ${CREATE_SHLIB+${RELOCATING+. = SIZEOF_HEADERS;}}
+  ${CREATE_SHLIB-${INTERP}}
+  .hash		${RELOCATING-0} : { *(.hash)		}
+  .dynsym	${RELOCATING-0} : { *(.dynsym)		}
+  .dynstr	${RELOCATING-0} : { *(.dynstr)		}
+  .gnu.version ${RELOCATING-0} : { *(.gnu.version)      }
+  .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d)  }
+  .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r)  }
+  .rela.text   ${RELOCATING-0} :
+    { *(.rela.text) *(.rela.text.*) *(.rela.gnu.linkonce.t*) }
+  .rela.got	${RELOCATING-0} : { *(.rela.got)	}
+  .rela.got1	${RELOCATING-0} : { *(.rela.got1)	}
+  .rela.got2	${RELOCATING-0} : { *(.rela.got2)	}
+  .rela.ctors	${RELOCATING-0} : { *(.rela.ctors)	}
+  .rela.dtors	${RELOCATING-0} : { *(.rela.dtors)	}
+  .rela.init	${RELOCATING-0} : { *(.rela.init)	}
+  .rela.fini	${RELOCATING-0} : { *(.rela.fini)	}
+  .rela.plt	${RELOCATING-0} : { *(.rela.plt)	}
+  .rela.rodata  ${RELOCATING-0} :
+    { *(.rela.rodata) *(.rela.rodata.*) *(.rela.gnu.linkonce.r*) }
+  .rela.sdata	${RELOCATING-0} :
+  {
+    *(.rela.data)
+    *(.rela.data.*)
+    *(.rela.data1)
+    *(.rela.data1.*)
+    *(.rela.data.rel)
+    *(.rela.data.rel.local)
+    *(.rela.gnu.linkonce.d*)
+    *(.rela.gnu.linkonce.s.*)
+    *(.rela.sdata)
+    *(.rela.sdata.*)
+  }
+  .rela.sbss	${RELOCATING-0} :
+  {
+    *(.rela.sbss)
+    *(.rela.sbss.*)
+    *(.rela.bss)
+    *(.rela.bss.*)
+    *(.rela.gnu.linkonce.sb.*)
+    *(.rela.gnu.linkonce.b.*)
+  }
+  .rela.sdata2	${RELOCATING-0} : { *(.rela.sdata2)	*(.rela.sdata2.*) }
+  .rela.sbss2	${RELOCATING-0} : { *(.rela.sbss2) *(.rela.sbss2.*) }
+  .text    ${RELOCATING-0} :
+  {
+    PROVIDE (__text_start = .);
+    ${RELOCATING+${TEXT_START_SYMBOLS}}
+    *(.text)
+    *(.text.*)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+    *(.gnu.linkonce.t*)
+    PROVIDE (__text_end = .);
+  } =${NOP-0}
+  PROVIDE (__text_size = SIZEOF(.text));
+  .init		${RELOCATING-0} : { *(.init)		} =${NOP-0}
+  .fini		${RELOCATING-0} : { *(.fini)		} =${NOP-0}
+  ${RELOCATING+_etext = .;}
+  ${RELOCATING+PROVIDE (etext = .);}
+  ${CREATE_SHLIB-${SDATA2}}
+  ${CREATE_SHLIB-${SBSS2}}
+  ${RELOCATING+${OTHER_READONLY_SECTIONS}}
+
+  .got1		${RELOCATING-0} : { *(.got1) }
+  .dynamic	${RELOCATING-0} : { *(.dynamic) }
+
+  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+     get relocated with -mrelocatable. Also put in the .fixup pointers.
+     The current compiler no longer needs this, but keep it around for 2.7.2  */
+
+		${RELOCATING+PROVIDE (_GOT2_START_ = .);}
+  .got2		${RELOCATING-0} :  { *(.got2) }
+
+		${RELOCATING+PROVIDE (__CTOR_LIST__ = .);}
+  .ctors	${RELOCATING-0} : { *(.ctors) }
+		${RELOCATING+PROVIDE (__CTOR_END__ = .);}
+
+		${RELOCATING+PROVIDE (__DTOR_LIST__ = .);}
+  .dtors	${RELOCATING-0} : { *(.dtors) }
+		${RELOCATING+PROVIDE (__DTOR_END__ = .);}
+
+		${RELOCATING+PROVIDE (_FIXUP_START_ = .);}
+  .fixup	${RELOCATING-0} : { *(.fixup) }
+		${RELOCATING+PROVIDE (_FIXUP_END_ = .);}
+		${RELOCATING+PROVIDE (_GOT2_END_ = .);}
+
+		${RELOCATING+PROVIDE (_GOT_START_ = .);}
+  .got		${RELOCATING-0} : { *(.got) }
+  .got.plt	${RELOCATING-0} : { *(.got.plt) }
+  ${CREATE_SHLIB+${SDATA2}}
+  ${CREATE_SHLIB+${SBSS2}}
+		${RELOCATING+PROVIDE (_GOT_END_ = .);}
+  .rodata	${RELOCATING-0} : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
+ /* We want the small data sections together, so single-instruction offsets
+     can access them all, and initialized data all before uninitialized, so
+     we can shorten the on-disk segment size.  */
+  .sdata	${RELOCATING-0} :
+  {
+    /*PROVIDE (__sdata_start = .);*/
+    __sdata_start = .;
+    *(.data)
+    *(.data.*)
+    *(.data1)
+    *(.data1.*)
+    *(.data.rel)
+    *(.data.rel.local)
+    __small_start = .;
+    *(.sdata)
+    *(.sdata.*)
+    *(.gnu.linkonce.s.*)
+    ${CONSTRUCTING+CONSTRUCTORS}
+    PROVIDE (__r13_init = /*__small_start*/ __sdata_start + 0x8000);
+    PROVIDE (__sdata_end = .);
+  }
+  /*PROVIDE (__sdata_size = SIZEOF(.sdata));*/
+  ${RELOCATING+_edata  =  .;}
+  ${RELOCATING+PROVIDE (edata = .);}
+  .sbss    ${RELOCATING-0} :
+  {
+    /*PROVIDE (__sbss_start = .);*/
+    __sbss_start = .;
+    *(.sbss)
+    *(.sbss.*)
+    *(.scommon)
+    *(.gnu.linkonce.sb.*)
+    *(.dynsbss)
+    *(.bss)
+    *(.bss.*)
+    *(.gnu.linkonce.b.*)
+    *(COMMON)
+    PROVIDE (__sbss_end = .);
+  }
+  PROVIDE (__sdata_size = __sbss_start - __sdata_start);
+  PROVIDE (__sbss_size = SIZEOF(.sbss));
+  ${PLT}
+  ${RELOCATING+_end = . ;}
+  ${RELOCATING+PROVIDE (end = .);}
+
+  /* These are needed for ELF backends which have not yet been
+     converted to the new style linker.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+
+  /* These must appear regardless of ${RELOCATING}.  */
+  ${OTHER_SECTIONS}
+}
+EOF
diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc
index f5cfc70..c5ded88 100644
--- binutils-2.9.1.orig/ld/scripttempl/pe.sc
+++ binutils-2.9.1/ld/scripttempl/pe.sc
@@ -37,7 +37,9 @@ ${RELOCATING-OUTPUT_FORMAT(${RELOCATEABLE_OUTPUT_FORMAT})}
 ${LIB_SEARCH_DIRS}
 
 ENTRY(_mainCRTStartup)
-
+${RELOCATING+header = .;}
+${RELOCATING+__fltused = .; /* set up floating pt for MS .obj\'s */}
+${RELOCATING+__ldused = .;}
 SECTIONS
 {
   .text ${RELOCATING+ __image_base__ + __section_alignment__ } : 
@@ -79,6 +81,12 @@ SECTIONS
     ${RELOCATING+__bss_start__ = . ;}
     *(.bss)
     *(COMMON)
+    /* link.exe apparently pulls in .obj's because of UNDEF common
+	symbols, which is not the coff way, but that's MS for you. */
+    *(.CRT\$XCA)
+    *(.CRT\$XCZ)
+    *(.CRT\$XIA)
+    *(.CRT\$XIZ)
     ${RELOCATING+__bss_end__ = . ;}
   }
 
@@ -123,6 +131,8 @@ SECTIONS
   .reloc ${RELOCATING+BLOCK(__section_alignment__)} :
   { 					
     *(.reloc)
+    ${RELOCATING+ /* These zeroes mark the end of the reloc section.  */}
+    ${RELOCATING+ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);}
   }
 
   .rsrc ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -140,6 +150,6 @@ SECTIONS
   {
     [ .stabstr ]
   }
-
+${RELOCATING+end = .; /* MS startup code needs this */}
 }
 EOF
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index e3f0773..61645a9 100644
--- binutils-2.9.1.orig/libiberty/ChangeLog
+++ binutils-2.9.1/libiberty/ChangeLog
@@ -129,6 +129,12 @@ Wed Sep 24 00:31:59 1997  Felix Lee  <flee@yin.cygnus.com>
 	* config/mh-windows (EXTRA_OFILES): add asprintf.o and
  	strncasecmp.o.
 
+Mon Sep 22 14:26:22 1997  Fred Fish  <fnf@cygnus.com>
+
+	* Makefile.in (lneeded-list): Since xmalloc.o and xexit.o
+	are in REQUIRED_OFILES, there is no need to include them
+	again, so remove conditional include based on alloca.o use.
+
 Thu Aug 28 14:27:15 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
 	* vasprintf.c (vasprintf): Allow for _BSD_VA_LIST_.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 58fabd5..9fdc91e 100644
--- binutils-2.9.1.orig/libiberty/Makefile.in
+++ binutils-2.9.1/libiberty/Makefile.in
@@ -28,7 +28,7 @@
 
 srcdir = .
 
-prefix = /usr/local
+prefix = @prefix@
 
 exec_prefix = $(prefix)
 bindir = $(exec_prefix)/bin
@@ -64,7 +64,7 @@ INSTALL_PROGRAM = $(INSTALL)
 INSTALL_DATA = $(INSTALL)
 
 AR = ar
-AR_FLAGS = rc
+ARFLAGS = rc
 
 ERRORS_CC = $(CC)
 CC = cc
@@ -100,7 +100,7 @@ EXTRA_OFILES =
 # Flags to pass to a recursive make.
 FLAGS_TO_PASS = \
 	"AR=$(AR)" \
-	"AR_FLAGS=$(AR_FLAGS)" \
+	"ARFLAGS=$(ARFLAGS)" \
 	"CC=$(CC)" \
 	"CFLAGS=$(CFLAGS)" \
 	"LIBCFLAGS=$(LIBCFLAGS)" \
@@ -130,7 +130,7 @@ check installcheck:
 
 INCDIR=$(srcdir)/$(MULTISRCTOP)../include
 
-COMPILE.c = $(CC) -c $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
+COMPILE.c = $(CC) -c $(LIBCFLAGS) -I. -I$(INCDIR) -I$(srcdir) $(HDEFINES)
 .c.o:
 	test -z "$(PICFLAG)" || \
 	  $(COMPILE.c) $(PICFLAG) $< -o pic/$@
@@ -204,9 +204,6 @@ lneeded-list: $(EXTRA_OFILES) needed.awk errors
 	    *) f="$$f $$i" ;; \
 	  esac ; \
 	done ; \
-	case $$f in \
-	    *alloca.o*) f="$$f xmalloc.o xexit.o" ;; \
-	esac ; \
 	echo $$f >>lneeded-list
 
 # Generate an awk script that looks for functions in functions.def
@@ -243,7 +240,7 @@ needed2.awk: $(srcdir)/functions.def Makefile
 	 >>needed2.awk
 
 dummy.o: $(srcdir)/dummy.c $(srcdir)/functions.def
-	$(CC) -c $(CFLAGS) -I. -I$(INCDIR) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
+	$(CC) -c $(CFLAGS) -I. -I$(INCDIR) -I$(srcdir) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
 
 errors: dummy.o $(EXTRA_OFILES)
 	-($(ERRORS_CC) -o dummy $(CFLAGS) $(LDFLAGS) $(ERRORS_LDFLAGS) dummy.o $(EXTRA_OFILES) $(LOADLIBES)) >errors 2>&1 || true
@@ -263,7 +260,7 @@ $(RULE1): $(REQUIRED_OFILES) $(DO_ALSO) .always.
 RULE2 = not-used
 $(RULE2): $(REQUIRED_OFILES) $(HOST_OFILES)
 	rm -rf $(TARGETLIB)
-	$(AR) $(AR_FLAGS) $(TARGETLIB) \
+	$(AR) $(ARFLAGS) $(TARGETLIB) \
 	  $(REQUIRED_OFILES) $(HOST_OFILES)
 	$(RANLIB) $(TARGETLIB)
 
diff --git a/libiberty/alloca-norm.h b/libiberty/alloca-norm.h
index bda4fc0..fb6b7ce 100644
--- binutils-2.9.1.orig/libiberty/alloca-norm.h
+++ binutils-2.9.1/libiberty/alloca-norm.h
@@ -1,6 +1,6 @@
 /* "Normal" configuration for alloca.  */
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && !defined (C_ALLOCA)
 #ifndef alloca
 #define alloca __builtin_alloca
 #endif
diff --git a/libiberty/config.table b/libiberty/config.table
index e367e1b..db832f9 100644
--- binutils-2.9.1.orig/libiberty/config.table
+++ binutils-2.9.1/libiberty/config.table
@@ -23,6 +23,9 @@ case "${host}" in
   *-*-sysv*)		frag=mh-sysv ;;
   *-*-go32)		frag=mh-go32 ;;
   i[345]86-*-windows*)	frag=mh-windows ;;
+  *-*-amigaos*)		frag=mh-amigaos ;;
+  *-*-morphos*)		frag=mh-morphos ;;
+  *-*-beos*)		frag=mh-beos ;;
 
   *-*-vxworks5* | *-*-vxworks)
     # VxWorks 5 needs special action, because the usual
diff --git a/libiberty/config/mh-amigaos b/libiberty/config/mh-amigaos
new file mode 100755
index 0000000..e857793
--- /dev/null
+++ binutils-2.9.1/libiberty/config/mh-amigaos
@@ -0,0 +1,12 @@
+# Host makefile fragment for Commodore Amiga running AmigaOS.
+
+# We don't actually use libmmalloc.a, since there is no sbrk(),
+# but this allows us to compile it (and then ignore it).
+MMALLOC=
+MMALLOC_DISABLE = -DNO_MMALLOC
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+
+# Compile for automatic stack extension.
+HDEFINES = -mstackextend
diff --git a/libiberty/config/mh-beos b/libiberty/config/mh-beos
new file mode 100644
index 0000000..9b75e7d
--- /dev/null
+++ binutils-2.9.1/libiberty/config/mh-beos
@@ -0,0 +1,7 @@
+# Host makefile fragment for BeOS
+
+# This is a temporary hack until the wimpy default 64k stack
+# limit in BeOS is either increased or made user settable somehow.
+# This probably won't happen until after the DR9 release.
+
+EXTRA_OFILES = alloca.o
diff --git a/libiberty/config/mh-morphos b/libiberty/config/mh-morphos
new file mode 100755
index 0000000..f0cff4a
--- /dev/null
+++ binutils-2.9.1/libiberty/config/mh-morphos
@@ -0,0 +1,12 @@
+# Host makefile fragment for MorphOS.
+
+# We don't actually use libmmalloc.a, since there is no sbrk(),
+# but this allows us to compile it (and then ignore it).
+MMALLOC=
+MMALLOC_DISABLE = -DNO_MMALLOC
+
+# There is no standard system compiler.  Assume using GNU C.
+CC = gcc
+
+# Compile for automatic stack extension.
+HDEFINES = 
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index f4d7123..994857a 100644
--- binutils-2.9.1.orig/libiberty/cplus-dem.c
+++ binutils-2.9.1/libiberty/cplus-dem.c
@@ -3266,8 +3266,8 @@ fatal (str)
   exit (1);
 }
 
-char * malloc ();
-char * realloc ();
+void * malloc (size_t);
+void * realloc (void *, size_t);
 
 char *
 xmalloc (size)
diff --git a/libiberty/memchr.c b/libiberty/memchr.c
index 93ef43d..3fe99d8 100644
--- binutils-2.9.1.orig/libiberty/memchr.c
+++ binutils-2.9.1/libiberty/memchr.c
@@ -50,7 +50,7 @@ memchr (src_void, c, length)
 {
   CONST unsigned char *src = (CONST unsigned char *)src_void;
   
-  while (--length >= 0)
+  while (length-- > 0)
   {
     if (*src == c)
      return (PTR)src;
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index f5e2eeb..c75ba1c 100644
--- binutils-2.9.1.orig/libiberty/strerror.c
+++ binutils-2.9.1/libiberty/strerror.c
@@ -7,6 +7,10 @@
 
 #include "config.h"
 
+#ifdef linux
+#undef NEED_sys_errlist
+#endif
+
 #ifndef NEED_sys_errlist
 /* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
    might declare sys_errlist in a way that the compiler might consider
diff --git a/libiberty/xmalloc.c b/libiberty/xmalloc.c
index b88105a..b050050 100644
--- binutils-2.9.1.orig/libiberty/xmalloc.c
+++ binutils-2.9.1/libiberty/xmalloc.c
@@ -53,7 +53,7 @@ xmalloc_set_program_name (s)
      const char *s;
 {
   name = s;
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
+#if defined (HAVE_SBRK) && (! defined (_WIN32) || defined (__CYGWIN32__))
   /* Win32 ports other than cygwin32 don't have brk() */
   if (first_break == NULL)
     first_break = (char *) sbrk (0);
@@ -71,7 +71,7 @@ xmalloc (size)
   newmem = malloc (size);
   if (!newmem)
     {
-#if ! defined (_WIN32) || defined (__CYGWIN32__)
+#if defined (HAVE_SBRK) && (! defined (_WIN32) || defined (__CYGWIN32__))
       extern char **environ;
       size_t allocated;
 
@@ -109,7 +109,7 @@ xrealloc (oldmem, size)
     newmem = realloc (oldmem, size);
   if (!newmem)
     {
-#ifndef __MINGW32__
+#if defined (HAVE_SBRK) && !defined (__MINGW32__)
       extern char **environ;
       size_t allocated;
 
diff --git a/ltconfig b/ltconfig
index fe78498..b8f7aea 100755
--- binutils-2.9.1.orig/ltconfig
+++ binutils-2.9.1/ltconfig
@@ -90,6 +90,7 @@ with_gcc=no
 with_gnu_ld=no
 
 old_AR="$AR"
+old_ARFLAGS="$ARFLAGS"
 old_CC="$CC"
 old_CFLAGS="$CFLAGS"
 old_CPPFLAGS="$CPPFLAGS"
@@ -320,12 +321,13 @@ aix3*)
 esac
 
 # Determine commands to create old-style static archives.
-old_archive_cmds='$AR cru $oldlib$oldobjs'
+old_archive_cmds='$AR $ARFLAGS $oldlib$oldobjs'
 old_postinstall_cmds='chmod 644 $oldlib'
 old_postuninstall_cmds=
 
 # Set a sane default for `AR'.
 test -z "$AR" && AR=ar
+test -z "$ARFLAGS" && ARFLAGS=cru
 
 # If RANLIB is not set, then run the test.
 if test "${RANLIB+set}" != "set"; then
@@ -732,7 +734,7 @@ else
   case "$host_os" in
   aix3*)
     allow_undefined_flag=unsupported
-    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
+    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR $ARFLAGS $lib $objdir/$soname'
     # Note: this linker hardcodes the directories in LIBPATH if there
     # are no directories specified by -L.
     hardcode_minus_L=yes
@@ -745,13 +747,13 @@ else
 
   aix4*)
     allow_undefined_flag=unsupported
-    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
+    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR $ARFLAGS $lib $objdir/$soname'
     hardcode_direct=yes
     hardcode_minus_L=yes
     ;;
 
   amigaos*)
-    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
+    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR $ARFLAGS $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
     hardcode_libdir_flag_spec='-L$libdir'
     hardcode_minus_L=yes
     ;;
@@ -1120,7 +1122,7 @@ aix3* | aix4*)
 amigaos*)
   library_names_spec='$libname.ixlibrary $libname.a'
   # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show \"(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)\"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
   ;;
 
 freebsd2* | freebsd3*)
@@ -1379,6 +1381,9 @@ host="$host"
 # The archiver.
 AR="$AR"
 
+# The flags passed to the archiver to create an archive
+ARFLAGS="$ARFLAGS"
+
 # The default C compiler.
 CC="$CC"
 
diff --git a/make-stmp b/make-stmp
new file mode 100644
index 0000000..e69de29
diff --git a/manifests/bin b/manifests/bin
new file mode 100644
index 0000000..843e414
--- /dev/null
+++ binutils-2.9.1/manifests/bin
@@ -0,0 +1,55 @@
+COPYING
+bin/addr2line
+bin/ar
+bin/as
+bin/c++filt
+bin/gasp
+bin/gprof
+bin/ld
+bin/nm
+bin/objcopy
+bin/objdump
+bin/ranlib
+bin/size
+bin/strings
+bin/strip
+guide/standards.guide
+include/ansidecl.h
+include/bfd.h
+include/bfdlink.h
+info/standards.info
+lib/libbfd.a
+lib/libbfd.la
+lib/libiberty.a
+lib/libopcodes.a
+lib/libopcodes.la
+m68k-amigaos/bin/ar
+m68k-amigaos/bin/as
+m68k-amigaos/bin/ld
+m68k-amigaos/bin/nm
+m68k-amigaos/bin/ranlib
+m68k-amigaos/bin/strip
+m68k-amigaos/lib/ldscripts/amiga.x
+m68k-amigaos/lib/ldscripts/amiga.xbn
+m68k-amigaos/lib/ldscripts/amiga.xn
+m68k-amigaos/lib/ldscripts/amiga.xr
+m68k-amigaos/lib/ldscripts/amiga.xu
+m68k-amigaos/lib/ldscripts/amiga_bss.x
+m68k-amigaos/lib/ldscripts/amiga_bss.xbn
+m68k-amigaos/lib/ldscripts/amiga_bss.xn
+m68k-amigaos/lib/ldscripts/amiga_bss.xr
+m68k-amigaos/lib/ldscripts/amiga_bss.xu
+man/man1/addr2line.1
+man/man1/ar.1
+man/man1/as.1
+man/man1/c++filt.1
+man/man1/gprof.1
+man/man1/ld.1
+man/man1/nlmconv.1
+man/man1/nm.1
+man/man1/objcopy.1
+man/man1/objdump.1
+man/man1/ranlib.1
+man/man1/size.1
+man/man1/strings.1
+man/man1/strip.1
diff --git a/manifests/src b/manifests/src
new file mode 100644
index 0000000..bdc8e1a
--- /dev/null
+++ binutils-2.9.1/manifests/src
@@ -0,0 +1,2070 @@
+fsf/binutils/COPYING
+fsf/binutils/COPYING.LIB
+fsf/binutils/ChangeLog
+fsf/binutils/Makefile.in
+fsf/binutils/Product-Info
+fsf/binutils/README
+fsf/binutils/bfd/COPYING
+fsf/binutils/bfd/ChangeLog
+fsf/binutils/bfd/ChangeLog.1
+fsf/binutils/bfd/ChangeLog.2
+fsf/binutils/bfd/Makefile.am
+fsf/binutils/bfd/Makefile.in
+fsf/binutils/bfd/PORTING
+fsf/binutils/bfd/README
+fsf/binutils/bfd/TODO
+fsf/binutils/bfd/acconfig.h
+fsf/binutils/bfd/acinclude.m4
+fsf/binutils/bfd/aclocal.m4
+fsf/binutils/bfd/aix386-core.c
+fsf/binutils/bfd/amigaos.c
+fsf/binutils/bfd/amigaoslink.c
+fsf/binutils/bfd/aout-adobe.c
+fsf/binutils/bfd/aout-amiga.c
+fsf/binutils/bfd/aout-arm.c
+fsf/binutils/bfd/aout-encap.c
+fsf/binutils/bfd/aout-ns32k.c
+fsf/binutils/bfd/aout-sparcle.c
+fsf/binutils/bfd/aout-target.h
+fsf/binutils/bfd/aout-tic30.c
+fsf/binutils/bfd/aout0.c
+fsf/binutils/bfd/aout32.c
+fsf/binutils/bfd/aout64.c
+fsf/binutils/bfd/aoutf1.h
+fsf/binutils/bfd/aoutx.h
+fsf/binutils/bfd/archive.c
+fsf/binutils/bfd/archures.c
+fsf/binutils/bfd/bfd-in.h
+fsf/binutils/bfd/bfd-in2.h
+fsf/binutils/bfd/bfd.c
+fsf/binutils/bfd/binary.c
+fsf/binutils/bfd/bout.c
+fsf/binutils/bfd/cache.c
+fsf/binutils/bfd/cf-i386lynx.c
+fsf/binutils/bfd/cf-m68klynx.c
+fsf/binutils/bfd/cf-sparclynx.c
+fsf/binutils/bfd/cisco-core.c
+fsf/binutils/bfd/coff-a29k.c
+fsf/binutils/bfd/coff-alpha.c
+fsf/binutils/bfd/coff-apollo.c
+fsf/binutils/bfd/coff-arm.c
+fsf/binutils/bfd/coff-aux.c
+fsf/binutils/bfd/coff-go32.c
+fsf/binutils/bfd/coff-h8300.c
+fsf/binutils/bfd/coff-h8500.c
+fsf/binutils/bfd/coff-i386.c
+fsf/binutils/bfd/coff-i860.c
+fsf/binutils/bfd/coff-i960.c
+fsf/binutils/bfd/coff-m68k.c
+fsf/binutils/bfd/coff-m88k.c
+fsf/binutils/bfd/coff-mips.c
+fsf/binutils/bfd/coff-pmac.c
+fsf/binutils/bfd/coff-ppc.c
+fsf/binutils/bfd/coff-rs6000.c
+fsf/binutils/bfd/coff-sh.c
+fsf/binutils/bfd/coff-sparc.c
+fsf/binutils/bfd/coff-stgo32.c
+fsf/binutils/bfd/coff-svm68k.c
+fsf/binutils/bfd/coff-tic30.c
+fsf/binutils/bfd/coff-u68k.c
+fsf/binutils/bfd/coff-w65.c
+fsf/binutils/bfd/coff-we32k.c
+fsf/binutils/bfd/coff-z8k.c
+fsf/binutils/bfd/coffcode.h
+fsf/binutils/bfd/coffgen.c
+fsf/binutils/bfd/cofflink.c
+fsf/binutils/bfd/coffswap.h
+fsf/binutils/bfd/config.bfd
+fsf/binutils/bfd/config.in
+fsf/binutils/bfd/configure
+fsf/binutils/bfd/configure.bat
+fsf/binutils/bfd/configure.com
+fsf/binutils/bfd/configure.host
+fsf/binutils/bfd/configure.in
+fsf/binutils/bfd/corefile.c
+fsf/binutils/bfd/cpu-a29k.c
+fsf/binutils/bfd/cpu-alpha.c
+fsf/binutils/bfd/cpu-arc.c
+fsf/binutils/bfd/cpu-arm.c
+fsf/binutils/bfd/cpu-d10v.c
+fsf/binutils/bfd/cpu-h8300.c
+fsf/binutils/bfd/cpu-h8500.c
+fsf/binutils/bfd/cpu-hppa.c
+fsf/binutils/bfd/cpu-i386.c
+fsf/binutils/bfd/cpu-i860.c
+fsf/binutils/bfd/cpu-i960.c
+fsf/binutils/bfd/cpu-m10200.c
+fsf/binutils/bfd/cpu-m10300.c
+fsf/binutils/bfd/cpu-m32r.c
+fsf/binutils/bfd/cpu-m68k.c
+fsf/binutils/bfd/cpu-m88k.c
+fsf/binutils/bfd/cpu-mips.c
+fsf/binutils/bfd/cpu-ns32k.c
+fsf/binutils/bfd/cpu-powerpc.c
+fsf/binutils/bfd/cpu-rs6000.c
+fsf/binutils/bfd/cpu-sh.c
+fsf/binutils/bfd/cpu-sparc.c
+fsf/binutils/bfd/cpu-tic30.c
+fsf/binutils/bfd/cpu-v850.c
+fsf/binutils/bfd/cpu-vax.c
+fsf/binutils/bfd/cpu-w65.c
+fsf/binutils/bfd/cpu-we32k.c
+fsf/binutils/bfd/cpu-z8k.c
+fsf/binutils/bfd/demo64.c
+fsf/binutils/bfd/dep-in.sed
+fsf/binutils/bfd/doc/ChangeLog
+fsf/binutils/bfd/doc/Makefile.am
+fsf/binutils/bfd/doc/Makefile.in
+fsf/binutils/bfd/doc/aoutx.texi
+fsf/binutils/bfd/doc/archive.texi
+fsf/binutils/bfd/doc/archures.texi
+fsf/binutils/bfd/doc/bfd.info-6
+fsf/binutils/bfd/doc/bfd.texinfo
+fsf/binutils/bfd/doc/bfdsumm.texi
+fsf/binutils/bfd/doc/bfdt.texi
+fsf/binutils/bfd/doc/cache.texi
+fsf/binutils/bfd/doc/chew.c
+fsf/binutils/bfd/doc/coffcode.texi
+fsf/binutils/bfd/doc/core.texi
+fsf/binutils/bfd/doc/doc.str
+fsf/binutils/bfd/doc/elf.texi
+fsf/binutils/bfd/doc/elfcode.texi
+fsf/binutils/bfd/doc/format.texi
+fsf/binutils/bfd/doc/hash.texi
+fsf/binutils/bfd/doc/init.texi
+fsf/binutils/bfd/doc/libbfd.texi
+fsf/binutils/bfd/doc/linker.texi
+fsf/binutils/bfd/doc/makefile.vms
+fsf/binutils/bfd/doc/opncls.texi
+fsf/binutils/bfd/doc/proto.str
+fsf/binutils/bfd/doc/reloc.texi
+fsf/binutils/bfd/doc/section.texi
+fsf/binutils/bfd/doc/syms.texi
+fsf/binutils/bfd/doc/targets.texi
+fsf/binutils/bfd/dwarf2.c
+fsf/binutils/bfd/ecoff.c
+fsf/binutils/bfd/ecofflink.c
+fsf/binutils/bfd/ecoffswap.h
+fsf/binutils/bfd/elf-bfd.h
+fsf/binutils/bfd/elf-m10200.c
+fsf/binutils/bfd/elf-m10300.c
+fsf/binutils/bfd/elf.c
+fsf/binutils/bfd/elf32-arc.c
+fsf/binutils/bfd/elf32-d10v.c
+fsf/binutils/bfd/elf32-gen.c
+fsf/binutils/bfd/elf32-hppa.c
+fsf/binutils/bfd/elf32-hppa.h
+fsf/binutils/bfd/elf32-i386.c
+fsf/binutils/bfd/elf32-i860.c
+fsf/binutils/bfd/elf32-m32r.c
+fsf/binutils/bfd/elf32-m68k.c
+fsf/binutils/bfd/elf32-m88k.c
+fsf/binutils/bfd/elf32-mips.c
+fsf/binutils/bfd/elf32-ppc.c
+fsf/binutils/bfd/elf32-sh.c
+fsf/binutils/bfd/elf32-sparc.c
+fsf/binutils/bfd/elf32-v850.c
+fsf/binutils/bfd/elf32.c
+fsf/binutils/bfd/elf64-alpha.c
+fsf/binutils/bfd/elf64-gen.c
+fsf/binutils/bfd/elf64-mips.c
+fsf/binutils/bfd/elf64-sparc.c
+fsf/binutils/bfd/elf64.c
+fsf/binutils/bfd/elfcode.h
+fsf/binutils/bfd/elfcore.h
+fsf/binutils/bfd/elflink.c
+fsf/binutils/bfd/elflink.h
+fsf/binutils/bfd/elfxx-target.h
+fsf/binutils/bfd/evax-alpha.c
+fsf/binutils/bfd/evax-egsd.c
+fsf/binutils/bfd/evax-emh.c
+fsf/binutils/bfd/evax-etir.c
+fsf/binutils/bfd/evax-misc.c
+fsf/binutils/bfd/evax.h
+fsf/binutils/bfd/filemode.c
+fsf/binutils/bfd/format.c
+fsf/binutils/bfd/freebsd.h
+fsf/binutils/bfd/gen-aout.c
+fsf/binutils/bfd/genlink.h
+fsf/binutils/bfd/go32stub.h
+fsf/binutils/bfd/hash.c
+fsf/binutils/bfd/host-aout.c
+fsf/binutils/bfd/hosts/alphalinux.h
+fsf/binutils/bfd/hosts/alphavms.h
+fsf/binutils/bfd/hosts/amigaos.h
+fsf/binutils/bfd/hosts/decstation.h
+fsf/binutils/bfd/hosts/delta68.h
+fsf/binutils/bfd/hosts/dpx2.h
+fsf/binutils/bfd/hosts/hp300bsd.h
+fsf/binutils/bfd/hosts/i386bsd.h
+fsf/binutils/bfd/hosts/i386linux.h
+fsf/binutils/bfd/hosts/i386mach3.h
+fsf/binutils/bfd/hosts/i386sco.h
+fsf/binutils/bfd/hosts/i860mach3.h
+fsf/binutils/bfd/hosts/m68kaux.h
+fsf/binutils/bfd/hosts/m68klinux.h
+fsf/binutils/bfd/hosts/m88kmach3.h
+fsf/binutils/bfd/hosts/mipsbsd.h
+fsf/binutils/bfd/hosts/mipsmach3.h
+fsf/binutils/bfd/hosts/news-mips.h
+fsf/binutils/bfd/hosts/news.h
+fsf/binutils/bfd/hosts/pc532mach.h
+fsf/binutils/bfd/hosts/riscos.h
+fsf/binutils/bfd/hosts/symmetry.h
+fsf/binutils/bfd/hosts/tahoe.h
+fsf/binutils/bfd/hosts/vaxbsd.h
+fsf/binutils/bfd/hosts/vaxult.h
+fsf/binutils/bfd/hosts/vaxult2.h
+fsf/binutils/bfd/hp300bsd.c
+fsf/binutils/bfd/hp300hpux.c
+fsf/binutils/bfd/hppa_stubs.h
+fsf/binutils/bfd/hppabsd-core.c
+fsf/binutils/bfd/hpux-core.c
+fsf/binutils/bfd/i386aout.c
+fsf/binutils/bfd/i386bsd.c
+fsf/binutils/bfd/i386dynix.c
+fsf/binutils/bfd/i386freebsd.c
+fsf/binutils/bfd/i386linux.c
+fsf/binutils/bfd/i386lynx.c
+fsf/binutils/bfd/i386mach3.c
+fsf/binutils/bfd/i386msdos.c
+fsf/binutils/bfd/i386netbsd.c
+fsf/binutils/bfd/i386os9k.c
+fsf/binutils/bfd/ieee.c
+fsf/binutils/bfd/ihex.c
+fsf/binutils/bfd/init.c
+fsf/binutils/bfd/irix-core.c
+fsf/binutils/bfd/libamiga.h
+fsf/binutils/bfd/libaout.h
+fsf/binutils/bfd/libbfd-in.h
+fsf/binutils/bfd/libbfd.c
+fsf/binutils/bfd/libbfd.h
+fsf/binutils/bfd/libcoff-in.h
+fsf/binutils/bfd/libcoff.h
+fsf/binutils/bfd/libecoff.h
+fsf/binutils/bfd/libhppa.h
+fsf/binutils/bfd/libieee.h
+fsf/binutils/bfd/libnlm.h
+fsf/binutils/bfd/liboasys.h
+fsf/binutils/bfd/linker.c
+fsf/binutils/bfd/lynx-core.c
+fsf/binutils/bfd/m68k4knetbsd.c
+fsf/binutils/bfd/m68klinux.c
+fsf/binutils/bfd/m68klynx.c
+fsf/binutils/bfd/m68knetbsd.c
+fsf/binutils/bfd/m88kmach3.c
+fsf/binutils/bfd/makefile.dos
+fsf/binutils/bfd/makefile.vms
+fsf/binutils/bfd/mipsbsd.c
+fsf/binutils/bfd/mpw-config.in
+fsf/binutils/bfd/mpw-make.sed
+fsf/binutils/bfd/netbsd-core.c
+fsf/binutils/bfd/netbsd.h
+fsf/binutils/bfd/newsos3.c
+fsf/binutils/bfd/nlm-target.h
+fsf/binutils/bfd/nlm.c
+fsf/binutils/bfd/nlm32-alpha.c
+fsf/binutils/bfd/nlm32-i386.c
+fsf/binutils/bfd/nlm32-ppc.c
+fsf/binutils/bfd/nlm32-sparc.c
+fsf/binutils/bfd/nlm32.c
+fsf/binutils/bfd/nlm64.c
+fsf/binutils/bfd/nlmcode.h
+fsf/binutils/bfd/nlmswap.h
+fsf/binutils/bfd/ns32k.h
+fsf/binutils/bfd/ns32knetbsd.c
+fsf/binutils/bfd/oasys.c
+fsf/binutils/bfd/opncls.c
+fsf/binutils/bfd/osf-core.c
+fsf/binutils/bfd/pc532-mach.c
+fsf/binutils/bfd/pe-arm.c
+fsf/binutils/bfd/pe-i386.c
+fsf/binutils/bfd/pe-ppc.c
+fsf/binutils/bfd/pei-arm.c
+fsf/binutils/bfd/pei-i386.c
+fsf/binutils/bfd/pei-ppc.c
+fsf/binutils/bfd/peicode.h
+fsf/binutils/bfd/ppcboot.c
+fsf/binutils/bfd/ptrace-core.c
+fsf/binutils/bfd/reloc.c
+fsf/binutils/bfd/reloc16.c
+fsf/binutils/bfd/riscix.c
+fsf/binutils/bfd/rs6000-core.c
+fsf/binutils/bfd/section.c
+fsf/binutils/bfd/som.c
+fsf/binutils/bfd/som.h
+fsf/binutils/bfd/sparclinux.c
+fsf/binutils/bfd/sparclynx.c
+fsf/binutils/bfd/sparcnetbsd.c
+fsf/binutils/bfd/srec.c
+fsf/binutils/bfd/stab-syms.c
+fsf/binutils/bfd/stabs.c
+fsf/binutils/bfd/stamp-h.in
+fsf/binutils/bfd/sunos.c
+fsf/binutils/bfd/syms.c
+fsf/binutils/bfd/sysdep.h
+fsf/binutils/bfd/targets.c
+fsf/binutils/bfd/targmatch.sed
+fsf/binutils/bfd/tekhex.c
+fsf/binutils/bfd/trad-core.c
+fsf/binutils/bfd/vaxnetbsd.c
+fsf/binutils/bfd/versados.c
+fsf/binutils/bfd/xcofflink.c
+fsf/binutils/binutils/ChangeLog
+fsf/binutils/binutils/Makefile.am
+fsf/binutils/binutils/Makefile.in
+fsf/binutils/binutils/NEWS
+fsf/binutils/binutils/README
+fsf/binutils/binutils/acconfig.h
+fsf/binutils/binutils/acinclude.m4
+fsf/binutils/binutils/aclocal.m4
+fsf/binutils/binutils/addr2line.1
+fsf/binutils/binutils/addr2line.c
+fsf/binutils/binutils/ar.1
+fsf/binutils/binutils/ar.c
+fsf/binutils/binutils/arlex.l
+fsf/binutils/binutils/arparse.y
+fsf/binutils/binutils/arsup.c
+fsf/binutils/binutils/arsup.h
+fsf/binutils/binutils/binutils.texi
+fsf/binutils/binutils/bucomm.c
+fsf/binutils/binutils/bucomm.h
+fsf/binutils/binutils/budbg.h
+fsf/binutils/binutils/coffdump.c
+fsf/binutils/binutils/coffgrok.c
+fsf/binutils/binutils/coffgrok.h
+fsf/binutils/binutils/config.in
+fsf/binutils/binutils/config.texi
+fsf/binutils/binutils/configure
+fsf/binutils/binutils/configure.bat
+fsf/binutils/binutils/configure.com
+fsf/binutils/binutils/configure.in
+fsf/binutils/binutils/cxxfilt.man
+fsf/binutils/binutils/debug.c
+fsf/binutils/binutils/debug.h
+fsf/binutils/binutils/deflex.l
+fsf/binutils/binutils/defparse.c
+fsf/binutils/binutils/defparse.h
+fsf/binutils/binutils/defparse.y
+fsf/binutils/binutils/dep-in.sed
+fsf/binutils/binutils/dlltool.c
+fsf/binutils/binutils/dlltool.h
+fsf/binutils/binutils/filemode.c
+fsf/binutils/binutils/ieee.c
+fsf/binutils/binutils/is-ranlib.c
+fsf/binutils/binutils/is-strip.c
+fsf/binutils/binutils/mac-binutils.r
+fsf/binutils/binutils/makefile.vms
+fsf/binutils/binutils/maybe-ranlib.c
+fsf/binutils/binutils/maybe-strip.c
+fsf/binutils/binutils/mpw-config.in
+fsf/binutils/binutils/mpw-make.sed
+fsf/binutils/binutils/nlmconv.1
+fsf/binutils/binutils/nlmconv.c
+fsf/binutils/binutils/nlmconv.h
+fsf/binutils/binutils/nlmheader.h
+fsf/binutils/binutils/nlmheader.y
+fsf/binutils/binutils/nm.1
+fsf/binutils/binutils/nm.c
+fsf/binutils/binutils/not-ranlib.c
+fsf/binutils/binutils/not-strip.c
+fsf/binutils/binutils/objcopy.1
+fsf/binutils/binutils/objcopy.c
+fsf/binutils/binutils/objdump.1
+fsf/binutils/binutils/objdump.c
+fsf/binutils/binutils/prdbg.c
+fsf/binutils/binutils/ranlib.1
+fsf/binutils/binutils/ranlib.sh
+fsf/binutils/binutils/rclex.c
+fsf/binutils/binutils/rclex.l
+fsf/binutils/binutils/rcparse.c
+fsf/binutils/binutils/rcparse.h
+fsf/binutils/binutils/rcparse.y
+fsf/binutils/binutils/rdcoff.c
+fsf/binutils/binutils/rddbg.c
+fsf/binutils/binutils/resbin.c
+fsf/binutils/binutils/rescoff.c
+fsf/binutils/binutils/resrc.c
+fsf/binutils/binutils/sanity.sh
+fsf/binutils/binutils/size.1
+fsf/binutils/binutils/size.c
+fsf/binutils/binutils/srconv.c
+fsf/binutils/binutils/stabs.c
+fsf/binutils/binutils/stamp-h.in
+fsf/binutils/binutils/strings.1
+fsf/binutils/binutils/strings.c
+fsf/binutils/binutils/strip.1
+fsf/binutils/binutils/sysdump.c
+fsf/binutils/binutils/sysinfo.y
+fsf/binutils/binutils/syslex.l
+fsf/binutils/binutils/testsuite/ChangeLog
+fsf/binutils/binutils/testsuite/binutils-all/ar.exp
+fsf/binutils/binutils/testsuite/binutils-all/bintest.s
+fsf/binutils/binutils/testsuite/binutils-all/hppa/addendbug.s
+fsf/binutils/binutils/testsuite/binutils-all/hppa/objdump.exp
+fsf/binutils/binutils/testsuite/binutils-all/nm.exp
+fsf/binutils/binutils/testsuite/binutils-all/objcopy.exp
+fsf/binutils/binutils/testsuite/binutils-all/objdump.exp
+fsf/binutils/binutils/testsuite/binutils-all/size.exp
+fsf/binutils/binutils/testsuite/binutils-all/testprog.c
+fsf/binutils/binutils/testsuite/config/default.exp
+fsf/binutils/binutils/testsuite/config/hppa.sed
+fsf/binutils/binutils/testsuite/lib/utils-lib.exp
+fsf/binutils/binutils/version.c
+fsf/binutils/binutils/windres.c
+fsf/binutils/binutils/windres.h
+fsf/binutils/binutils/wrstabs.c
+fsf/binutils/config-ml.in
+fsf/binutils/config.guess
+fsf/binutils/config.sub
+fsf/binutils/config/ChangeLog
+fsf/binutils/config/mh-a68bsd
+fsf/binutils/config/mh-aix386
+fsf/binutils/config/mh-amigaos
+fsf/binutils/config/mh-apollo68
+fsf/binutils/config/mh-cxux
+fsf/binutils/config/mh-cygwin32
+fsf/binutils/config/mh-decstation
+fsf/binutils/config/mh-delta88
+fsf/binutils/config/mh-dgux
+fsf/binutils/config/mh-dgux386
+fsf/binutils/config/mh-elfalphapic
+fsf/binutils/config/mh-go32
+fsf/binutils/config/mh-hp300
+fsf/binutils/config/mh-hpux
+fsf/binutils/config/mh-hpux8
+fsf/binutils/config/mh-irix4
+fsf/binutils/config/mh-irix5
+fsf/binutils/config/mh-irix6
+fsf/binutils/config/mh-lynxos
+fsf/binutils/config/mh-lynxrs6k
+fsf/binutils/config/mh-m68kpic
+fsf/binutils/config/mh-mingw32
+fsf/binutils/config/mh-ncr3000
+fsf/binutils/config/mh-ncrsvr43
+fsf/binutils/config/mh-necv4
+fsf/binutils/config/mh-papic
+fsf/binutils/config/mh-ppcpic
+fsf/binutils/config/mh-riscos
+fsf/binutils/config/mh-sco
+fsf/binutils/config/mh-solaris
+fsf/binutils/config/mh-sparcpic
+fsf/binutils/config/mh-sun3
+fsf/binutils/config/mh-sysv
+fsf/binutils/config/mh-sysv4
+fsf/binutils/config/mh-vaxult2
+fsf/binutils/config/mh-windows
+fsf/binutils/config/mh-x86pic
+fsf/binutils/config/mpw-mh-mpw
+fsf/binutils/config/mpw/ChangeLog
+fsf/binutils/config/mpw/MoveIfChange
+fsf/binutils/config/mpw/README
+fsf/binutils/config/mpw/forward-include
+fsf/binutils/config/mpw/g-mpw-make.sed
+fsf/binutils/config/mpw/mpw-touch
+fsf/binutils/config/mpw/mpw-true
+fsf/binutils/config/mpw/null-command
+fsf/binutils/config/mpw/open-brace
+fsf/binutils/config/mpw/tr-7to8-src
+fsf/binutils/config/mpw/true
+fsf/binutils/config/mt-elfalphapic
+fsf/binutils/config/mt-linux
+fsf/binutils/config/mt-m68kpic
+fsf/binutils/config/mt-netware
+fsf/binutils/config/mt-papic
+fsf/binutils/config/mt-ppcpic
+fsf/binutils/config/mt-sparcpic
+fsf/binutils/config/mt-v810
+fsf/binutils/config/mt-x86pic
+fsf/binutils/configure
+fsf/binutils/configure.bat
+fsf/binutils/configure.in
+fsf/binutils/etc/Makefile.in
+fsf/binutils/etc/configure
+fsf/binutils/etc/configure.in
+fsf/binutils/etc/make-stds.texi
+fsf/binutils/etc/standards.texi
+fsf/binutils/gas/CONTRIBUTORS
+fsf/binutils/gas/COPYING
+fsf/binutils/gas/ChangeLog
+fsf/binutils/gas/ChangeLog.1
+fsf/binutils/gas/Makefile.am
+fsf/binutils/gas/Makefile.in
+fsf/binutils/gas/NEWS
+fsf/binutils/gas/README
+fsf/binutils/gas/README-vms
+fsf/binutils/gas/acconfig.h
+fsf/binutils/gas/acinclude.m4
+fsf/binutils/gas/aclocal.m4
+fsf/binutils/gas/app.c
+fsf/binutils/gas/as.c
+fsf/binutils/gas/as.h
+fsf/binutils/gas/atof-generic.c
+fsf/binutils/gas/bignum-copy.c
+fsf/binutils/gas/bignum.h
+fsf/binutils/gas/bit_fix.h
+fsf/binutils/gas/cgen.c
+fsf/binutils/gas/cond.c
+fsf/binutils/gas/config-gas.com
+fsf/binutils/gas/config.in
+fsf/binutils/gas/config/amigaos.mh
+fsf/binutils/gas/config/aout_gnu.h
+fsf/binutils/gas/config/atof-ieee.c
+fsf/binutils/gas/config/atof-tahoe.c
+fsf/binutils/gas/config/atof-vax.c
+fsf/binutils/gas/config/e-i386coff.c
+fsf/binutils/gas/config/e-i386elf.c
+fsf/binutils/gas/config/e-mipsecoff.c
+fsf/binutils/gas/config/e-mipself.c
+fsf/binutils/gas/config/go32.cfg
+fsf/binutils/gas/config/itbl-mips.h
+fsf/binutils/gas/config/m68k-parse.h
+fsf/binutils/gas/config/m68k-parse.y
+fsf/binutils/gas/config/m88k-opcode.h
+fsf/binutils/gas/config/obj-amigahunk.c
+fsf/binutils/gas/config/obj-amigahunk.h
+fsf/binutils/gas/config/obj-aout.c
+fsf/binutils/gas/config/obj-aout.h
+fsf/binutils/gas/config/obj-bout.c
+fsf/binutils/gas/config/obj-bout.h
+fsf/binutils/gas/config/obj-coff.c
+fsf/binutils/gas/config/obj-coff.h
+fsf/binutils/gas/config/obj-ecoff.c
+fsf/binutils/gas/config/obj-ecoff.h
+fsf/binutils/gas/config/obj-elf.c
+fsf/binutils/gas/config/obj-elf.h
+fsf/binutils/gas/config/obj-evax.c
+fsf/binutils/gas/config/obj-evax.h
+fsf/binutils/gas/config/obj-generic.c
+fsf/binutils/gas/config/obj-generic.h
+fsf/binutils/gas/config/obj-hp300.c
+fsf/binutils/gas/config/obj-hp300.h
+fsf/binutils/gas/config/obj-ieee.c
+fsf/binutils/gas/config/obj-ieee.h
+fsf/binutils/gas/config/obj-multi.c
+fsf/binutils/gas/config/obj-multi.h
+fsf/binutils/gas/config/obj-som.c
+fsf/binutils/gas/config/obj-som.h
+fsf/binutils/gas/config/obj-vms.c
+fsf/binutils/gas/config/obj-vms.h
+fsf/binutils/gas/config/tc-a29k.c
+fsf/binutils/gas/config/tc-a29k.h
+fsf/binutils/gas/config/tc-alpha.c
+fsf/binutils/gas/config/tc-alpha.h
+fsf/binutils/gas/config/tc-arc.c
+fsf/binutils/gas/config/tc-arc.h
+fsf/binutils/gas/config/tc-arm.c
+fsf/binutils/gas/config/tc-arm.h
+fsf/binutils/gas/config/tc-d10v.c
+fsf/binutils/gas/config/tc-d10v.h
+fsf/binutils/gas/config/tc-generic.c
+fsf/binutils/gas/config/tc-generic.h
+fsf/binutils/gas/config/tc-h8300.c
+fsf/binutils/gas/config/tc-h8300.h
+fsf/binutils/gas/config/tc-h8500.c
+fsf/binutils/gas/config/tc-h8500.h
+fsf/binutils/gas/config/tc-hppa.c
+fsf/binutils/gas/config/tc-hppa.h
+fsf/binutils/gas/config/tc-i386.c
+fsf/binutils/gas/config/tc-i386.h
+fsf/binutils/gas/config/tc-i860.c
+fsf/binutils/gas/config/tc-i860.h
+fsf/binutils/gas/config/tc-i960.c
+fsf/binutils/gas/config/tc-i960.h
+fsf/binutils/gas/config/tc-m32r.c
+fsf/binutils/gas/config/tc-m32r.h
+fsf/binutils/gas/config/tc-m68851.h
+fsf/binutils/gas/config/tc-m68k.c
+fsf/binutils/gas/config/tc-m68k.h
+fsf/binutils/gas/config/tc-m88k.c
+fsf/binutils/gas/config/tc-m88k.h
+fsf/binutils/gas/config/tc-mips.c
+fsf/binutils/gas/config/tc-mips.h
+fsf/binutils/gas/config/tc-mn10200.c
+fsf/binutils/gas/config/tc-mn10200.h
+fsf/binutils/gas/config/tc-mn10300.c
+fsf/binutils/gas/config/tc-mn10300.h
+fsf/binutils/gas/config/tc-ns32k.c
+fsf/binutils/gas/config/tc-ns32k.h
+fsf/binutils/gas/config/tc-ppc.c
+fsf/binutils/gas/config/tc-ppc.h
+fsf/binutils/gas/config/tc-sh.c
+fsf/binutils/gas/config/tc-sh.h
+fsf/binutils/gas/config/tc-sparc.c
+fsf/binutils/gas/config/tc-sparc.h
+fsf/binutils/gas/config/tc-tahoe.c
+fsf/binutils/gas/config/tc-tahoe.h
+fsf/binutils/gas/config/tc-tic30.c
+fsf/binutils/gas/config/tc-tic30.h
+fsf/binutils/gas/config/tc-v850.c
+fsf/binutils/gas/config/tc-v850.h
+fsf/binutils/gas/config/tc-vax.c
+fsf/binutils/gas/config/tc-vax.h
+fsf/binutils/gas/config/tc-w65.c
+fsf/binutils/gas/config/tc-w65.h
+fsf/binutils/gas/config/tc-z8k.c
+fsf/binutils/gas/config/tc-z8k.h
+fsf/binutils/gas/config/te-386bsd.h
+fsf/binutils/gas/config/te-amiga.h
+fsf/binutils/gas/config/te-aux.h
+fsf/binutils/gas/config/te-delt88.h
+fsf/binutils/gas/config/te-delta.h
+fsf/binutils/gas/config/te-dpx2.h
+fsf/binutils/gas/config/te-dynix.h
+fsf/binutils/gas/config/te-generic.h
+fsf/binutils/gas/config/te-go32.h
+fsf/binutils/gas/config/te-hp300.h
+fsf/binutils/gas/config/te-hppa.h
+fsf/binutils/gas/config/te-i386aix.h
+fsf/binutils/gas/config/te-ic960.h
+fsf/binutils/gas/config/te-linux.h
+fsf/binutils/gas/config/te-lnews.h
+fsf/binutils/gas/config/te-lynx.h
+fsf/binutils/gas/config/te-mach.h
+fsf/binutils/gas/config/te-macos.h
+fsf/binutils/gas/config/te-multi.h
+fsf/binutils/gas/config/te-nbsd.h
+fsf/binutils/gas/config/te-nbsd532.h
+fsf/binutils/gas/config/te-pc532mach.h
+fsf/binutils/gas/config/te-pe.h
+fsf/binutils/gas/config/te-ppcnw.h
+fsf/binutils/gas/config/te-psos.h
+fsf/binutils/gas/config/te-riscix.h
+fsf/binutils/gas/config/te-sparcaout.h
+fsf/binutils/gas/config/te-sun3.h
+fsf/binutils/gas/config/te-svr4.h
+fsf/binutils/gas/config/te-sysv32.h
+fsf/binutils/gas/config/vax-inst.h
+fsf/binutils/gas/config/vms-a-conf.h
+fsf/binutils/gas/config/vms-conf.h
+fsf/binutils/gas/configure
+fsf/binutils/gas/configure.bat
+fsf/binutils/gas/configure.in
+fsf/binutils/gas/debug.c
+fsf/binutils/gas/dep-in.sed
+fsf/binutils/gas/depend.c
+fsf/binutils/gas/doc/Makefile.am
+fsf/binutils/gas/doc/Makefile.in
+fsf/binutils/gas/doc/all.texi
+fsf/binutils/gas/doc/as.1
+fsf/binutils/gas/doc/as.texinfo
+fsf/binutils/gas/doc/c-a29k.texi
+fsf/binutils/gas/doc/c-arm.texi
+fsf/binutils/gas/doc/c-d10v.texi
+fsf/binutils/gas/doc/c-h8300.texi
+fsf/binutils/gas/doc/c-h8500.texi
+fsf/binutils/gas/doc/c-hppa.texi
+fsf/binutils/gas/doc/c-i386.texi
+fsf/binutils/gas/doc/c-i960.texi
+fsf/binutils/gas/doc/c-m32r.texi
+fsf/binutils/gas/doc/c-m68k.texi
+fsf/binutils/gas/doc/c-mips.texi
+fsf/binutils/gas/doc/c-ns32k.texi
+fsf/binutils/gas/doc/c-sh.texi
+fsf/binutils/gas/doc/c-sparc.texi
+fsf/binutils/gas/doc/c-v850.texi
+fsf/binutils/gas/doc/c-vax.texi
+fsf/binutils/gas/doc/c-z8k.texi
+fsf/binutils/gas/doc/gasp.texi
+fsf/binutils/gas/doc/h8.texi
+fsf/binutils/gas/doc/internals.texi
+fsf/binutils/gas/ecoff.c
+fsf/binutils/gas/ecoff.h
+fsf/binutils/gas/ehopt.c
+fsf/binutils/gas/emul-target.h
+fsf/binutils/gas/emul.h
+fsf/binutils/gas/expr.c
+fsf/binutils/gas/expr.h
+fsf/binutils/gas/flonum-copy.c
+fsf/binutils/gas/flonum-konst.c
+fsf/binutils/gas/flonum-mult.c
+fsf/binutils/gas/flonum.h
+fsf/binutils/gas/frags.c
+fsf/binutils/gas/frags.h
+fsf/binutils/gas/gasp.c
+fsf/binutils/gas/gdbinit.in
+fsf/binutils/gas/hash.c
+fsf/binutils/gas/hash.h
+fsf/binutils/gas/input-file.c
+fsf/binutils/gas/input-file.h
+fsf/binutils/gas/input-scrub.c
+fsf/binutils/gas/itbl-lex.c
+fsf/binutils/gas/itbl-lex.l
+fsf/binutils/gas/itbl-ops.c
+fsf/binutils/gas/itbl-ops.h
+fsf/binutils/gas/itbl-parse.c
+fsf/binutils/gas/itbl-parse.h
+fsf/binutils/gas/itbl-parse.y
+fsf/binutils/gas/link.cmd
+fsf/binutils/gas/listing.c
+fsf/binutils/gas/listing.h
+fsf/binutils/gas/literal.c
+fsf/binutils/gas/mac-as.r
+fsf/binutils/gas/macro.c
+fsf/binutils/gas/macro.h
+fsf/binutils/gas/make-gas.com
+fsf/binutils/gas/makefile.vms
+fsf/binutils/gas/messages.c
+fsf/binutils/gas/mpw-config.in
+fsf/binutils/gas/mpw-make.sed
+fsf/binutils/gas/obj.h
+fsf/binutils/gas/output-file.c
+fsf/binutils/gas/output-file.h
+fsf/binutils/gas/read.c
+fsf/binutils/gas/read.h
+fsf/binutils/gas/sb.c
+fsf/binutils/gas/sb.h
+fsf/binutils/gas/stabs.c
+fsf/binutils/gas/stamp-h.in
+fsf/binutils/gas/struc-symbol.h
+fsf/binutils/gas/subsegs.c
+fsf/binutils/gas/subsegs.h
+fsf/binutils/gas/symbols.c
+fsf/binutils/gas/symbols.h
+fsf/binutils/gas/tc.h
+fsf/binutils/gas/testsuite/ChangeLog
+fsf/binutils/gas/testsuite/config/default.exp
+fsf/binutils/gas/testsuite/gas/all/align.d
+fsf/binutils/gas/testsuite/gas/all/align.s
+fsf/binutils/gas/testsuite/gas/all/cofftag.d
+fsf/binutils/gas/testsuite/gas/all/cofftag.s
+fsf/binutils/gas/testsuite/gas/all/comment.s
+fsf/binutils/gas/testsuite/gas/all/cond.d
+fsf/binutils/gas/testsuite/gas/all/cond.s
+fsf/binutils/gas/testsuite/gas/all/diff1.s
+fsf/binutils/gas/testsuite/gas/all/float.s
+fsf/binutils/gas/testsuite/gas/all/gas.exp
+fsf/binutils/gas/testsuite/gas/all/itbl
+fsf/binutils/gas/testsuite/gas/all/itbl-test.c
+fsf/binutils/gas/testsuite/gas/all/itbl.s
+fsf/binutils/gas/testsuite/gas/all/p1480.s
+fsf/binutils/gas/testsuite/gas/all/p2425.s
+fsf/binutils/gas/testsuite/gas/all/struct.d
+fsf/binutils/gas/testsuite/gas/all/struct.s
+fsf/binutils/gas/testsuite/gas/all/x930509.s
+fsf/binutils/gas/testsuite/gas/alpha/fp.d
+fsf/binutils/gas/testsuite/gas/alpha/fp.exp
+fsf/binutils/gas/testsuite/gas/alpha/fp.s
+fsf/binutils/gas/testsuite/gas/arc/alias.d
+fsf/binutils/gas/testsuite/gas/arc/alias.s
+fsf/binutils/gas/testsuite/gas/arc/arc.exp
+fsf/binutils/gas/testsuite/gas/arc/branch.d
+fsf/binutils/gas/testsuite/gas/arc/branch.s
+fsf/binutils/gas/testsuite/gas/arc/flag.d
+fsf/binutils/gas/testsuite/gas/arc/flag.s
+fsf/binutils/gas/testsuite/gas/arc/insn3.d
+fsf/binutils/gas/testsuite/gas/arc/insn3.s
+fsf/binutils/gas/testsuite/gas/arc/j.d
+fsf/binutils/gas/testsuite/gas/arc/j.s
+fsf/binutils/gas/testsuite/gas/arc/ld.d
+fsf/binutils/gas/testsuite/gas/arc/ld.s
+fsf/binutils/gas/testsuite/gas/arc/math.d
+fsf/binutils/gas/testsuite/gas/arc/math.s
+fsf/binutils/gas/testsuite/gas/arc/sshift.d
+fsf/binutils/gas/testsuite/gas/arc/sshift.s
+fsf/binutils/gas/testsuite/gas/arc/st.d
+fsf/binutils/gas/testsuite/gas/arc/st.s
+fsf/binutils/gas/testsuite/gas/arc/warn.exp
+fsf/binutils/gas/testsuite/gas/arc/warn.s
+fsf/binutils/gas/testsuite/gas/arm/arch4t.s
+fsf/binutils/gas/testsuite/gas/arm/arm.exp
+fsf/binutils/gas/testsuite/gas/arm/arm3.s
+fsf/binutils/gas/testsuite/gas/arm/arm6.s
+fsf/binutils/gas/testsuite/gas/arm/arm7dm.s
+fsf/binutils/gas/testsuite/gas/arm/arm7t.d
+fsf/binutils/gas/testsuite/gas/arm/arm7t.s
+fsf/binutils/gas/testsuite/gas/arm/copro.s
+fsf/binutils/gas/testsuite/gas/arm/float.s
+fsf/binutils/gas/testsuite/gas/arm/immed.s
+fsf/binutils/gas/testsuite/gas/arm/inst.d
+fsf/binutils/gas/testsuite/gas/arm/inst.s
+fsf/binutils/gas/testsuite/gas/arm/le-fpconst.d
+fsf/binutils/gas/testsuite/gas/arm/le-fpconst.s
+fsf/binutils/gas/testsuite/gas/arm/thumb.s
+fsf/binutils/gas/testsuite/gas/h8300/addsub.s
+fsf/binutils/gas/testsuite/gas/h8300/addsubh.s
+fsf/binutils/gas/testsuite/gas/h8300/addsubs.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops1.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops1h.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops1s.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops2.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops2h.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops2s.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops3.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops3h.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops3s.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops4.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops4h.s
+fsf/binutils/gas/testsuite/gas/h8300/bitops4s.s
+fsf/binutils/gas/testsuite/gas/h8300/branch.s
+fsf/binutils/gas/testsuite/gas/h8300/branchh.s
+fsf/binutils/gas/testsuite/gas/h8300/branchs.s
+fsf/binutils/gas/testsuite/gas/h8300/cbranch.s
+fsf/binutils/gas/testsuite/gas/h8300/cbranchh.s
+fsf/binutils/gas/testsuite/gas/h8300/cbranchs.s
+fsf/binutils/gas/testsuite/gas/h8300/cmpsi2.s
+fsf/binutils/gas/testsuite/gas/h8300/compare.s
+fsf/binutils/gas/testsuite/gas/h8300/compareh.s
+fsf/binutils/gas/testsuite/gas/h8300/compares.s
+fsf/binutils/gas/testsuite/gas/h8300/decimal.s
+fsf/binutils/gas/testsuite/gas/h8300/decimalh.s
+fsf/binutils/gas/testsuite/gas/h8300/decimals.s
+fsf/binutils/gas/testsuite/gas/h8300/divmul.s
+fsf/binutils/gas/testsuite/gas/h8300/divmulh.s
+fsf/binutils/gas/testsuite/gas/h8300/divmuls.s
+fsf/binutils/gas/testsuite/gas/h8300/extendh.s
+fsf/binutils/gas/testsuite/gas/h8300/extends.s
+fsf/binutils/gas/testsuite/gas/h8300/ffxx1.d
+fsf/binutils/gas/testsuite/gas/h8300/ffxx1.s
+fsf/binutils/gas/testsuite/gas/h8300/h8300.exp
+fsf/binutils/gas/testsuite/gas/h8300/incdec.s
+fsf/binutils/gas/testsuite/gas/h8300/incdech.s
+fsf/binutils/gas/testsuite/gas/h8300/incdecs.s
+fsf/binutils/gas/testsuite/gas/h8300/logical.s
+fsf/binutils/gas/testsuite/gas/h8300/logicalh.s
+fsf/binutils/gas/testsuite/gas/h8300/logicals.s
+fsf/binutils/gas/testsuite/gas/h8300/macs.s
+fsf/binutils/gas/testsuite/gas/h8300/misc.s
+fsf/binutils/gas/testsuite/gas/h8300/misch.s
+fsf/binutils/gas/testsuite/gas/h8300/miscs.s
+fsf/binutils/gas/testsuite/gas/h8300/mov32bug.s
+fsf/binutils/gas/testsuite/gas/h8300/movb.s
+fsf/binutils/gas/testsuite/gas/h8300/movbh.s
+fsf/binutils/gas/testsuite/gas/h8300/movbs.s
+fsf/binutils/gas/testsuite/gas/h8300/movlh.s
+fsf/binutils/gas/testsuite/gas/h8300/movls.s
+fsf/binutils/gas/testsuite/gas/h8300/movw.s
+fsf/binutils/gas/testsuite/gas/h8300/movwh.s
+fsf/binutils/gas/testsuite/gas/h8300/movws.s
+fsf/binutils/gas/testsuite/gas/h8300/multiples.s
+fsf/binutils/gas/testsuite/gas/h8300/pushpop.s
+fsf/binutils/gas/testsuite/gas/h8300/pushpoph.s
+fsf/binutils/gas/testsuite/gas/h8300/pushpops.s
+fsf/binutils/gas/testsuite/gas/h8300/rotsh.s
+fsf/binutils/gas/testsuite/gas/h8300/rotshh.s
+fsf/binutils/gas/testsuite/gas/h8300/rotshs.s
+fsf/binutils/gas/testsuite/gas/hppa/README
+fsf/binutils/gas/testsuite/gas/hppa/basic/add.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/addi.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/basic.exp
+fsf/binutils/gas/testsuite/gas/hppa/basic/branch.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/comclr.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/copr.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/coprmem.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/dcor.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/deposit.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/ds.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/extract.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fmem.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fmemLRbug.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fp_comp.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fp_conv.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fp_fcmp.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/fp_misc.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/imem.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/immed.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/logical.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/purge.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/sh1add.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/sh2add.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/sh3add.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/shift.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/special.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/spop.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/sub.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/subi.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/system.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/unit.s
+fsf/binutils/gas/testsuite/gas/hppa/basic/weird.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/align1.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/align2.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/appbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/badfmpyadd.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/block1.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/block2.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/calldatabug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/callinfobug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/defbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/entrybug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/exportbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/exprbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/fixup7bug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/global.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/labelbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/linesepbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/lselbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/nosubspace.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/parse.exp
+fsf/binutils/gas/testsuite/gas/hppa/parse/procbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/regpopbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/spacebug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/ssbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/stdreg.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/stringer.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/undefbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/versionbug.s
+fsf/binutils/gas/testsuite/gas/hppa/parse/xmpyubug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/applybug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/blebug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/blebug2.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/blebug3.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/exitbug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/fixupbug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/funcrelocbug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/labelopbug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/longcall.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/picreloc.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/plabelbug.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/r_no_reloc.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/reduce.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/reduce2.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/reduce3.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/reloc.exp
+fsf/binutils/gas/testsuite/gas/hppa/reloc/roundmode.s
+fsf/binutils/gas/testsuite/gas/hppa/reloc/selectorbug.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/align3.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/align4.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/brlenbug.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/common.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/fragbug.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/globalbug.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/importbug.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/labeldiffs.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/locallabel.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/ss_align.s
+fsf/binutils/gas/testsuite/gas/hppa/unsorted/unsorted.exp
+fsf/binutils/gas/testsuite/gas/i386/all.exp
+fsf/binutils/gas/testsuite/gas/i386/inout.s
+fsf/binutils/gas/testsuite/gas/i386/pushw.l
+fsf/binutils/gas/testsuite/gas/i386/pushw.s
+fsf/binutils/gas/testsuite/gas/ieee-fp/x930509a.exp
+fsf/binutils/gas/testsuite/gas/ieee-fp/x930509a.s
+fsf/binutils/gas/testsuite/gas/m32r/allinsn.d
+fsf/binutils/gas/testsuite/gas/m32r/allinsn.exp
+fsf/binutils/gas/testsuite/gas/m32r/allinsn.s
+fsf/binutils/gas/testsuite/gas/m32r/high-1.d
+fsf/binutils/gas/testsuite/gas/m32r/high-1.s
+fsf/binutils/gas/testsuite/gas/m32r/m32r.exp
+fsf/binutils/gas/testsuite/gas/m32r/relax-1.d
+fsf/binutils/gas/testsuite/gas/m32r/relax-1.s
+fsf/binutils/gas/testsuite/gas/m32r/uppercase.d
+fsf/binutils/gas/testsuite/gas/m32r/uppercase.s
+fsf/binutils/gas/testsuite/gas/m68k-coff/gas.exp
+fsf/binutils/gas/testsuite/gas/m68k-coff/p2389.s
+fsf/binutils/gas/testsuite/gas/m68k-coff/p2389a.s
+fsf/binutils/gas/testsuite/gas/m68k-coff/p2430.s
+fsf/binutils/gas/testsuite/gas/m68k-coff/p2430a.s
+fsf/binutils/gas/testsuite/gas/m68k-coff/t1.s
+fsf/binutils/gas/testsuite/gas/m68k/all.exp
+fsf/binutils/gas/testsuite/gas/m68k/bitfield.d
+fsf/binutils/gas/testsuite/gas/m68k/bitfield.s
+fsf/binutils/gas/testsuite/gas/m68k/cas.d
+fsf/binutils/gas/testsuite/gas/m68k/cas.s
+fsf/binutils/gas/testsuite/gas/m68k/disperr.s
+fsf/binutils/gas/testsuite/gas/m68k/fmoveml.d
+fsf/binutils/gas/testsuite/gas/m68k/fmoveml.s
+fsf/binutils/gas/testsuite/gas/m68k/link.d
+fsf/binutils/gas/testsuite/gas/m68k/link.s
+fsf/binutils/gas/testsuite/gas/m68k/op68000.d
+fsf/binutils/gas/testsuite/gas/m68k/operands.d
+fsf/binutils/gas/testsuite/gas/m68k/operands.s
+fsf/binutils/gas/testsuite/gas/m68k/p2410.s
+fsf/binutils/gas/testsuite/gas/m68k/p2663.s
+fsf/binutils/gas/testsuite/gas/m68k/pcrel.d
+fsf/binutils/gas/testsuite/gas/m68k/pcrel.s
+fsf/binutils/gas/testsuite/gas/m68k/pic1.s
+fsf/binutils/gas/testsuite/gas/m68k/t2.d
+fsf/binutils/gas/testsuite/gas/m68k/t2.s
+fsf/binutils/gas/testsuite/gas/m88k/init.d
+fsf/binutils/gas/testsuite/gas/m88k/init.s
+fsf/binutils/gas/testsuite/gas/m88k/m88k.exp
+fsf/binutils/gas/testsuite/gas/macros/err.s
+fsf/binutils/gas/testsuite/gas/macros/irp.d
+fsf/binutils/gas/testsuite/gas/macros/irp.s
+fsf/binutils/gas/testsuite/gas/macros/macros.exp
+fsf/binutils/gas/testsuite/gas/macros/rept.d
+fsf/binutils/gas/testsuite/gas/macros/rept.s
+fsf/binutils/gas/testsuite/gas/macros/semi.d
+fsf/binutils/gas/testsuite/gas/macros/semi.s
+fsf/binutils/gas/testsuite/gas/macros/test1.d
+fsf/binutils/gas/testsuite/gas/macros/test1.s
+fsf/binutils/gas/testsuite/gas/macros/test2.d
+fsf/binutils/gas/testsuite/gas/macros/test2.s
+fsf/binutils/gas/testsuite/gas/macros/test3.d
+fsf/binutils/gas/testsuite/gas/macros/test3.s
+fsf/binutils/gas/testsuite/gas/mips/abs.d
+fsf/binutils/gas/testsuite/gas/mips/abs.s
+fsf/binutils/gas/testsuite/gas/mips/add.d
+fsf/binutils/gas/testsuite/gas/mips/add.s
+fsf/binutils/gas/testsuite/gas/mips/and.d
+fsf/binutils/gas/testsuite/gas/mips/and.s
+fsf/binutils/gas/testsuite/gas/mips/beq.d
+fsf/binutils/gas/testsuite/gas/mips/beq.s
+fsf/binutils/gas/testsuite/gas/mips/bge.d
+fsf/binutils/gas/testsuite/gas/mips/bge.s
+fsf/binutils/gas/testsuite/gas/mips/bgeu.d
+fsf/binutils/gas/testsuite/gas/mips/bgeu.s
+fsf/binutils/gas/testsuite/gas/mips/blt.d
+fsf/binutils/gas/testsuite/gas/mips/blt.s
+fsf/binutils/gas/testsuite/gas/mips/bltu.d
+fsf/binutils/gas/testsuite/gas/mips/bltu.s
+fsf/binutils/gas/testsuite/gas/mips/delay.d
+fsf/binutils/gas/testsuite/gas/mips/delay.s
+fsf/binutils/gas/testsuite/gas/mips/div-ilocks.d
+fsf/binutils/gas/testsuite/gas/mips/div.d
+fsf/binutils/gas/testsuite/gas/mips/div.s
+fsf/binutils/gas/testsuite/gas/mips/dli.d
+fsf/binutils/gas/testsuite/gas/mips/dli.s
+fsf/binutils/gas/testsuite/gas/mips/itbl
+fsf/binutils/gas/testsuite/gas/mips/itbl.s
+fsf/binutils/gas/testsuite/gas/mips/jal-empic.d
+fsf/binutils/gas/testsuite/gas/mips/jal-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/jal-svr4pic.s
+fsf/binutils/gas/testsuite/gas/mips/jal-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/jal.d
+fsf/binutils/gas/testsuite/gas/mips/jal.s
+fsf/binutils/gas/testsuite/gas/mips/la-empic.d
+fsf/binutils/gas/testsuite/gas/mips/la-empic.s
+fsf/binutils/gas/testsuite/gas/mips/la-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/la-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/la.d
+fsf/binutils/gas/testsuite/gas/mips/la.s
+fsf/binutils/gas/testsuite/gas/mips/lb-empic.d
+fsf/binutils/gas/testsuite/gas/mips/lb-pic.s
+fsf/binutils/gas/testsuite/gas/mips/lb-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/lb-xgot-ilocks.d
+fsf/binutils/gas/testsuite/gas/mips/lb-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/lb.d
+fsf/binutils/gas/testsuite/gas/mips/lb.s
+fsf/binutils/gas/testsuite/gas/mips/ld-empic.d
+fsf/binutils/gas/testsuite/gas/mips/ld-ilocks.d
+fsf/binutils/gas/testsuite/gas/mips/ld-pic.s
+fsf/binutils/gas/testsuite/gas/mips/ld-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/ld-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/ld.d
+fsf/binutils/gas/testsuite/gas/mips/ld.s
+fsf/binutils/gas/testsuite/gas/mips/li.d
+fsf/binutils/gas/testsuite/gas/mips/li.s
+fsf/binutils/gas/testsuite/gas/mips/lif-empic.d
+fsf/binutils/gas/testsuite/gas/mips/lif-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/lif-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/lifloat.d
+fsf/binutils/gas/testsuite/gas/mips/lifloat.s
+fsf/binutils/gas/testsuite/gas/mips/mips.exp
+fsf/binutils/gas/testsuite/gas/mips/mips16.d
+fsf/binutils/gas/testsuite/gas/mips/mips16.s
+fsf/binutils/gas/testsuite/gas/mips/mips4.d
+fsf/binutils/gas/testsuite/gas/mips/mips4.s
+fsf/binutils/gas/testsuite/gas/mips/mips4010.d
+fsf/binutils/gas/testsuite/gas/mips/mips4010.s
+fsf/binutils/gas/testsuite/gas/mips/mips4100.d
+fsf/binutils/gas/testsuite/gas/mips/mips4100.s
+fsf/binutils/gas/testsuite/gas/mips/mips4650.d
+fsf/binutils/gas/testsuite/gas/mips/mips4650.s
+fsf/binutils/gas/testsuite/gas/mips/mul-ilocks.d
+fsf/binutils/gas/testsuite/gas/mips/mul.d
+fsf/binutils/gas/testsuite/gas/mips/mul.s
+fsf/binutils/gas/testsuite/gas/mips/nodelay.d
+fsf/binutils/gas/testsuite/gas/mips/rol.d
+fsf/binutils/gas/testsuite/gas/mips/rol.s
+fsf/binutils/gas/testsuite/gas/mips/sb.d
+fsf/binutils/gas/testsuite/gas/mips/sb.s
+fsf/binutils/gas/testsuite/gas/mips/trunc.d
+fsf/binutils/gas/testsuite/gas/mips/trunc.s
+fsf/binutils/gas/testsuite/gas/mips/uld.d
+fsf/binutils/gas/testsuite/gas/mips/uld.s
+fsf/binutils/gas/testsuite/gas/mips/ulh-empic.d
+fsf/binutils/gas/testsuite/gas/mips/ulh-pic.s
+fsf/binutils/gas/testsuite/gas/mips/ulh-svr4pic.d
+fsf/binutils/gas/testsuite/gas/mips/ulh-xgot.d
+fsf/binutils/gas/testsuite/gas/mips/ulh.d
+fsf/binutils/gas/testsuite/gas/mips/ulh.s
+fsf/binutils/gas/testsuite/gas/mips/ulw.d
+fsf/binutils/gas/testsuite/gas/mips/ulw.s
+fsf/binutils/gas/testsuite/gas/mips/usd.d
+fsf/binutils/gas/testsuite/gas/mips/usd.s
+fsf/binutils/gas/testsuite/gas/mips/ush.d
+fsf/binutils/gas/testsuite/gas/mips/ush.s
+fsf/binutils/gas/testsuite/gas/mips/usw.d
+fsf/binutils/gas/testsuite/gas/mips/usw.s
+fsf/binutils/gas/testsuite/gas/mn10200/add.s
+fsf/binutils/gas/testsuite/gas/mn10200/basic.exp
+fsf/binutils/gas/testsuite/gas/mn10200/bcc.s
+fsf/binutils/gas/testsuite/gas/mn10200/bccx.s
+fsf/binutils/gas/testsuite/gas/mn10200/bit.s
+fsf/binutils/gas/testsuite/gas/mn10200/cmp.s
+fsf/binutils/gas/testsuite/gas/mn10200/ext.s
+fsf/binutils/gas/testsuite/gas/mn10200/logical.s
+fsf/binutils/gas/testsuite/gas/mn10200/mov1.s
+fsf/binutils/gas/testsuite/gas/mn10200/mov2.s
+fsf/binutils/gas/testsuite/gas/mn10200/mov3.s
+fsf/binutils/gas/testsuite/gas/mn10200/mov4.s
+fsf/binutils/gas/testsuite/gas/mn10200/movb.s
+fsf/binutils/gas/testsuite/gas/mn10200/movbu.s
+fsf/binutils/gas/testsuite/gas/mn10200/movx.s
+fsf/binutils/gas/testsuite/gas/mn10200/muldiv.s
+fsf/binutils/gas/testsuite/gas/mn10200/other.s
+fsf/binutils/gas/testsuite/gas/mn10200/shift.s
+fsf/binutils/gas/testsuite/gas/mn10200/sub.s
+fsf/binutils/gas/testsuite/gas/mn10300/add.s
+fsf/binutils/gas/testsuite/gas/mn10300/basic.exp
+fsf/binutils/gas/testsuite/gas/mn10300/bcc.s
+fsf/binutils/gas/testsuite/gas/mn10300/bit.s
+fsf/binutils/gas/testsuite/gas/mn10300/cmp.s
+fsf/binutils/gas/testsuite/gas/mn10300/ext.s
+fsf/binutils/gas/testsuite/gas/mn10300/extend.s
+fsf/binutils/gas/testsuite/gas/mn10300/logical.s
+fsf/binutils/gas/testsuite/gas/mn10300/loop.s
+fsf/binutils/gas/testsuite/gas/mn10300/mov1.s
+fsf/binutils/gas/testsuite/gas/mn10300/mov2.s
+fsf/binutils/gas/testsuite/gas/mn10300/mov3.s
+fsf/binutils/gas/testsuite/gas/mn10300/mov4.s
+fsf/binutils/gas/testsuite/gas/mn10300/movbu.s
+fsf/binutils/gas/testsuite/gas/mn10300/movhu.s
+fsf/binutils/gas/testsuite/gas/mn10300/movm.s
+fsf/binutils/gas/testsuite/gas/mn10300/muldiv.s
+fsf/binutils/gas/testsuite/gas/mn10300/other.s
+fsf/binutils/gas/testsuite/gas/mn10300/shift.s
+fsf/binutils/gas/testsuite/gas/mn10300/sub.s
+fsf/binutils/gas/testsuite/gas/mri/char.d
+fsf/binutils/gas/testsuite/gas/mri/char.s
+fsf/binutils/gas/testsuite/gas/mri/comment.d
+fsf/binutils/gas/testsuite/gas/mri/comment.s
+fsf/binutils/gas/testsuite/gas/mri/common.d
+fsf/binutils/gas/testsuite/gas/mri/common.s
+fsf/binutils/gas/testsuite/gas/mri/constants.d
+fsf/binutils/gas/testsuite/gas/mri/constants.s
+fsf/binutils/gas/testsuite/gas/mri/empty.s
+fsf/binutils/gas/testsuite/gas/mri/equ.d
+fsf/binutils/gas/testsuite/gas/mri/equ.s
+fsf/binutils/gas/testsuite/gas/mri/expr.d
+fsf/binutils/gas/testsuite/gas/mri/expr.s
+fsf/binutils/gas/testsuite/gas/mri/float.d
+fsf/binutils/gas/testsuite/gas/mri/float.s
+fsf/binutils/gas/testsuite/gas/mri/for.d
+fsf/binutils/gas/testsuite/gas/mri/for.s
+fsf/binutils/gas/testsuite/gas/mri/if.d
+fsf/binutils/gas/testsuite/gas/mri/if.s
+fsf/binutils/gas/testsuite/gas/mri/immconst.d
+fsf/binutils/gas/testsuite/gas/mri/label.d
+fsf/binutils/gas/testsuite/gas/mri/label.s
+fsf/binutils/gas/testsuite/gas/mri/moveml.d
+fsf/binutils/gas/testsuite/gas/mri/moveml.s
+fsf/binutils/gas/testsuite/gas/mri/mri.exp
+fsf/binutils/gas/testsuite/gas/mri/repeat.d
+fsf/binutils/gas/testsuite/gas/mri/repeat.s
+fsf/binutils/gas/testsuite/gas/mri/semi.d
+fsf/binutils/gas/testsuite/gas/mri/semi.s
+fsf/binutils/gas/testsuite/gas/mri/while.d
+fsf/binutils/gas/testsuite/gas/mri/while.s
+fsf/binutils/gas/testsuite/gas/ppc/astest.d
+fsf/binutils/gas/testsuite/gas/ppc/astest.s
+fsf/binutils/gas/testsuite/gas/ppc/astest2.d
+fsf/binutils/gas/testsuite/gas/ppc/astest2.s
+fsf/binutils/gas/testsuite/gas/ppc/ppc.exp
+fsf/binutils/gas/testsuite/gas/sh/basic.exp
+fsf/binutils/gas/testsuite/gas/sh/fp.s
+fsf/binutils/gas/testsuite/gas/sparc-solaris/addend.exp
+fsf/binutils/gas/testsuite/gas/sparc-solaris/addend.s
+fsf/binutils/gas/testsuite/gas/sparc-solaris/gas.exp
+fsf/binutils/gas/testsuite/gas/sparc-solaris/sol-cc.s
+fsf/binutils/gas/testsuite/gas/sparc-solaris/sol-gcc.s
+fsf/binutils/gas/testsuite/gas/sparc/asi.d
+fsf/binutils/gas/testsuite/gas/sparc/asi.s
+fsf/binutils/gas/testsuite/gas/sparc/membar.d
+fsf/binutils/gas/testsuite/gas/sparc/membar.s
+fsf/binutils/gas/testsuite/gas/sparc/mism-1.s
+fsf/binutils/gas/testsuite/gas/sparc/mismatch.exp
+fsf/binutils/gas/testsuite/gas/sparc/prefetch.d
+fsf/binutils/gas/testsuite/gas/sparc/prefetch.s
+fsf/binutils/gas/testsuite/gas/sparc/rdpr.d
+fsf/binutils/gas/testsuite/gas/sparc/rdpr.s
+fsf/binutils/gas/testsuite/gas/sparc/reloc64.d
+fsf/binutils/gas/testsuite/gas/sparc/reloc64.s
+fsf/binutils/gas/testsuite/gas/sparc/set64.d
+fsf/binutils/gas/testsuite/gas/sparc/set64.s
+fsf/binutils/gas/testsuite/gas/sparc/sparc.exp
+fsf/binutils/gas/testsuite/gas/sparc/splet-2.d
+fsf/binutils/gas/testsuite/gas/sparc/splet-2.s
+fsf/binutils/gas/testsuite/gas/sparc/splet.d
+fsf/binutils/gas/testsuite/gas/sparc/splet.s
+fsf/binutils/gas/testsuite/gas/sparc/synth.d
+fsf/binutils/gas/testsuite/gas/sparc/synth.s
+fsf/binutils/gas/testsuite/gas/sparc/synth64.d
+fsf/binutils/gas/testsuite/gas/sparc/synth64.s
+fsf/binutils/gas/testsuite/gas/sparc/wrpr.d
+fsf/binutils/gas/testsuite/gas/sparc/wrpr.s
+fsf/binutils/gas/testsuite/gas/sun4/addend.d
+fsf/binutils/gas/testsuite/gas/sun4/addend.exp
+fsf/binutils/gas/testsuite/gas/sun4/addend.s
+fsf/binutils/gas/testsuite/gas/template
+fsf/binutils/gas/testsuite/gas/v850/arith.s
+fsf/binutils/gas/testsuite/gas/v850/basic.exp
+fsf/binutils/gas/testsuite/gas/v850/bit.s
+fsf/binutils/gas/testsuite/gas/v850/branch.s
+fsf/binutils/gas/testsuite/gas/v850/compare.s
+fsf/binutils/gas/testsuite/gas/v850/fepsw.s
+fsf/binutils/gas/testsuite/gas/v850/hilo.s
+fsf/binutils/gas/testsuite/gas/v850/hilo2.s
+fsf/binutils/gas/testsuite/gas/v850/jumps.s
+fsf/binutils/gas/testsuite/gas/v850/logical.s
+fsf/binutils/gas/testsuite/gas/v850/mem.s
+fsf/binutils/gas/testsuite/gas/v850/misc.s
+fsf/binutils/gas/testsuite/gas/v850/move.s
+fsf/binutils/gas/testsuite/gas/v850/range.s
+fsf/binutils/gas/testsuite/gas/v850/reloc.s
+fsf/binutils/gas/testsuite/gas/vax/quad.exp
+fsf/binutils/gas/testsuite/gas/vax/quad.s
+fsf/binutils/gas/testsuite/gasp/INC1.H
+fsf/binutils/gas/testsuite/gasp/INC2.H
+fsf/binutils/gas/testsuite/gasp/assign.asm
+fsf/binutils/gas/testsuite/gasp/assign.err
+fsf/binutils/gas/testsuite/gasp/assign.out
+fsf/binutils/gas/testsuite/gasp/condass.asm
+fsf/binutils/gas/testsuite/gasp/condass.err
+fsf/binutils/gas/testsuite/gasp/condass.out
+fsf/binutils/gas/testsuite/gasp/crash.asm
+fsf/binutils/gas/testsuite/gasp/crash.err
+fsf/binutils/gas/testsuite/gasp/crash.out
+fsf/binutils/gas/testsuite/gasp/crash1.asm
+fsf/binutils/gas/testsuite/gasp/crash1.err
+fsf/binutils/gas/testsuite/gasp/crash1.out
+fsf/binutils/gas/testsuite/gasp/crash2.asm
+fsf/binutils/gas/testsuite/gasp/crash2.err
+fsf/binutils/gas/testsuite/gasp/crash2.out
+fsf/binutils/gas/testsuite/gasp/data.asm
+fsf/binutils/gas/testsuite/gasp/data.err
+fsf/binutils/gas/testsuite/gasp/data.out
+fsf/binutils/gas/testsuite/gasp/exp.asm
+fsf/binutils/gas/testsuite/gasp/exp.err
+fsf/binutils/gas/testsuite/gasp/exp.out
+fsf/binutils/gas/testsuite/gasp/gasp.exp
+fsf/binutils/gas/testsuite/gasp/include.asm
+fsf/binutils/gas/testsuite/gasp/include.err
+fsf/binutils/gas/testsuite/gasp/include.out
+fsf/binutils/gas/testsuite/gasp/listing.asm
+fsf/binutils/gas/testsuite/gasp/listing.err
+fsf/binutils/gas/testsuite/gasp/listing.out
+fsf/binutils/gas/testsuite/gasp/macro.asm
+fsf/binutils/gas/testsuite/gasp/macro.err
+fsf/binutils/gas/testsuite/gasp/macro.out
+fsf/binutils/gas/testsuite/gasp/mdouble.asm
+fsf/binutils/gas/testsuite/gasp/mdouble.err
+fsf/binutils/gas/testsuite/gasp/mdouble.out
+fsf/binutils/gas/testsuite/gasp/mri/embed.asm
+fsf/binutils/gas/testsuite/gasp/mri/embed.out
+fsf/binutils/gas/testsuite/gasp/mri/exists.asm
+fsf/binutils/gas/testsuite/gasp/mri/exists.out
+fsf/binutils/gas/testsuite/gasp/mri/irp.asm
+fsf/binutils/gas/testsuite/gasp/mri/irp.out
+fsf/binutils/gas/testsuite/gasp/mri/irpc.asm
+fsf/binutils/gas/testsuite/gasp/mri/irpc.out
+fsf/binutils/gas/testsuite/gasp/mri/macro.asm
+fsf/binutils/gas/testsuite/gasp/mri/macro.out
+fsf/binutils/gas/testsuite/gasp/mri/narg.asm
+fsf/binutils/gas/testsuite/gasp/mri/narg.out
+fsf/binutils/gas/testsuite/gasp/mri/rept.asm
+fsf/binutils/gas/testsuite/gasp/mri/rept.out
+fsf/binutils/gas/testsuite/gasp/pl1.asm
+fsf/binutils/gas/testsuite/gasp/pl1.err
+fsf/binutils/gas/testsuite/gasp/pl1.out
+fsf/binutils/gas/testsuite/gasp/pl2.asm
+fsf/binutils/gas/testsuite/gasp/pl2.err
+fsf/binutils/gas/testsuite/gasp/pl2.out
+fsf/binutils/gas/testsuite/gasp/pl3.asm
+fsf/binutils/gas/testsuite/gasp/pl3.err
+fsf/binutils/gas/testsuite/gasp/pl3.out
+fsf/binutils/gas/testsuite/gasp/pl4.asm
+fsf/binutils/gas/testsuite/gasp/pl4.err
+fsf/binutils/gas/testsuite/gasp/pl4.out
+fsf/binutils/gas/testsuite/gasp/pl5.asm
+fsf/binutils/gas/testsuite/gasp/pl5.err
+fsf/binutils/gas/testsuite/gasp/pl5.out
+fsf/binutils/gas/testsuite/gasp/pl6.asm
+fsf/binutils/gas/testsuite/gasp/pl6.err
+fsf/binutils/gas/testsuite/gasp/pl6.out
+fsf/binutils/gas/testsuite/gasp/pl7.asm
+fsf/binutils/gas/testsuite/gasp/pl7.err
+fsf/binutils/gas/testsuite/gasp/pl7.out
+fsf/binutils/gas/testsuite/gasp/pl8.asm
+fsf/binutils/gas/testsuite/gasp/pl8.err
+fsf/binutils/gas/testsuite/gasp/pl8.out
+fsf/binutils/gas/testsuite/gasp/pr7583.asm
+fsf/binutils/gas/testsuite/gasp/pr7583.err
+fsf/binutils/gas/testsuite/gasp/pr7583.out
+fsf/binutils/gas/testsuite/gasp/reg.asm
+fsf/binutils/gas/testsuite/gasp/reg.err
+fsf/binutils/gas/testsuite/gasp/reg.out
+fsf/binutils/gas/testsuite/gasp/rep.asm
+fsf/binutils/gas/testsuite/gasp/rep.err
+fsf/binutils/gas/testsuite/gasp/rep.out
+fsf/binutils/gas/testsuite/gasp/repeat.asm
+fsf/binutils/gas/testsuite/gasp/repeat.err
+fsf/binutils/gas/testsuite/gasp/repeat.out
+fsf/binutils/gas/testsuite/gasp/reperr.asm
+fsf/binutils/gas/testsuite/gasp/reperr.err
+fsf/binutils/gas/testsuite/gasp/reperr.out
+fsf/binutils/gas/testsuite/gasp/reperr1.asm
+fsf/binutils/gas/testsuite/gasp/reperr1.err
+fsf/binutils/gas/testsuite/gasp/reperr1.out
+fsf/binutils/gas/testsuite/gasp/reperr2.asm
+fsf/binutils/gas/testsuite/gasp/reperr2.err
+fsf/binutils/gas/testsuite/gasp/reperr2.out
+fsf/binutils/gas/testsuite/gasp/reperr3.asm
+fsf/binutils/gas/testsuite/gasp/reperr3.err
+fsf/binutils/gas/testsuite/gasp/reperr3.out
+fsf/binutils/gas/testsuite/gasp/sdata.asm
+fsf/binutils/gas/testsuite/gasp/sdata.err
+fsf/binutils/gas/testsuite/gasp/sdata.out
+fsf/binutils/gas/testsuite/gasp/sfunc.asm
+fsf/binutils/gas/testsuite/gasp/sfunc.err
+fsf/binutils/gas/testsuite/gasp/sfunc.out
+fsf/binutils/gas/testsuite/gasp/t1.asm
+fsf/binutils/gas/testsuite/gasp/t1.err
+fsf/binutils/gas/testsuite/gasp/t1.out
+fsf/binutils/gas/testsuite/gasp/t2.asm
+fsf/binutils/gas/testsuite/gasp/t2.err
+fsf/binutils/gas/testsuite/gasp/t2.out
+fsf/binutils/gas/testsuite/gasp/t3.asm
+fsf/binutils/gas/testsuite/gasp/t3.err
+fsf/binutils/gas/testsuite/gasp/t3.out
+fsf/binutils/gas/testsuite/gasp/while.asm
+fsf/binutils/gas/testsuite/gasp/while.err
+fsf/binutils/gas/testsuite/gasp/while.out
+fsf/binutils/gas/testsuite/lib/doboth
+fsf/binutils/gas/testsuite/lib/doobjcmp
+fsf/binutils/gas/testsuite/lib/dostriptest
+fsf/binutils/gas/testsuite/lib/dotest
+fsf/binutils/gas/testsuite/lib/dounsreloc
+fsf/binutils/gas/testsuite/lib/dounssym
+fsf/binutils/gas/testsuite/lib/gas-defs.exp
+fsf/binutils/gas/testsuite/lib/gas-dg.exp
+fsf/binutils/gas/testsuite/lib/run
+fsf/binutils/gas/vmsconf.sh
+fsf/binutils/gas/write.c
+fsf/binutils/gas/write.h
+fsf/binutils/gprof/.gdbinit
+fsf/binutils/gprof/ChangeLog
+fsf/binutils/gprof/Makefile.am
+fsf/binutils/gprof/Makefile.in
+fsf/binutils/gprof/NOTES
+fsf/binutils/gprof/TEST
+fsf/binutils/gprof/TODO
+fsf/binutils/gprof/acconfig.h
+fsf/binutils/gprof/aclocal.m4
+fsf/binutils/gprof/alpha.c
+fsf/binutils/gprof/basic_blocks.c
+fsf/binutils/gprof/basic_blocks.h
+fsf/binutils/gprof/bb_exit_func.c
+fsf/binutils/gprof/bbconv.pl
+fsf/binutils/gprof/bsd_callg_bl.m
+fsf/binutils/gprof/call_graph.c
+fsf/binutils/gprof/call_graph.h
+fsf/binutils/gprof/cg_arcs.c
+fsf/binutils/gprof/cg_arcs.h
+fsf/binutils/gprof/cg_dfn.c
+fsf/binutils/gprof/cg_dfn.h
+fsf/binutils/gprof/cg_print.c
+fsf/binutils/gprof/cg_print.h
+fsf/binutils/gprof/configure
+fsf/binutils/gprof/configure.bat
+fsf/binutils/gprof/configure.in
+fsf/binutils/gprof/core.c
+fsf/binutils/gprof/core.h
+fsf/binutils/gprof/flat_bl.c
+fsf/binutils/gprof/flat_bl.m
+fsf/binutils/gprof/fsf_callg_bl.m
+fsf/binutils/gprof/gconfig.in
+fsf/binutils/gprof/gen-c-prog.awk
+fsf/binutils/gprof/gmon.h
+fsf/binutils/gprof/gmon_io.c
+fsf/binutils/gprof/gmon_io.h
+fsf/binutils/gprof/gmon_out.h
+fsf/binutils/gprof/gprof.1
+fsf/binutils/gprof/gprof.c
+fsf/binutils/gprof/gprof.h
+fsf/binutils/gprof/gprof.info-1
+fsf/binutils/gprof/gprof.info-2
+fsf/binutils/gprof/gprof.texi
+fsf/binutils/gprof/hertz.c
+fsf/binutils/gprof/hertz.h
+fsf/binutils/gprof/hist.c
+fsf/binutils/gprof/hist.h
+fsf/binutils/gprof/i386.c
+fsf/binutils/gprof/search_list.c
+fsf/binutils/gprof/search_list.h
+fsf/binutils/gprof/source.c
+fsf/binutils/gprof/source.h
+fsf/binutils/gprof/sparc.c
+fsf/binutils/gprof/stamp-h.in
+fsf/binutils/gprof/sym_ids.c
+fsf/binutils/gprof/sym_ids.h
+fsf/binutils/gprof/symtab.c
+fsf/binutils/gprof/symtab.h
+fsf/binutils/gprof/tahoe.c
+fsf/binutils/gprof/utils.c
+fsf/binutils/gprof/utils.h
+fsf/binutils/gprof/vax.c
+fsf/binutils/include/COPYING
+fsf/binutils/include/ChangeLog
+fsf/binutils/include/ansidecl.h
+fsf/binutils/include/aout/ChangeLog
+fsf/binutils/include/aout/adobe.h
+fsf/binutils/include/aout/aout64.h
+fsf/binutils/include/aout/ar.h
+fsf/binutils/include/aout/dynix3.h
+fsf/binutils/include/aout/encap.h
+fsf/binutils/include/aout/host.h
+fsf/binutils/include/aout/hp.h
+fsf/binutils/include/aout/hp300hpux.h
+fsf/binutils/include/aout/hppa.h
+fsf/binutils/include/aout/ranlib.h
+fsf/binutils/include/aout/reloc.h
+fsf/binutils/include/aout/stab.def
+fsf/binutils/include/aout/stab_gnu.h
+fsf/binutils/include/aout/sun4.h
+fsf/binutils/include/bfdlink.h
+fsf/binutils/include/bout.h
+fsf/binutils/include/callback.h
+fsf/binutils/include/coff/ChangeLog
+fsf/binutils/include/coff/a29k.h
+fsf/binutils/include/coff/alpha.h
+fsf/binutils/include/coff/apollo.h
+fsf/binutils/include/coff/arm.h
+fsf/binutils/include/coff/aux-coff.h
+fsf/binutils/include/coff/ecoff.h
+fsf/binutils/include/coff/go32exe.h
+fsf/binutils/include/coff/h8300.h
+fsf/binutils/include/coff/h8500.h
+fsf/binutils/include/coff/i386.h
+fsf/binutils/include/coff/i860.h
+fsf/binutils/include/coff/i960.h
+fsf/binutils/include/coff/internal.h
+fsf/binutils/include/coff/m68k.h
+fsf/binutils/include/coff/m88k.h
+fsf/binutils/include/coff/mips.h
+fsf/binutils/include/coff/pe.h
+fsf/binutils/include/coff/powerpc.h
+fsf/binutils/include/coff/rs6000.h
+fsf/binutils/include/coff/sh.h
+fsf/binutils/include/coff/sparc.h
+fsf/binutils/include/coff/sym.h
+fsf/binutils/include/coff/symconst.h
+fsf/binutils/include/coff/tic30.h
+fsf/binutils/include/coff/w65.h
+fsf/binutils/include/coff/we32k.h
+fsf/binutils/include/coff/z8k.h
+fsf/binutils/include/demangle.h
+fsf/binutils/include/dis-asm.h
+fsf/binutils/include/elf/ChangeLog
+fsf/binutils/include/elf/alpha.h
+fsf/binutils/include/elf/arc.h
+fsf/binutils/include/elf/common.h
+fsf/binutils/include/elf/dwarf.h
+fsf/binutils/include/elf/dwarf2.h
+fsf/binutils/include/elf/external.h
+fsf/binutils/include/elf/hppa.h
+fsf/binutils/include/elf/internal.h
+fsf/binutils/include/elf/m32r.h
+fsf/binutils/include/elf/mips.h
+fsf/binutils/include/elf/ppc.h
+fsf/binutils/include/elf/sparc.h
+fsf/binutils/include/elf/v850.h
+fsf/binutils/include/floatformat.h
+fsf/binutils/include/fnmatch.h
+fsf/binutils/include/fopen-bin.h
+fsf/binutils/include/fopen-same.h
+fsf/binutils/include/fopen-vms.h
+fsf/binutils/include/gdbm.h
+fsf/binutils/include/getopt.h
+fsf/binutils/include/hp-symtab.h
+fsf/binutils/include/ieee.h
+fsf/binutils/include/libiberty.h
+fsf/binutils/include/mpw/ChangeLog
+fsf/binutils/include/mpw/README
+fsf/binutils/include/mpw/dir.h
+fsf/binutils/include/mpw/dirent.h
+fsf/binutils/include/mpw/fcntl.h
+fsf/binutils/include/mpw/grp.h
+fsf/binutils/include/mpw/mpw.h
+fsf/binutils/include/mpw/pwd.h
+fsf/binutils/include/mpw/spin.h
+fsf/binutils/include/mpw/stat.h
+fsf/binutils/include/mpw/sys/file.h
+fsf/binutils/include/mpw/sys/param.h
+fsf/binutils/include/mpw/sys/resource.h
+fsf/binutils/include/mpw/sys/stat.h
+fsf/binutils/include/mpw/sys/time.h
+fsf/binutils/include/mpw/sys/types.h
+fsf/binutils/include/mpw/utime.h
+fsf/binutils/include/mpw/varargs.h
+fsf/binutils/include/nlm/ChangeLog
+fsf/binutils/include/nlm/alpha-ext.h
+fsf/binutils/include/nlm/common.h
+fsf/binutils/include/nlm/external.h
+fsf/binutils/include/nlm/i386-ext.h
+fsf/binutils/include/nlm/internal.h
+fsf/binutils/include/nlm/ppc-ext.h
+fsf/binutils/include/nlm/sparc32-ext.h
+fsf/binutils/include/oasys.h
+fsf/binutils/include/objalloc.h
+fsf/binutils/include/obstack.h
+fsf/binutils/include/opcode/ChangeLog
+fsf/binutils/include/opcode/a29k.h
+fsf/binutils/include/opcode/alpha.h
+fsf/binutils/include/opcode/arc.h
+fsf/binutils/include/opcode/arm.h
+fsf/binutils/include/opcode/cgen.h
+fsf/binutils/include/opcode/convex.h
+fsf/binutils/include/opcode/d10v.h
+fsf/binutils/include/opcode/h8300.h
+fsf/binutils/include/opcode/hppa.h
+fsf/binutils/include/opcode/i386.h
+fsf/binutils/include/opcode/i860.h
+fsf/binutils/include/opcode/i960.h
+fsf/binutils/include/opcode/m68k.h
+fsf/binutils/include/opcode/m88k.h
+fsf/binutils/include/opcode/mips.h
+fsf/binutils/include/opcode/mn10200.h
+fsf/binutils/include/opcode/mn10300.h
+fsf/binutils/include/opcode/np1.h
+fsf/binutils/include/opcode/ns32k.h
+fsf/binutils/include/opcode/pn.h
+fsf/binutils/include/opcode/ppc.h
+fsf/binutils/include/opcode/pyr.h
+fsf/binutils/include/opcode/sparc.h
+fsf/binutils/include/opcode/tahoe.h
+fsf/binutils/include/opcode/tic30.h
+fsf/binutils/include/opcode/v850.h
+fsf/binutils/include/opcode/vax.h
+fsf/binutils/include/os9k.h
+fsf/binutils/include/progress.h
+fsf/binutils/include/regs/ChangeLog
+fsf/binutils/include/remote-sim.h
+fsf/binutils/include/symcat.h
+fsf/binutils/include/wait.h
+fsf/binutils/install-sh
+fsf/binutils/ld/ChangeLog
+fsf/binutils/ld/Makefile.am
+fsf/binutils/ld/Makefile.in
+fsf/binutils/ld/NEWS
+fsf/binutils/ld/README
+fsf/binutils/ld/TODO
+fsf/binutils/ld/acconfig.h
+fsf/binutils/ld/acinclude.m4
+fsf/binutils/ld/aclocal.m4
+fsf/binutils/ld/beos-ld.c
+fsf/binutils/ld/config.in
+fsf/binutils/ld/configure
+fsf/binutils/ld/configure.bat
+fsf/binutils/ld/configure.host
+fsf/binutils/ld/configure.in
+fsf/binutils/ld/configure.tgt
+fsf/binutils/ld/dep-in.sed
+fsf/binutils/ld/emulparams/README
+fsf/binutils/ld/emulparams/a29k.sh
+fsf/binutils/ld/emulparams/aixppc.sh
+fsf/binutils/ld/emulparams/aixrs6.sh
+fsf/binutils/ld/emulparams/alpha.sh
+fsf/binutils/ld/emulparams/amiga.sh
+fsf/binutils/ld/emulparams/amiga_bss.sh
+fsf/binutils/ld/emulparams/arcelf.sh
+fsf/binutils/ld/emulparams/armaoutb.sh
+fsf/binutils/ld/emulparams/armaoutl.sh
+fsf/binutils/ld/emulparams/armcoff.sh
+fsf/binutils/ld/emulparams/armpe.sh
+fsf/binutils/ld/emulparams/coff_sparc.sh
+fsf/binutils/ld/emulparams/d10velf.sh
+fsf/binutils/ld/emulparams/delta68.sh
+fsf/binutils/ld/emulparams/ebmon29k.sh
+fsf/binutils/ld/emulparams/elf32_sparc.sh
+fsf/binutils/ld/emulparams/elf32b4300.sh
+fsf/binutils/ld/emulparams/elf32bmip.sh
+fsf/binutils/ld/emulparams/elf32bsmip.sh
+fsf/binutils/ld/emulparams/elf32ebmip.sh
+fsf/binutils/ld/emulparams/elf32elmip.sh
+fsf/binutils/ld/emulparams/elf32l4300.sh
+fsf/binutils/ld/emulparams/elf32lmip.sh
+fsf/binutils/ld/emulparams/elf32lppc.sh
+fsf/binutils/ld/emulparams/elf32lsmip.sh
+fsf/binutils/ld/emulparams/elf32ppc.sh
+fsf/binutils/ld/emulparams/elf64_sparc.sh
+fsf/binutils/ld/emulparams/elf64alpha.sh
+fsf/binutils/ld/emulparams/elf_i386.sh
+fsf/binutils/ld/emulparams/gld960.sh
+fsf/binutils/ld/emulparams/gld960coff.sh
+fsf/binutils/ld/emulparams/go32.sh
+fsf/binutils/ld/emulparams/h8300.sh
+fsf/binutils/ld/emulparams/h8300h.sh
+fsf/binutils/ld/emulparams/h8300s.sh
+fsf/binutils/ld/emulparams/h8500.sh
+fsf/binutils/ld/emulparams/h8500b.sh
+fsf/binutils/ld/emulparams/h8500c.sh
+fsf/binutils/ld/emulparams/h8500m.sh
+fsf/binutils/ld/emulparams/h8500s.sh
+fsf/binutils/ld/emulparams/hp300bsd.sh
+fsf/binutils/ld/emulparams/hp3hpux.sh
+fsf/binutils/ld/emulparams/hppaelf.sh
+fsf/binutils/ld/emulparams/i386aout.sh
+fsf/binutils/ld/emulparams/i386beos.sh
+fsf/binutils/ld/emulparams/i386bsd.sh
+fsf/binutils/ld/emulparams/i386coff.sh
+fsf/binutils/ld/emulparams/i386go32.sh
+fsf/binutils/ld/emulparams/i386linux.sh
+fsf/binutils/ld/emulparams/i386lynx.sh
+fsf/binutils/ld/emulparams/i386mach.sh
+fsf/binutils/ld/emulparams/i386moss.sh
+fsf/binutils/ld/emulparams/i386msdos.sh
+fsf/binutils/ld/emulparams/i386nbsd.sh
+fsf/binutils/ld/emulparams/i386nw.sh
+fsf/binutils/ld/emulparams/i386pe.sh
+fsf/binutils/ld/emulparams/lnk960.sh
+fsf/binutils/ld/emulparams/m32relf.sh
+fsf/binutils/ld/emulparams/m68k4knbsd.sh
+fsf/binutils/ld/emulparams/m68kaout.sh
+fsf/binutils/ld/emulparams/m68kaux.sh
+fsf/binutils/ld/emulparams/m68kcoff.sh
+fsf/binutils/ld/emulparams/m68kelf.sh
+fsf/binutils/ld/emulparams/m68klinux.sh
+fsf/binutils/ld/emulparams/m68klynx.sh
+fsf/binutils/ld/emulparams/m68knbsd.sh
+fsf/binutils/ld/emulparams/m68kpsos.sh
+fsf/binutils/ld/emulparams/m88kbcs.sh
+fsf/binutils/ld/emulparams/mipsbig.sh
+fsf/binutils/ld/emulparams/mipsbsd.sh
+fsf/binutils/ld/emulparams/mipsidt.sh
+fsf/binutils/ld/emulparams/mipsidtl.sh
+fsf/binutils/ld/emulparams/mipslit.sh
+fsf/binutils/ld/emulparams/mipslnews.sh
+fsf/binutils/ld/emulparams/mn10200.sh
+fsf/binutils/ld/emulparams/mn10300.sh
+fsf/binutils/ld/emulparams/news.sh
+fsf/binutils/ld/emulparams/ns32knbsd.sh
+fsf/binutils/ld/emulparams/pc532macha.sh
+fsf/binutils/ld/emulparams/ppcamiga.sh
+fsf/binutils/ld/emulparams/ppcamiga_bss.sh
+fsf/binutils/ld/emulparams/ppcmacos.sh
+fsf/binutils/ld/emulparams/ppcnw.sh
+fsf/binutils/ld/emulparams/ppcpe.sh
+fsf/binutils/ld/emulparams/riscix.sh
+fsf/binutils/ld/emulparams/sa29200.sh
+fsf/binutils/ld/emulparams/sh.sh
+fsf/binutils/ld/emulparams/shelf.sh
+fsf/binutils/ld/emulparams/shl.sh
+fsf/binutils/ld/emulparams/shlelf.sh
+fsf/binutils/ld/emulparams/sparcaout.sh
+fsf/binutils/ld/emulparams/sparclinux.sh
+fsf/binutils/ld/emulparams/sparclynx.sh
+fsf/binutils/ld/emulparams/sparcnbsd.sh
+fsf/binutils/ld/emulparams/st2000.sh
+fsf/binutils/ld/emulparams/sun3.sh
+fsf/binutils/ld/emulparams/sun4.sh
+fsf/binutils/ld/emulparams/tic30aout.sh
+fsf/binutils/ld/emulparams/tic30coff.sh
+fsf/binutils/ld/emulparams/v850.sh
+fsf/binutils/ld/emulparams/vanilla.sh
+fsf/binutils/ld/emulparams/vax.sh
+fsf/binutils/ld/emulparams/vsta.sh
+fsf/binutils/ld/emulparams/w65.sh
+fsf/binutils/ld/emulparams/z8001.sh
+fsf/binutils/ld/emulparams/z8002.sh
+fsf/binutils/ld/emultempl/README
+fsf/binutils/ld/emultempl/aix.em
+fsf/binutils/ld/emultempl/amiga.em
+fsf/binutils/ld/emultempl/armcoff.em
+fsf/binutils/ld/emultempl/beos.em
+fsf/binutils/ld/emultempl/elf32.em
+fsf/binutils/ld/emultempl/generic.em
+fsf/binutils/ld/emultempl/gld960.em
+fsf/binutils/ld/emultempl/gld960c.em
+fsf/binutils/ld/emultempl/hppaelf.em
+fsf/binutils/ld/emultempl/linux.em
+fsf/binutils/ld/emultempl/lnk960.em
+fsf/binutils/ld/emultempl/mipsecoff.em
+fsf/binutils/ld/emultempl/pe.em
+fsf/binutils/ld/emultempl/stringify.sed
+fsf/binutils/ld/emultempl/sunos.em
+fsf/binutils/ld/emultempl/vanilla.em
+fsf/binutils/ld/gen-doc.texi
+fsf/binutils/ld/genscripts.sh
+fsf/binutils/ld/h8-doc.texi
+fsf/binutils/ld/ld.1
+fsf/binutils/ld/ld.h
+fsf/binutils/ld/ld.texinfo
+fsf/binutils/ld/ldcref.c
+fsf/binutils/ld/ldctor.c
+fsf/binutils/ld/ldctor.h
+fsf/binutils/ld/ldemul.c
+fsf/binutils/ld/ldemul.h
+fsf/binutils/ld/ldexp.c
+fsf/binutils/ld/ldexp.h
+fsf/binutils/ld/ldfile.c
+fsf/binutils/ld/ldfile.h
+fsf/binutils/ld/ldgram.y
+fsf/binutils/ld/ldint.texinfo
+fsf/binutils/ld/ldlang.c
+fsf/binutils/ld/ldlang.h
+fsf/binutils/ld/ldlex.h
+fsf/binutils/ld/ldlex.l
+fsf/binutils/ld/ldmain.c
+fsf/binutils/ld/ldmain.h
+fsf/binutils/ld/ldmisc.c
+fsf/binutils/ld/ldmisc.h
+fsf/binutils/ld/ldver.c
+fsf/binutils/ld/ldver.h
+fsf/binutils/ld/ldwrite.c
+fsf/binutils/ld/ldwrite.h
+fsf/binutils/ld/lexsup.c
+fsf/binutils/ld/mac-ld.r
+fsf/binutils/ld/mpw-config.in
+fsf/binutils/ld/mpw-elfmips.c
+fsf/binutils/ld/mpw-eppcmac.c
+fsf/binutils/ld/mpw-esh.c
+fsf/binutils/ld/mpw-idtmips.c
+fsf/binutils/ld/mpw-make.sed
+fsf/binutils/ld/mri.c
+fsf/binutils/ld/mri.h
+fsf/binutils/ld/scripttempl/README
+fsf/binutils/ld/scripttempl/a29k.sc
+fsf/binutils/ld/scripttempl/aix.sc
+fsf/binutils/ld/scripttempl/alpha.sc
+fsf/binutils/ld/scripttempl/amiga.sc
+fsf/binutils/ld/scripttempl/amiga_bss.sc
+fsf/binutils/ld/scripttempl/aout.sc
+fsf/binutils/ld/scripttempl/armaout.sc
+fsf/binutils/ld/scripttempl/armcoff.sc
+fsf/binutils/ld/scripttempl/delta68.sc
+fsf/binutils/ld/scripttempl/ebmon29k.sc
+fsf/binutils/ld/scripttempl/elf.sc
+fsf/binutils/ld/scripttempl/elfd10v.sc
+fsf/binutils/ld/scripttempl/elfppc.sc
+fsf/binutils/ld/scripttempl/go32coff.sc
+fsf/binutils/ld/scripttempl/h8300.sc
+fsf/binutils/ld/scripttempl/h8300h.sc
+fsf/binutils/ld/scripttempl/h8300s.sc
+fsf/binutils/ld/scripttempl/h8500.sc
+fsf/binutils/ld/scripttempl/h8500b.sc
+fsf/binutils/ld/scripttempl/h8500c.sc
+fsf/binutils/ld/scripttempl/h8500m.sc
+fsf/binutils/ld/scripttempl/h8500s.sc
+fsf/binutils/ld/scripttempl/hppaelf.sc
+fsf/binutils/ld/scripttempl/i386beos.sc
+fsf/binutils/ld/scripttempl/i386coff.sc
+fsf/binutils/ld/scripttempl/i386go32.sc
+fsf/binutils/ld/scripttempl/i386lynx.sc
+fsf/binutils/ld/scripttempl/i386msdos.sc
+fsf/binutils/ld/scripttempl/i960.sc
+fsf/binutils/ld/scripttempl/m68kaux.sc
+fsf/binutils/ld/scripttempl/m68kcoff.sc
+fsf/binutils/ld/scripttempl/m68klynx.sc
+fsf/binutils/ld/scripttempl/m88kbcs.sc
+fsf/binutils/ld/scripttempl/mips.sc
+fsf/binutils/ld/scripttempl/mipsbsd.sc
+fsf/binutils/ld/scripttempl/nw.sc
+fsf/binutils/ld/scripttempl/pe.sc
+fsf/binutils/ld/scripttempl/ppcpe.sc
+fsf/binutils/ld/scripttempl/psos.sc
+fsf/binutils/ld/scripttempl/riscix.sc
+fsf/binutils/ld/scripttempl/sa29200.sc
+fsf/binutils/ld/scripttempl/sh.sc
+fsf/binutils/ld/scripttempl/sparccoff.sc
+fsf/binutils/ld/scripttempl/sparclynx.sc
+fsf/binutils/ld/scripttempl/st2000.sc
+fsf/binutils/ld/scripttempl/tic30aout.sc
+fsf/binutils/ld/scripttempl/tic30coff.sc
+fsf/binutils/ld/scripttempl/v850.sc
+fsf/binutils/ld/scripttempl/vanilla.sc
+fsf/binutils/ld/scripttempl/w65.sc
+fsf/binutils/ld/scripttempl/z8000.sc
+fsf/binutils/ld/stamp-h.in
+fsf/binutils/ld/sysdep.h
+fsf/binutils/ld/testsuite/ChangeLog
+fsf/binutils/ld/testsuite/config/default.exp
+fsf/binutils/ld/testsuite/ld-bootstrap/bootstrap.exp
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest-bar.cc
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest-foo.cc
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest-foo.h
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest-main.cc
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest.dat
+fsf/binutils/ld/testsuite/ld-cdtest/cdtest.exp
+fsf/binutils/ld/testsuite/ld-elfvers/vers.exp
+fsf/binutils/ld/testsuite/ld-elfvers/vers1.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers1.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers1.map
+fsf/binutils/ld/testsuite/ld-elfvers/vers1.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers1.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers13.asym
+fsf/binutils/ld/testsuite/ld-elfvers/vers15.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers15.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers15.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers15.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers2.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers2.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers2.map
+fsf/binutils/ld/testsuite/ld-elfvers/vers2.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers3.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers3.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers3.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers4.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers4.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers4a.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers4a.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers4a.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers5.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers6.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers6.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers6.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers6.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers7.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers7.map
+fsf/binutils/ld/testsuite/ld-elfvers/vers7a.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers7a.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers7a.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers7a.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers8.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers8.map
+fsf/binutils/ld/testsuite/ld-elfvers/vers8.ver
+fsf/binutils/ld/testsuite/ld-elfvers/vers9.c
+fsf/binutils/ld/testsuite/ld-elfvers/vers9.dsym
+fsf/binutils/ld/testsuite/ld-elfvers/vers9.sym
+fsf/binutils/ld/testsuite/ld-elfvers/vers9.ver
+fsf/binutils/ld/testsuite/ld-empic/empic.exp
+fsf/binutils/ld/testsuite/ld-empic/relax.t
+fsf/binutils/ld/testsuite/ld-empic/relax1.c
+fsf/binutils/ld/testsuite/ld-empic/relax2.c
+fsf/binutils/ld/testsuite/ld-empic/relax3.c
+fsf/binutils/ld/testsuite/ld-empic/relax4.c
+fsf/binutils/ld/testsuite/ld-empic/run.c
+fsf/binutils/ld/testsuite/ld-empic/runtest1.c
+fsf/binutils/ld/testsuite/ld-empic/runtest2.c
+fsf/binutils/ld/testsuite/ld-empic/runtesti.s
+fsf/binutils/ld/testsuite/ld-scripts/cross1.c
+fsf/binutils/ld/testsuite/ld-scripts/cross1.t
+fsf/binutils/ld/testsuite/ld-scripts/cross2.c
+fsf/binutils/ld/testsuite/ld-scripts/cross2.t
+fsf/binutils/ld/testsuite/ld-scripts/cross3.c
+fsf/binutils/ld/testsuite/ld-scripts/crossref.exp
+fsf/binutils/ld/testsuite/ld-scripts/defined.exp
+fsf/binutils/ld/testsuite/ld-scripts/defined.s
+fsf/binutils/ld/testsuite/ld-scripts/defined.t
+fsf/binutils/ld/testsuite/ld-scripts/phdrs.exp
+fsf/binutils/ld/testsuite/ld-scripts/phdrs.s
+fsf/binutils/ld/testsuite/ld-scripts/phdrs.t
+fsf/binutils/ld/testsuite/ld-scripts/script.exp
+fsf/binutils/ld/testsuite/ld-scripts/script.s
+fsf/binutils/ld/testsuite/ld-scripts/script.t
+fsf/binutils/ld/testsuite/ld-scripts/scriptm.t
+fsf/binutils/ld/testsuite/ld-scripts/sizeof.exp
+fsf/binutils/ld/testsuite/ld-scripts/sizeof.s
+fsf/binutils/ld/testsuite/ld-scripts/sizeof.t
+fsf/binutils/ld/testsuite/ld-sh/sh.exp
+fsf/binutils/ld/testsuite/ld-sh/sh1.s
+fsf/binutils/ld/testsuite/ld-sh/sh2.c
+fsf/binutils/ld/testsuite/ld-sh/start.s
+fsf/binutils/ld/testsuite/ld-shared/main.c
+fsf/binutils/ld/testsuite/ld-shared/sh1.c
+fsf/binutils/ld/testsuite/ld-shared/sh2.c
+fsf/binutils/ld/testsuite/ld-shared/shared.dat
+fsf/binutils/ld/testsuite/ld-shared/shared.exp
+fsf/binutils/ld/testsuite/ld-shared/sun4.dat
+fsf/binutils/ld/testsuite/ld-shared/xcoff.dat
+fsf/binutils/ld/testsuite/ld-srec/sr1.c
+fsf/binutils/ld/testsuite/ld-srec/sr2.c
+fsf/binutils/ld/testsuite/ld-srec/sr3.cc
+fsf/binutils/ld/testsuite/ld-srec/srec.exp
+fsf/binutils/ld/testsuite/ld-undefined/undefined.c
+fsf/binutils/ld/testsuite/ld-undefined/undefined.exp
+fsf/binutils/ld/testsuite/ld-versados/t1-1.ro
+fsf/binutils/ld/testsuite/ld-versados/t1-2.ro
+fsf/binutils/ld/testsuite/ld-versados/t1.ld
+fsf/binutils/ld/testsuite/ld-versados/t1.ook
+fsf/binutils/ld/testsuite/ld-versados/t2-1.ro
+fsf/binutils/ld/testsuite/ld-versados/t2-2.ro
+fsf/binutils/ld/testsuite/ld-versados/t2-3.ro
+fsf/binutils/ld/testsuite/ld-versados/t2.ld
+fsf/binutils/ld/testsuite/ld-versados/t2.ook
+fsf/binutils/ld/testsuite/ld-versados/versados.exp
+fsf/binutils/ld/testsuite/lib/ld-lib.exp
+fsf/binutils/libiberty/COPYING.LIB
+fsf/binutils/libiberty/ChangeLog
+fsf/binutils/libiberty/Makefile.in
+fsf/binutils/libiberty/README
+fsf/binutils/libiberty/alloca-botch.h
+fsf/binutils/libiberty/alloca-norm.h
+fsf/binutils/libiberty/alloca.c
+fsf/binutils/libiberty/argv.c
+fsf/binutils/libiberty/asprintf.c
+fsf/binutils/libiberty/atexit.c
+fsf/binutils/libiberty/basename.c
+fsf/binutils/libiberty/bcmp.c
+fsf/binutils/libiberty/bcopy.c
+fsf/binutils/libiberty/bzero.c
+fsf/binutils/libiberty/choose-temp.c
+fsf/binutils/libiberty/clock.c
+fsf/binutils/libiberty/concat.c
+fsf/binutils/libiberty/config.h-vms
+fsf/binutils/libiberty/config.table
+fsf/binutils/libiberty/config/mh-a68bsd
+fsf/binutils/libiberty/config/mh-aix
+fsf/binutils/libiberty/config/mh-amigaos
+fsf/binutils/libiberty/config/mh-apollo68
+fsf/binutils/libiberty/config/mh-beos
+fsf/binutils/libiberty/config/mh-cxux7
+fsf/binutils/libiberty/config/mh-cygwin32
+fsf/binutils/libiberty/config/mh-fbsd21
+fsf/binutils/libiberty/config/mh-go32
+fsf/binutils/libiberty/config/mh-hpbsd
+fsf/binutils/libiberty/config/mh-irix4
+fsf/binutils/libiberty/config/mh-ncr3000
+fsf/binutils/libiberty/config/mh-riscix
+fsf/binutils/libiberty/config/mh-sysv
+fsf/binutils/libiberty/config/mh-sysv4
+fsf/binutils/libiberty/config/mh-windows
+fsf/binutils/libiberty/config/mt-mingw32
+fsf/binutils/libiberty/config/mt-sunos4
+fsf/binutils/libiberty/config/mt-vxworks5
+fsf/binutils/libiberty/configure.bat
+fsf/binutils/libiberty/configure.in
+fsf/binutils/libiberty/copysign.c
+fsf/binutils/libiberty/cplus-dem.c
+fsf/binutils/libiberty/dummy.c
+fsf/binutils/libiberty/fdmatch.c
+fsf/binutils/libiberty/floatformat.c
+fsf/binutils/libiberty/fnmatch.c
+fsf/binutils/libiberty/functions.def
+fsf/binutils/libiberty/getcwd.c
+fsf/binutils/libiberty/getopt.c
+fsf/binutils/libiberty/getopt1.c
+fsf/binutils/libiberty/getpagesize.c
+fsf/binutils/libiberty/getruntime.c
+fsf/binutils/libiberty/hex.c
+fsf/binutils/libiberty/index.c
+fsf/binutils/libiberty/insque.c
+fsf/binutils/libiberty/makefile.dos
+fsf/binutils/libiberty/makefile.vms
+fsf/binutils/libiberty/memchr.c
+fsf/binutils/libiberty/memcmp.c
+fsf/binutils/libiberty/memcpy.c
+fsf/binutils/libiberty/memmove.c
+fsf/binutils/libiberty/memset.c
+fsf/binutils/libiberty/mpw-config.in
+fsf/binutils/libiberty/mpw-make.sed
+fsf/binutils/libiberty/mpw.c
+fsf/binutils/libiberty/msdos.c
+fsf/binutils/libiberty/objalloc.c
+fsf/binutils/libiberty/obstack.c
+fsf/binutils/libiberty/pexecute.c
+fsf/binutils/libiberty/random.c
+fsf/binutils/libiberty/rename.c
+fsf/binutils/libiberty/rindex.c
+fsf/binutils/libiberty/sigsetmask.c
+fsf/binutils/libiberty/spaces.c
+fsf/binutils/libiberty/strcasecmp.c
+fsf/binutils/libiberty/strchr.c
+fsf/binutils/libiberty/strdup.c
+fsf/binutils/libiberty/strerror.c
+fsf/binutils/libiberty/strncasecmp.c
+fsf/binutils/libiberty/strrchr.c
+fsf/binutils/libiberty/strsignal.c
+fsf/binutils/libiberty/strstr.c
+fsf/binutils/libiberty/strtod.c
+fsf/binutils/libiberty/strtol.c
+fsf/binutils/libiberty/strtoul.c
+fsf/binutils/libiberty/tmpnam.c
+fsf/binutils/libiberty/vasprintf.c
+fsf/binutils/libiberty/vfork.c
+fsf/binutils/libiberty/vfprintf.c
+fsf/binutils/libiberty/vmsbuild.com
+fsf/binutils/libiberty/vprintf.c
+fsf/binutils/libiberty/vsprintf.c
+fsf/binutils/libiberty/waitpid.c
+fsf/binutils/libiberty/xatexit.c
+fsf/binutils/libiberty/xexit.c
+fsf/binutils/libiberty/xmalloc.c
+fsf/binutils/libiberty/xstrdup.c
+fsf/binutils/libiberty/xstrerror.c
+fsf/binutils/ltconfig
+fsf/binutils/ltmain.sh
+fsf/binutils/makeall.bat
+fsf/binutils/makefile.vms
+fsf/binutils/manifests/bin
+fsf/binutils/manifests/src
+fsf/binutils/missing
+fsf/binutils/mkinstalldirs
+fsf/binutils/move-if-change
+fsf/binutils/mpw-README
+fsf/binutils/mpw-build.in
+fsf/binutils/mpw-config.in
+fsf/binutils/mpw-configure
+fsf/binutils/mpw-install
+fsf/binutils/opcodes/ChangeLog
+fsf/binutils/opcodes/Makefile.am
+fsf/binutils/opcodes/Makefile.in
+fsf/binutils/opcodes/a29k-dis.c
+fsf/binutils/opcodes/acconfig.h
+fsf/binutils/opcodes/acinclude.m4
+fsf/binutils/opcodes/aclocal.m4
+fsf/binutils/opcodes/alpha-dis.c
+fsf/binutils/opcodes/alpha-opc.c
+fsf/binutils/opcodes/arc-dis.c
+fsf/binutils/opcodes/arc-opc.c
+fsf/binutils/opcodes/arm-dis.c
+fsf/binutils/opcodes/arm-opc.h
+fsf/binutils/opcodes/cgen-asm.c
+fsf/binutils/opcodes/cgen-dis.c
+fsf/binutils/opcodes/cgen-opc.c
+fsf/binutils/opcodes/config.in
+fsf/binutils/opcodes/configure
+fsf/binutils/opcodes/configure.bat
+fsf/binutils/opcodes/configure.in
+fsf/binutils/opcodes/d10v-dis.c
+fsf/binutils/opcodes/d10v-opc.c
+fsf/binutils/opcodes/dep-in.sed
+fsf/binutils/opcodes/dis-buf.c
+fsf/binutils/opcodes/disassemble.c
+fsf/binutils/opcodes/h8300-dis.c
+fsf/binutils/opcodes/h8500-dis.c
+fsf/binutils/opcodes/h8500-opc.h
+fsf/binutils/opcodes/hppa-dis.c
+fsf/binutils/opcodes/i386-dis.c
+fsf/binutils/opcodes/i960-dis.c
+fsf/binutils/opcodes/m10200-dis.c
+fsf/binutils/opcodes/m10200-opc.c
+fsf/binutils/opcodes/m10300-dis.c
+fsf/binutils/opcodes/m10300-opc.c
+fsf/binutils/opcodes/m32r-asm.c
+fsf/binutils/opcodes/m32r-dis.c
+fsf/binutils/opcodes/m32r-opc.c
+fsf/binutils/opcodes/m32r-opc.h
+fsf/binutils/opcodes/m68k-dis.c
+fsf/binutils/opcodes/m68k-opc.c
+fsf/binutils/opcodes/m88k-dis.c
+fsf/binutils/opcodes/makefile.vms
+fsf/binutils/opcodes/mips-dis.c
+fsf/binutils/opcodes/mips-opc.c
+fsf/binutils/opcodes/mips16-opc.c
+fsf/binutils/opcodes/mpw-config.in
+fsf/binutils/opcodes/mpw-make.sed
+fsf/binutils/opcodes/ns32k-dis.c
+fsf/binutils/opcodes/ppc-dis.c
+fsf/binutils/opcodes/ppc-opc.c
+fsf/binutils/opcodes/sh-dis.c
+fsf/binutils/opcodes/sh-opc.h
+fsf/binutils/opcodes/sparc-dis.c
+fsf/binutils/opcodes/sparc-opc.c
+fsf/binutils/opcodes/stamp-h.in
+fsf/binutils/opcodes/sysdep.h
+fsf/binutils/opcodes/tic30-dis.c
+fsf/binutils/opcodes/v850-dis.c
+fsf/binutils/opcodes/v850-opc.c
+fsf/binutils/opcodes/w65-dis.c
+fsf/binutils/opcodes/w65-opc.h
+fsf/binutils/opcodes/z8k-dis.c
+fsf/binutils/opcodes/z8k-opc.h
+fsf/binutils/opcodes/z8kgen.c
+fsf/binutils/setup.com
+fsf/binutils/symlink-tree
+fsf/binutils/texinfo/gpl.texinfo
+fsf/binutils/texinfo/lgpl.texinfo
+fsf/binutils/texinfo/texinfo.tex
+fsf/binutils/ylwrap
diff --git a/mkdist b/mkdist
new file mode 100644
index 0000000..479bf54
--- /dev/null
+++ binutils-2.9.1/mkdist
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+mkdir -p dist/bin
+mkdir -p dist/ppc-morphos/lib/ldscripts
+
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-addr2line build/binutils/addr2line
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-ar build/binutils/ar
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-nm build/binutils/nm-new
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-objcopy build/binutils/objcopy
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-objdump build/binutils/objdump
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-ranlib build/binutils/ranlib
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-size build/binutils/size
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-strings build/binutils/strings
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-strip build/binutils/strip-new
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-c++filt build/binutils/c++filt
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-as build/gas/as-new
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-gasp build/gas/gasp-new
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-ld build/ld/ld-new
+ppc-morphos-strip -R .comment -o dist/bin/ppc-morphos-gprof build/gprof/gprof
+
+cp build/ld/ldscripts/* dist/ppc-morphos/lib/ldscripts
+cp COPYING dist
+
+chmod 755 dist/bin/*
+
+cat >dist/Install <<EOF
+
+cd bin
+protect #? +p quiet
+copy #? gg:bin quiet
+cd /
+
+copy ppc-morphos/lib/ldscripts gg:ppc-morphos/lib/ldscripts quiet
+
+failat 21
+
+makelink gg:bin/addr2line gg:bin/ppc-morphos-addr2line
+makelink gg:bin/ar gg:bin/ppc-morphos-ar
+makelink gg:bin/nm gg:bin/ppc-morphos-nm
+makelink gg:bin/objcopy gg:bin/ppc-morphos-objcopy
+makelink gg:bin/objdump gg:bin/ppc-morphos-objdump
+makelink gg:bin/ranlib gg:bin/ppc-morphos-ranlib
+makelink gg:bin/size gg:bin/ppc-morphos-size
+makelink gg:bin/strings gg:bin/ppc-morphos-strings
+makelink gg:bin/strip gg:bin/ppc-morphos-strip
+makelink gg:bin/c++filt gg:bin/ppc-morphos-c++filt
+makelink gg:bin/as gg:bin/ppc-morphos-as
+makelink gg:bin/gasp gg:bin/ppc-morphos-gasp
+makelink gg:bin/ld gg:bin/ppc-morphos-ld
+makelink gg:bin/gpros gg:bin/ppc-morphos-gprof
+
+makelink gg:ppc-morphos/bin/ld gg:bin/ppc-morphos-ld
+makelink gg:ppc-morphos/bin/ar gg:bin/ppc-morphos-ar
+makelink gg:ppc-morphos/bin/as gg:bin/ppc-morphos-as
+makelink gg:ppc-morphos/bin/ranlib gg:bin/ppc-morphos-ranlib
+makelink gg:ppc-morphos/bin/nm gg:bin/ppc-morphos-nm
+makelink gg:ppc-morphos/bin/strip gg:bin/ppc-morphos-strip
+
+EOF
+
+/c/protect dist/Install +s quiet
+
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 2d528c6..5e1f541 100644
--- binutils-2.9.1.orig/opcodes/ChangeLog
+++ binutils-2.9.1/opcodes/ChangeLog
@@ -333,6 +333,11 @@ Thu Oct 23 21:13:37 1997  Fred Fish  <fnf@cygnus.com>
  
 	* d10v-opc.c (d10v_opcodes): Correct entry for RTE.
  
+Mon Oct 20 11:16:19 1997  Fred Fish  <fnf@ninemoons.com>
+
+	* configure.in (AC_ARFLAGS): Add.
+	* configure: Regenerate.
+
 Mon Dec  8 11:21:07 1997  Nick Clifton  <nickc@cygnus.com>
 
 	* disassemble.c: Remove disasm_symaddr() function.
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index b1d1b0f..cd933ea 100644
--- binutils-2.9.1.orig/opcodes/Makefile.in
+++ binutils-2.9.1/opcodes/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.2e from Makefile.am
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -11,7 +11,7 @@
 # PARTICULAR PURPOSE.
 
 
-SHELL = @SHELL@
+SHELL = /bin/sh
 
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
@@ -28,10 +28,16 @@ sharedstatedir = @sharedstatedir@
 localstatedir = @localstatedir@
 libdir = @libdir@
 infodir = @infodir@
+guidedir = @guidedir@
+htmldir = @htmldir@
+dvidir = @dvidir@
+psdir = @psdir@
 mandir = @mandir@
 includedir = @includedir@
 oldincludedir = /usr/include
 
+DISTDIR =
+
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -64,17 +70,12 @@ target_triplet = @target@
 AR = @AR@
 BFD_MACHINES = @BFD_MACHINES@
 CC = @CC@
+CC_FOR_BUILD = @CC_FOR_BUILD@
 EXEEXT = @EXEEXT@
+EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
 HDEFINES = @HDEFINES@
-LD = @LD@
 LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-NM = @NM@
-PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
-VERSION = @VERSION@
 archdefs = @archdefs@
 
 AUTOMAKE_OPTIONS = cygnus
@@ -212,6 +213,7 @@ LIBS = @LIBS@
 libopcodes_a_LIBADD = 
 libopcodes_a_SOURCES = libopcodes.a.c
 libopcodes_a_OBJECTS =  libopcodes.a.o
+ARFLAGS = @ARFLAGS@
 LTLIBRARIES =  $(lib_LTLIBRARIES)
 
 libopcodes_la_OBJECTS =  dis-buf.lo disassemble.lo
@@ -223,21 +225,24 @@ DIST_COMMON =  ChangeLog Makefile.am Makefile.in acconfig.h acinclude.m4 \
 aclocal.m4 config.in configure configure.in stamp-h.in
 
 
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) \
+		$(INFOS) $(GUIDES) $(HTMLS) $(MANS)
 TAR = tar
 GZIP = --best
 SOURCES = libopcodes.a.c $(libopcodes_la_SOURCES)
 OBJECTS = libopcodes.a.o $(libopcodes_la_OBJECTS)
 
-default: all
+all: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
 
 .SUFFIXES:
 .SUFFIXES: .S .c .lo .o .s
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && $(AUTOMAKE) --cygnus --include-deps Makefile
 
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -328,18 +333,18 @@ maintainer-clean-libLTLIBRARIES:
 
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p"; \
-	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(libdir)/$$p; \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
 	  else :; fi; \
 	done
 
 uninstall-libLTLIBRARIES:
-	$(NORMAL_UNINSTALL)
+	@$(NORMAL_UNINSTALL)
 	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  $(LIBTOOL)  --mode=uninstall rm -f $(libdir)/$$p; \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
 	done
 
 libopcodes.la: $(libopcodes_la_OBJECTS) $(libopcodes_la_DEPENDENCIES)
@@ -413,6 +418,9 @@ distdir: $(DISTFILES)
 	  || cp -p $$d/$$file $(distdir)/$$file; \
 	done
 info:
+guide:
+html:
+ps:
 dvi:
 check:
 	$(MAKE)
@@ -429,12 +437,10 @@ install: install-exec install-data all
 
 uninstall: uninstall-libLTLIBRARIES
 
-all: Makefile $(LIBRARIES) $(LTLIBRARIES) config.h
-
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
 installdirs:
-	$(mkinstalldirs)  $(libdir)
+	$(mkinstalldirs)  $(DATADIR)$(libdir)
 
 
 mostlyclean-generic:
@@ -474,18 +480,18 @@ maintainer-clean:  maintainer-clean-hdr maintainer-clean-noinstLIBRARIES \
 	@echo "it deletes files that may require special tools to rebuild."
 	-rm -f config.status
 
-.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
-maintainer-clean-hdr mostlyclean-noinstLIBRARIES \
-distclean-noinstLIBRARIES clean-noinstLIBRARIES \
-maintainer-clean-noinstLIBRARIES mostlyclean-compile distclean-compile \
-clean-compile maintainer-clean-compile mostlyclean-libtool \
-distclean-libtool clean-libtool maintainer-clean-libtool \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
-installcheck install-info install-exec install-data install uninstall \
-all installdirs mostlyclean-generic distclean-generic clean-generic \
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool mostlyclean-libLTLIBRARIES \
+distclean-libLTLIBRARIES clean-libLTLIBRARIES \
+maintainer-clean-libLTLIBRARIES uninstall-libLTLIBRARIES \
+install-libLTLIBRARIES tags mostlyclean-tags distclean-tags clean-tags \
+maintainer-clean-tags distdir info guide html ps dvi installcheck \
+install-info install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
diff --git a/opcodes/configure b/opcodes/configure
index ab71c7a..e1e623e 100755
--- binutils-2.9.1.orig/opcodes/configure
+++ binutils-2.9.1/opcodes/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.1 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -61,6 +61,10 @@ libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 infodir='${prefix}/info'
+guidedir='${prefix}/guide'
+htmldir='${prefix}/html'
+psdir='${prefix}/ps'
+dvidir='${prefix}/dvi'
 mandir='${prefix}/man'
 
 # Initialize some other variables.
@@ -178,6 +182,10 @@ Directory and file names:
   --includedir=DIR        C header files in DIR [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
   --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --guidedir=DIR          Amigaguide documentation in DIR [PREFIX/guide]
+  --htmldir=DIR           HTML documentation in DIR [PREFIX/html]
+  --psdir=DIR             postscript documentation in DIR [PREFIX/ps]
+  --dvidir=DIR            TeX dvi documentation in DIR [PREFIX/dvi]
   --mandir=DIR            man documentation in DIR [PREFIX/man]
   --srcdir=DIR            find the sources in DIR [configure dir or ..]
   --program-prefix=PREFIX prepend PREFIX to installed program names
@@ -220,6 +228,22 @@ EOF
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
     infodir="$ac_optarg" ;;
 
+ -guidedir | --guidedir | --guidedi | --guided | --guide | --gui)
+   ac_prev=guidedir ;;
+ -guidedir=* | --guidedir=* | --guidedi=* | --guided=* | --guide=* |--gui=*)+    guidedir="$ac_optarg" ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm)
+   ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* |--htm=*)+    htmldir="$ac_optarg" ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+   ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)+    psdir="$ac_optarg" ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+   ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* |--dv=*)+    dvidir="$ac_optarg" ;;
+
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
@@ -350,7 +374,7 @@ EOF
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12.1"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -520,9 +544,11 @@ ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -584,7 +610,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:614: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -605,7 +631,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:635: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -623,7 +649,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:627: checking build system type" >&5
+echo "configure:653: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -658,21 +684,22 @@ BFD_VERSION=`grep INIT_AUTOMAKE ${srcdir}/../bfd/configure.in | sed -n -e 's/[
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AmigaOS /c/install
 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:667: checking for a BSD compatible install" >&5
+echo "configure:694: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
-    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    /|./|.//|/etc/*|/c/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
       # Don't use installbsd from OSF since it installs stuff as root
@@ -711,13 +738,15 @@ echo "$ac_t""$INSTALL" 1>&6
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:721: checking whether build environment is sane" >&5
+echo "configure:750: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -774,7 +803,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:807: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -820,7 +849,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:824: checking for working aclocal" >&5
+echo "configure:853: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -833,7 +862,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:837: checking for working autoconf" >&5
+echo "configure:866: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -846,7 +875,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:850: checking for working automake" >&5
+echo "configure:879: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -859,7 +888,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:863: checking for working autoheader" >&5
+echo "configure:892: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -872,7 +901,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:876: checking for working makeinfo" >&5
+echo "configure:905: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -895,15 +924,16 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:899: checking for $ac_word" >&5
+echo "configure:928: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_AR="${ac_tool_prefix}ar"
@@ -923,18 +953,68 @@ fi
 
 
 
+ if test -z "$AR"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:961: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_AR="${ac_tool_prefix}ar"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ac_t""$AR" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+fi
+echo $ac_n "checking what flags $AR needs to create archives""... $ac_c" 1>&6
+echo "configure:992: checking what flags $AR needs to create archives" >&5
+if eval "test \"`echo '$''{'gg_cv_arflags'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$CC" in
+  mwcc* | bcc*) ARFLAGS=${ARFLAGS-"-xml -o"} ;;
+  *)		ARFLAGS=${ARFLAGS-"cr"} ;;
+esac
+gg_cv_arflags=$ARFLAGS
+
+fi
+ARFLAGS="$gg_cv_arflags"
+echo "$ac_t""$ARFLAGS" 1>&6
+
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:930: checking for $ac_word" >&5
+echo "configure:1009: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
@@ -957,15 +1037,16 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:961: checking for $ac_word" >&5
+echo "configure:1041: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1039,15 +1120,16 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1043: checking for $ac_word" >&5
+echo "configure:1124: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1068,15 +1150,16 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1072: checking for $ac_word" >&5
+echo "configure:1154: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1094,19 +1177,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1184: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1217: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1246: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1101: checking for $ac_word" >&5
+echo "configure:1279: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1141,25 +1320,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1331: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1362: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1159 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1373 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1173,18 +1388,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1183: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1404: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1188: checking whether we are using GNU C" >&5
+echo "configure:1409: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1193,7 +1414,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1204,11 +1425,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1212: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1437: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1223,18 +1448,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 # Check whether --with-gnu-ld or --without-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval="$with_gnu_ld"
@@ -1248,7 +1500,7 @@ ac_prog=ld
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1252: checking for ld used by GCC" >&5
+echo "configure:1504: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
   # Accept absolute paths.
@@ -1266,10 +1518,10 @@ echo "configure:1252: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1270: checking for GNU ld" >&5
+echo "configure:1522: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1273: checking for non-GNU ld" >&5
+echo "configure:1525: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1305,7 +1557,7 @@ fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1309: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1561: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1321,7 +1573,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1325: checking for BSD-compatible nm" >&5
+echo "configure:1577: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1358,7 +1610,7 @@ echo "$ac_t""$NM" 1>&6
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1362: checking whether ln -s works" >&5
+echo "configure:1614: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1368,14 +1620,24 @@ then
   rm -f conftestdata
   ac_cv_prog_LN_S="ln -s"
 else
-  ac_cv_prog_LN_S=ln
+  if ln X conftestdata 2>/dev/null
+  then
+    rm -f conftestdata
+    ac_cv_prog_LN_S=ln
+  else
+    ac_cv_prog_LN_S=cp
+  fi
 fi
 fi
 LN_S="$ac_cv_prog_LN_S"
 if test "$ac_cv_prog_LN_S" = "ln -s"; then
   echo "$ac_t""yes" 1>&6
 else
-  echo "$ac_t""no" 1>&6
+  if test "$ac_cv_prog_LN_S" = "ln"; then
+    echo "$ac_t""no, using ln" 1>&6
+  else
+    echo "$ac_t""no, and neither does ln, so using cp" 1>&6
+  fi
 fi
 
 # Always use our own libtool.
@@ -1394,8 +1656,8 @@ test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 1398 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:1399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 1660 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:1661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -1473,7 +1735,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1477: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1739: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1491,19 +1753,19 @@ fi
   
 
 echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1495: checking for Cygwin32 environment" >&5
+echo "configure:1757: checking for Cygwin32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1500 "configure"
+#line 1762 "configure"
 #include "confdefs.h"
 
 int main() {
 return __CYGWIN32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_cygwin32=yes
 else
@@ -1520,19 +1782,19 @@ echo "$ac_t""$am_cv_cygwin32" 1>&6
 CYGWIN32=
 test "$am_cv_cygwin32" = yes && CYGWIN32=yes
 echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
-echo "configure:1524: checking for Mingw32 environment" >&5
+echo "configure:1786: checking for Mingw32 environment" >&5
 if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1791 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_mingw32=yes
 else
@@ -1551,7 +1813,7 @@ test "$am_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1555: checking for executable suffix" >&5
+echo "configure:1817: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1580,15 +1842,16 @@ echo "$ac_t""${am_cv_exeext}" 1>&6
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1584: checking for $ac_word" >&5
+echo "configure:1846: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1606,19 +1869,115 @@ else
 fi
 
 if test -z "$CC"; then
+  # Extract the first word of "bcc", so it can be a program name with args.
+set dummy bcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1876: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="bcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+if test -z "$CC"; then
+  machine=`(uname -m 2>/dev/null)` || machine=unknown
+  case "$machine" in
+    BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
+set dummy mwccx86; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1909: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwccx86"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
+set dummy mwcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1938: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="mwcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    *) ;;
+  esac
+fi
+if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1613: checking for $ac_word" >&5
+echo "configure:1971: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1653,25 +2012,61 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
+if test -z "$CC"; then
+  case "`uname -s`" in
+  *win32* | *WIN32*)
+    # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2023: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+  esac
+fi
+test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1661: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2054: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1671 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 2065 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1685,18 +2080,24 @@ else
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2096: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1700: checking whether we are using GNU C" >&5
+echo "configure:2101: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1705,7 +2106,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1716,11 +2117,15 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1724: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2129: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1735,18 +2140,45 @@ rm -f conftest*
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+case "$CC" in
+  bcc )
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwcc )
+    CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
+    AR=${AR-mwld}
+    LD=${LD-mwld}
+    RANLIB=${RANLIB-true};;
+  mwccx86 )
+    CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
+    AR=${AR-mwldx86}
+    LD=${LD-mwldx86}
+    RANLIB=${RANLIB-true};;
+  ${host_alias}-gcc)
+    ;;
+  *)
+    AR=${AR-ar}
+    LD=${LD-ld}
+    RANLIB=${RANLIB-ranlib};;
+esac
 
+ 
 
 . ${srcdir}/../bfd/configure.host
 
@@ -1756,7 +2188,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1760: checking how to run the C preprocessor" >&5
+echo "configure:2192: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1771,14 +2203,14 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1775 "configure"
+#line 2207 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1788,14 +2220,31 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1792 "configure"
+#line 2224 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 2241 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1808,6 +2257,8 @@ fi
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1820,18 +2271,18 @@ for ac_hdr in string.h strings.h stdlib.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1824: checking for $ac_hdr" >&5
+echo "configure:2275: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 2280 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1994,7 +2445,7 @@ EOF
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
   *ac_space=\ *)
     # `set' does not quote correctly, so add quotes (double-quote substitution
     # turns \\\\ into \\, and sed turns \\ into \).
@@ -2040,7 +2491,9 @@ DEFS=-DHAVE_CONFIG_H
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
+# Some systems, like AmigaOS, won't allow you to remove a script that is
+# being executed, so just move it out of the way instead.
+if test -f $CONFIG_STATUS; then mv $CONFIG_STATUS $CONFIG_STATUS.old; else true; fi
 cat > $CONFIG_STATUS <<EOF
 #! /bin/sh
 # Generated automatically by configure.
@@ -2061,7 +2514,7 @@ do
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -2085,6 +2538,7 @@ s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -2102,6 +2556,10 @@ s%@libdir@%$libdir%g
 s%@includedir@%$includedir%g
 s%@oldincludedir@%$oldincludedir%g
 s%@infodir@%$infodir%g
+s%@guidedir@%$guidedir%g
+s%@htmldir@%$htmldir%g
+s%@psdir@%$psdir%g
+s%@dvidir@%$dvidir%g
 s%@mandir@%$mandir%g
 s%@host@%$host%g
 s%@host_alias@%$host_alias%g
@@ -2119,8 +2577,8 @@ s%@build_cpu@%$build_cpu%g
 s%@build_vendor@%$build_vendor%g
 s%@build_os@%$build_os%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
@@ -2130,6 +2588,7 @@ s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@AR@%$AR%g
+s%@ARFLAGS@%$ARFLAGS%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
 s%@LD@%$LD%g
@@ -2284,6 +2743,7 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
 
 EOF
 
+
 # Transform confdefs.h into a sed script conftest.vals that substitutes
 # the proper values into config.h.in to produce config.h.  And first:
 # Protect against being on the right side of a sed subst in config.status.
@@ -2329,6 +2789,7 @@ do
 done
 rm -f conftest.vals
 
+
 cat >> $CONFIG_STATUS <<\EOF
   rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
@@ -2360,6 +2821,7 @@ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
 exit 0
 EOF
 chmod +x $CONFIG_STATUS
+rm -f CONFIG.STATUS.old
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
diff --git a/opcodes/configure.in b/opcodes/configure.in
index 3a24a43..c77295b 100644
--- binutils-2.9.1.orig/opcodes/configure.in
+++ binutils-2.9.1/opcodes/configure.in
@@ -18,6 +18,7 @@ AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION})
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
 AC_CHECK_TOOL(AR, ar)
+AC_ARFLAGS
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
 dnl Default to a non shared library.  This may be overridden by the
diff --git a/opcodes/m68k-dis.c b/opcodes/m68k-dis.c
index 6704792..5ebb7d9 100644
--- binutils-2.9.1.orig/opcodes/m68k-dis.c
+++ binutils-2.9.1/opcodes/m68k-dis.c
@@ -49,7 +49,7 @@ CONST char * CONST fpcr_names[] = {
 
 static char *const reg_names[] = {
   "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
-  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",
+  "%a0", "%a1", "%a2", "%a3", "%a4", "%fp", "%a6", "%sp",
   "%ps", "%pc"};
 
 /* Sign-extend an (unsigned char). */
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index 70716ea..b43bceb 100644
--- binutils-2.9.1.orig/opcodes/ppc-dis.c
+++ binutils-2.9.1/opcodes/ppc-dis.c
@@ -42,7 +42,7 @@ print_insn_big_powerpc (memaddr, info)
      struct disassemble_info *info;
 {
   return print_insn_powerpc (memaddr, info, 1,
-			     PPC_OPCODE_PPC | PPC_OPCODE_601);
+			     PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_VEC);
 }
 
 /* Print a little endian PowerPC instruction.  For convenience, also
@@ -54,7 +54,7 @@ print_insn_little_powerpc (memaddr, info)
      struct disassemble_info *info;
 {
   return print_insn_powerpc (memaddr, info, 0,
-			     PPC_OPCODE_PPC | PPC_OPCODE_601);
+			     PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_VEC);
 }
 
 /* Print a POWER (RS/6000) instruction.  */
@@ -182,6 +182,8 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
 	    (*info->fprintf_func) (info->stream, "r%ld", value);
 	  else if ((operand->flags & PPC_OPERAND_FPR) != 0)
 	    (*info->fprintf_func) (info->stream, "f%ld", value);
+	  else if ((operand->flags & PPC_OPERAND_VR) != 0)
+	    (*info->fprintf_func) (info->stream, "v%ld", value);
 	  else if ((operand->flags & PPC_OPERAND_RELATIVE) != 0)
 	    (*info->print_address_func) (memaddr + value, info);
 	  else if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0)
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 5b2dfa9..45fd056 100644
--- binutils-2.9.1.orig/opcodes/ppc-opc.c
+++ binutils-2.9.1/opcodes/ppc-opc.c
@@ -1,5 +1,5 @@
 /* ppc-opc.c -- PowerPC opcode list
-   Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (c) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support
 
 This file is part of GDB, GAS, and the GNU binutils.
@@ -22,6 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <stdio.h>
 #include "ansidecl.h"
 #include "opcode/ppc.h"
+/*#include "opintl.h"*/
+#define _(x) x
 
 /* This file holds the PowerPC opcode table.  The opcode table
    includes almost all of the extended instruction mnemonics.  This
@@ -77,7 +79,14 @@ static long extract_tbr PARAMS ((unsigned long, int *));
 
 /* The operands table.
 
-   The fields are bits, shift, insert, extract, flags.  */
+   The fields are bits, shift, insert, extract, flags.
+
+   We used to put parens around the various additions, like the one
+   for BA just below.  However, that caused trouble with feeble
+   compilers with a limit on depth of a parenthesized expression, like
+   (reportedly) the compiler in Microsoft Developer Studio 5.  So we
+   omit the parens, since the macros are never used in a context where
+   the addition will be ambiguous.  */
 
 const struct powerpc_operand powerpc_operands[] =
 {
@@ -87,177 +96,177 @@ const struct powerpc_operand powerpc_operands[] =
   { 0, 0, 0, 0, 0 },
 
   /* The BA field in an XL form instruction.  */
-#define BA (UNUSED + 1)
+#define BA UNUSED + 1
 #define BA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BA field in an XL form instruction when it must be the same
      as the BT field in the same instruction.  */
-#define BAT (BA + 1)
+#define BAT BA + 1
   { 5, 16, insert_bat, extract_bat, PPC_OPERAND_FAKE },
 
   /* The BB field in an XL form instruction.  */
-#define BB (BAT + 1)
+#define BB BAT + 1
 #define BB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_CR },
 
   /* The BB field in an XL form instruction when it must be the same
      as the BA field in the same instruction.  */
-#define BBA (BB + 1)
+#define BBA BB + 1
   { 5, 11, insert_bba, extract_bba, PPC_OPERAND_FAKE },
 
   /* The BD field in a B form instruction.  The lower two bits are
      forced to zero.  */
-#define BD (BBA + 1)
+#define BD BBA + 1
   { 16, 0, insert_bd, extract_bd, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when absolute addressing is
      used.  */
-#define BDA (BD + 1)
+#define BDA BD + 1
   { 16, 0, insert_bd, extract_bd, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the - modifier is used.
      This sets the y bit of the BO field appropriately.  */
-#define BDM (BDA + 1)
+#define BDM BDA + 1
   { 16, 0, insert_bdm, extract_bdm,
       PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the - modifier is used
      and absolute address is used.  */
-#define BDMA (BDM + 1)
+#define BDMA BDM + 1
   { 16, 0, insert_bdm, extract_bdm,
       PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the + modifier is used.
      This sets the y bit of the BO field appropriately.  */
-#define BDP (BDMA + 1)
+#define BDP BDMA + 1
   { 16, 0, insert_bdp, extract_bdp,
       PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The BD field in a B form instruction when the + modifier is used
      and absolute addressing is used.  */
-#define BDPA (BDP + 1)
+#define BDPA BDP + 1
   { 16, 0, insert_bdp, extract_bdp,
       PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The BF field in an X or XL form instruction.  */
-#define BF (BDPA + 1)
+#define BF BDPA + 1
   { 3, 23, 0, 0, PPC_OPERAND_CR },
 
   /* An optional BF field.  This is used for comparison instructions,
      in which an omitted BF field is taken as zero.  */
-#define OBF (BF + 1)
+#define OBF BF + 1
   { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The BFA field in an X or XL form instruction.  */
-#define BFA (OBF + 1)
+#define BFA OBF + 1
   { 3, 18, 0, 0, PPC_OPERAND_CR },
 
   /* The BI field in a B form or XL form instruction.  */
-#define BI (BFA + 1)
+#define BI BFA + 1
 #define BI_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_CR },
 
   /* The BO field in a B form instruction.  Certain values are
      illegal.  */
-#define BO (BI + 1)
+#define BO BI + 1
 #define BO_MASK (0x1f << 21)
   { 5, 21, insert_bo, extract_bo, 0 },
 
   /* The BO field in a B form instruction when the + or - modifier is
      used.  This is like the BO field, but it must be even.  */
-#define BOE (BO + 1)
+#define BOE BO + 1
   { 5, 21, insert_boe, extract_boe, 0 },
 
   /* The BT field in an X or XL form instruction.  */
-#define BT (BOE + 1)
+#define BT BOE + 1
   { 5, 21, 0, 0, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
      or XL form instruction.  This is used for the extended
      conditional branch mnemonics, which set the lower two bits of the
      BI field.  This field is optional.  */
-#define CR (BT + 1)
+#define CR BT + 1
   { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The D field in a D form instruction.  This is a displacement off
      a register, and implies that the next operand is a register in
      parentheses.  */
-#define D (CR + 1)
+#define D CR + 1
   { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The DS field in a DS form instruction.  This is like D, but the
      lower two bits are forced to zero.  */
-#define DS (D + 1)
+#define DS D + 1
   { 16, 0, insert_ds, extract_ds, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The E field in a wrteei instruction.  */
-#define E (DS + 1)
+#define E DS + 1
   { 1, 15, 0, 0, 0 },
 
   /* The FL1 field in a POWER SC form instruction.  */
-#define FL1 (E + 1)
+#define FL1 E + 1
   { 4, 12, 0, 0, 0 },
 
   /* The FL2 field in a POWER SC form instruction.  */
-#define FL2 (FL1 + 1)
+#define FL2 FL1 + 1
   { 3, 2, 0, 0, 0 },
 
   /* The FLM field in an XFL form instruction.  */
-#define FLM (FL2 + 1)
+#define FLM FL2 + 1
   { 8, 17, 0, 0, 0 },
 
   /* The FRA field in an X or A form instruction.  */
-#define FRA (FLM + 1)
+#define FRA FLM + 1
 #define FRA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRB field in an X or A form instruction.  */
-#define FRB (FRA + 1)
+#define FRB FRA + 1
 #define FRB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRC field in an A form instruction.  */
-#define FRC (FRB + 1)
+#define FRC FRB + 1
 #define FRC_MASK (0x1f << 6)
   { 5, 6, 0, 0, PPC_OPERAND_FPR },
 
   /* The FRS field in an X form instruction or the FRT field in a D, X
      or A form instruction.  */
-#define FRS (FRC + 1)
-#define FRT (FRS)
+#define FRS FRC + 1
+#define FRT FRS
   { 5, 21, 0, 0, PPC_OPERAND_FPR },
 
   /* The FXM field in an XFX instruction.  */
-#define FXM (FRS + 1)
+#define FXM FRS + 1
 #define FXM_MASK (0xff << 12)
   { 8, 12, 0, 0, 0 },
 
   /* The L field in a D or X form instruction.  */
-#define L (FXM + 1)
+#define L FXM + 1
   { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL },
 
   /* The LEV field in a POWER SC form instruction.  */
-#define LEV (L + 1)
+#define LEV L + 1
   { 7, 5, 0, 0, 0 },
 
   /* The LI field in an I form instruction.  The lower two bits are
      forced to zero.  */
-#define LI (LEV + 1)
+#define LI LEV + 1
   { 26, 0, insert_li, extract_li, PPC_OPERAND_RELATIVE | PPC_OPERAND_SIGNED },
 
   /* The LI field in an I form instruction when used as an absolute
      address.  */
-#define LIA (LI + 1)
+#define LIA LI + 1
   { 26, 0, insert_li, extract_li, PPC_OPERAND_ABSOLUTE | PPC_OPERAND_SIGNED },
 
   /* The MB field in an M form instruction.  */
-#define MB (LIA + 1)
+#define MB LIA + 1
 #define MB_MASK (0x1f << 6)
   { 5, 6, 0, 0, 0 },
 
   /* The ME field in an M form instruction.  */
-#define ME (MB + 1)
+#define ME MB + 1
 #define ME_MASK (0x1f << 1)
   { 5, 1, 0, 0, 0 },
 
@@ -265,129 +274,172 @@ const struct powerpc_operand powerpc_operands[] =
      operand which is a bitmask indicating which bits to select.  This
      is a two operand form using PPC_OPERAND_NEXT.  See the
      description in opcode/ppc.h for what this means.  */
-#define MBE (ME + 1)
+#define MBE ME + 1
   { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
   { 32, 0, insert_mbe, extract_mbe, 0 },
 
   /* The MB or ME field in an MD or MDS form instruction.  The high
      bit is wrapped to the low end.  */
-#define MB6 (MBE + 2)
-#define ME6 (MB6)
+#define MB6 MBE + 2
+#define ME6 MB6
 #define MB6_MASK (0x3f << 5)
   { 6, 5, insert_mb6, extract_mb6, 0 },
 
   /* The NB field in an X form instruction.  The value 32 is stored as
      0.  */
-#define NB (MB6 + 1)
+#define NB MB6 + 1
   { 6, 11, insert_nb, extract_nb, 0 },
 
   /* The NSI field in a D form instruction.  This is the same as the
      SI field, only negated.  */
-#define NSI (NB + 1)
+#define NSI NB + 1
   { 16, 0, insert_nsi, extract_nsi,
       PPC_OPERAND_NEGATIVE | PPC_OPERAND_SIGNED },
 
   /* The RA field in an D, DS, X, XO, M, or MDS form instruction.  */
-#define RA (NSI + 1)
+#define RA NSI + 1
 #define RA_MASK (0x1f << 16)
   { 5, 16, 0, 0, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      load, which means that the RA field may not be zero and may not
      equal the RT field.  */
-#define RAL (RA + 1)
+#define RAL RA + 1
   { 5, 16, insert_ral, 0, PPC_OPERAND_GPR },
 
   /* The RA field in an lmw instruction, which has special value
      restrictions.  */
-#define RAM (RAL + 1)
+#define RAM RAL + 1
   { 5, 16, insert_ram, 0, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      store or an updating floating point load, which means that the RA
      field may not be zero.  */
-#define RAS (RAM + 1)
+#define RAS RAM + 1
   { 5, 16, insert_ras, 0, PPC_OPERAND_GPR },
 
   /* The RB field in an X, XO, M, or MDS form instruction.  */
-#define RB (RAS + 1)
+#define RB RAS + 1
 #define RB_MASK (0x1f << 11)
   { 5, 11, 0, 0, PPC_OPERAND_GPR },
 
   /* The RB field in an X form instruction when it must be the same as
      the RS field in the instruction.  This is used for extended
      mnemonics like mr.  */
-#define RBS (RB + 1)
+#define RBS RB + 1
   { 5, 1, insert_rbs, extract_rbs, PPC_OPERAND_FAKE },
 
   /* The RS field in a D, DS, X, XFX, XS, M, MD or MDS form
      instruction or the RT field in a D, DS, X, XFX or XO form
      instruction.  */
-#define RS (RBS + 1)
-#define RT (RS)
+#define RS RBS + 1
+#define RT RS
 #define RT_MASK (0x1f << 21)
   { 5, 21, 0, 0, PPC_OPERAND_GPR },
 
   /* The SH field in an X or M form instruction.  */
-#define SH (RS + 1)
+#define SH RS + 1
 #define SH_MASK (0x1f << 11)
   { 5, 11, 0, 0, 0 },
 
   /* The SH field in an MD form instruction.  This is split.  */
-#define SH6 (SH + 1)
+#define SH6 SH + 1
 #define SH6_MASK ((0x1f << 11) | (1 << 1))
   { 6, 1, insert_sh6, extract_sh6, 0 },
 
   /* The SI field in a D form instruction.  */
-#define SI (SH6 + 1)
+#define SI SH6 + 1
   { 16, 0, 0, 0, PPC_OPERAND_SIGNED },
 
   /* The SI field in a D form instruction when we accept a wide range
      of positive values.  */
-#define SISIGNOPT (SI + 1)
+#define SISIGNOPT SI + 1
   { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
 
   /* The SPR field in an XFX form instruction.  This is flipped--the
      lower 5 bits are stored in the upper 5 and vice- versa.  */
-#define SPR (SISIGNOPT + 1)
+#define SPR SISIGNOPT + 1
 #define SPR_MASK (0x3ff << 11)
   { 10, 11, insert_spr, extract_spr, 0 },
 
   /* The BAT index number in an XFX form m[ft]ibat[lu] instruction.  */
-#define SPRBAT (SPR + 1)
+#define SPRBAT SPR + 1
 #define SPRBAT_MASK (0x3 << 17)
   { 2, 17, 0, 0, 0 },
 
   /* The SPRG register number in an XFX form m[ft]sprg instruction.  */
-#define SPRG (SPRBAT + 1)
+#define SPRG SPRBAT + 1
 #define SPRG_MASK (0x3 << 16)
   { 2, 16, 0, 0, 0 },
 
   /* The SR field in an X form instruction.  */
-#define SR (SPRG + 1)
+#define SR SPRG + 1
   { 4, 16, 0, 0, 0 },
 
   /* The SV field in a POWER SC form instruction.  */
-#define SV (SR + 1)
+#define SV SR + 1
   { 14, 2, 0, 0, 0 },
 
   /* The TBR field in an XFX form instruction.  This is like the SPR
      field, but it is optional.  */
-#define TBR (SV + 1)
+#define TBR SV + 1
   { 10, 11, insert_tbr, extract_tbr, PPC_OPERAND_OPTIONAL },
 
   /* The TO field in a D or X form instruction.  */
-#define TO (TBR + 1)
+#define TO TBR + 1
 #define TO_MASK (0x1f << 21)
   { 5, 21, 0, 0, 0 },
 
   /* The U field in an X form instruction.  */
-#define U (TO + 1)
+#define U TO + 1
   { 4, 12, 0, 0, 0 },
 
   /* The UI field in a D form instruction.  */
-#define UI (U + 1)
+#define UI U + 1
   { 16, 0, 0, 0, 0 },
+
+  /* AltiVec extensions */
+
+  /* The VA field in a VX or VA form instruction. */
+#define VRA (UI + 1)
+#define VRA_MASK (0x1f << 16)
+  { 5, 16, 0, 0, PPC_OPERAND_VR },
+
+  /* The VB field in a VX or VA form instruction. */
+#define VRB (VRA + 1)
+#define VRB_MASK (0x1f << 11)
+  { 5, 11, 0, 0, PPC_OPERAND_VR },
+
+  /* The VC field in a VA form instruction. */
+#define VRC (VRB + 1)
+#define VRC_MASK (0x1f << 6)
+  { 5, 6, 0, 0, PPC_OPERAND_VR },
+
+  /* The VS or VT field in an X form instruction, or the VT field
+     in a VX or VA instruction. */
+#define VRS (VRC + 1)
+#define VRT (VRS)
+#define VRT_MASK (0x1f << 21)
+  { 5, 21, 0, 0, PPC_OPERAND_VR },
+
+  /* The SH field in the "vsldoi" instruction. */
+#define VSH (VRS + 1)
+  { 4, 6, 0, 0, 0 },
+
+  /* The UIM field in the VX form instruction. */
+#define VUI (VSH + 1)
+  { 5, 16, 0, 0, 0 },
+
+  /* The SIM field in the VX form instruction. */
+#define VSI (VUI + 1)
+  { 5, 16, 0, 0, PPC_OPERAND_SIGNED },
+
+  /* The TAG field in the XV form instruction. */
+  /* Note: there are two bits if growing room in the TAG fields,
+   * leaving room for 16 (versus 4) potential streams. */
+#define TAG (VSI + 1)
+#define TAG_MASK (0x3 << 21)
+  { 2, 21, 0, 0, 0 },
 };
 
 /* The functions used to insert and extract complicated operands.  */
@@ -575,7 +627,7 @@ insert_bo (insn, value, errmsg)
 {
   if (errmsg != (const char **) NULL
       && ! valid_bo (value))
-    *errmsg = "invalid conditional option";
+    *errmsg = _("invalid conditional option");
   return insn | ((value & 0x1f) << 21);
 }
 
@@ -606,9 +658,9 @@ insert_boe (insn, value, errmsg)
   if (errmsg != (const char **) NULL)
     {
       if (! valid_bo (value))
-	*errmsg = "invalid conditional option";
+	*errmsg = _("invalid conditional option");
       else if ((value & 1) != 0)
-	*errmsg = "attempt to set y bit when using + or - modifier";
+	*errmsg = _("attempt to set y bit when using + or - modifier");
     }
   return insn | ((value & 0x1f) << 21);
 }
@@ -663,7 +715,7 @@ insert_li (insn, value, errmsg)
      const char **errmsg;
 {
   if ((value & 3) != 0 && errmsg != (const char **) NULL)
-    *errmsg = "ignoring least significant bits in branch offset";
+    *errmsg = _("ignoring least significant bits in branch offset");
   return insn | (value & 0x3fffffc);
 }
 
@@ -690,40 +742,55 @@ insert_mbe (insn, value, errmsg)
      long value;
      const char **errmsg;
 {
-  unsigned long uval;
-  int mb, me;
+  unsigned long uval, mask;
+  int mb, me, mx, count, last;
 
   uval = value;
 
   if (uval == 0)
     {
       if (errmsg != (const char **) NULL)
-	*errmsg = "illegal bitmask";
+	*errmsg = _("illegal bitmask");
       return insn;
     }
 
-  me = 31;
-  while ((uval & 1) == 0)
-    {
-      uval >>= 1;
-      --me;
-    }
+  mb = 0;
+  me = 32;
+  if ((uval & 1) != 0)
+    last = 1;
+  else
+    last = 0;
+  count = 0;
 
-  mb = me;
-  uval >>= 1;
-  while ((uval & 1) != 0)
+  /* mb: location of last 0->1 transition */
+  /* me: location of last 1->0 transition */
+  /* count: # transitions */
+
+  for (mx = 0, mask = 1 << 31; mx < 32; ++mx, mask >>= 1)
     {
-      uval >>= 1;
-      --mb;
+      if ((uval & mask) && !last)
+	{
+	  ++count;
+	  mb = mx;
+	  last = 1;
+	}
+      else if (!(uval & mask) && last)
+	{
+	  ++count;
+	  me = mx;
+	  last = 0;
+	}
     }
+  if (me == 0)
+    me = 32;
 
-  if (uval != 0)
+  if (count != 2 && (count != 0 || ! last))
     {
       if (errmsg != (const char **) NULL)
-	*errmsg = "illegal bitmask";
+	*errmsg = _("illegal bitmask");
     }
 
-  return insn | (mb << 6) | (me << 1);
+  return insn | (mb << 6) | ((me - 1) << 1);
 }
 
 static long
@@ -738,11 +805,22 @@ extract_mbe (insn, invalid)
   if (invalid != (int *) NULL)
     *invalid = 1;
 
-  ret = 0;
   mb = (insn >> 6) & 0x1f;
   me = (insn >> 1) & 0x1f;
-  for (i = mb; i < me; i++)
-    ret |= 1 << (31 - i);
+  if (mb < me + 1)
+    {
+      ret = 0;
+      for (i = mb; i <= me; i++)
+	ret |= (long) 1 << (31 - i);
+    }
+  else if (mb == me + 1)
+    ret = ~0;
+  else /* (mb > me + 1) */
+    {
+      ret = ~ (long) 0;
+      for (i = me + 1; i < mb; i++)
+	ret &= ~ ((long) 1 << (31 - i));
+    }
   return ret;
 }
 
@@ -778,7 +856,7 @@ insert_nb (insn, value, errmsg)
      const char **errmsg;
 {
   if (value < 0 || value > 32)
-    *errmsg = "value out of range";
+    *errmsg = _("value out of range");
   if (value == 32)
     value = 0;
   return insn | ((value & 0x1f) << 11);
@@ -852,7 +930,7 @@ insert_ram (insn, value, errmsg)
      const char **errmsg;
 {
   if ((unsigned long) value >= ((insn >> 21) & 0x1f))
-    *errmsg = "index register in load range";
+    *errmsg = _("index register in load range");
   return insn | ((value & 0x1f) << 16);
 }
 
@@ -867,7 +945,7 @@ insert_ras (insn, value, errmsg)
      const char **errmsg;
 {
   if (value == 0)
-    *errmsg = "invalid register operand when updating";
+    *errmsg = _("invalid register operand when updating");
   return insn | ((value & 0x1f) << 16);
 }
 
@@ -1071,6 +1149,50 @@ extract_tbr (insn, invalid)
 #define SC(op, sa, lk) (OP (op) | ((((unsigned long)(sa)) & 1) << 1) | ((lk) & 1))
 #define SC_MASK (OP_MASK | (((unsigned long)0x3ff) << 16) | (((unsigned long)1) << 1) | 1)
 
+/* AltiVec extensions.  */
+
+/* A VA form instruction.  */
+#define VA(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3f)))
+#define VA_MASK VA (0x3f, 0x3f)
+
+/* A VX form instruction.  */
+#define VX(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x7ff)))
+
+/* An VX form instruction with the RC bit specified.  */
+#define VXRC(op, xop, rc) (VX ((op), (xop)) | (((rc) & 1)<<10))
+
+/* The mask for a VX form instruction.  */
+/* Was VXRC based, but the RC bit is a don't care in our decode */
+/* I don't understand why X_MASK is based on XRC with 3 parms.  */
+#define VX_MASK VX (0x3f, 0x7ff)
+#define VXRC_MASK VX_MASK
+
+/* A VX_MASK with the VA field fixed.  */
+#define VXVA_MASK (VX_MASK | VRA_MASK)
+
+/* A VX_MASK with the VB field fixed.  */
+#define VXVB_MASK (VX_MASK | VRB_MASK)
+
+/* A VX_MASK with the RT field fixed.  */
+#define VXVT_MASK (VX_MASK | VRT_MASK)
+
+/* A VX_MASK with the VA and VB fields fixed.  */
+#define VXVAVB_MASK (VX_MASK | VRA_MASK | VRB_MASK)
+
+/* A VX_MASK with the VT and VA fields fixed.  */
+#define VXVTVA_MASK (VX_MASK | VRT_MASK | VRA_MASK)
+
+/* An XV form instruction.  */
+#define XV(op, xop, zz) \
+  (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1) | ((((unsigned long)(zz)) & 1) << 25))
+#define XV_MASK XV (0x3f, 0x3ff, 1)
+
+/* An XV_MASK with the RA and RB fields fixed.  */
+#define XVRARB_MASK (XV_MASK | RA_MASK | RB_MASK)
+
+/* An XV_MASK with the RA, RB and TAG fields fixed.  */
+#define XVRARBTG_MASK (XV_MASK | RA_MASK | RB_MASK | TAG_MASK)
+
 /* An X form instruction.  */
 #define X(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
 
@@ -1234,8 +1356,11 @@ extract_tbr (insn, invalid)
 #define PPCCOM	PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_ANY
 #define PPC32   PPC_OPCODE_PPC | PPC_OPCODE_32 | PPC_OPCODE_ANY
 #define PPC64   PPC_OPCODE_PPC | PPC_OPCODE_64 | PPC_OPCODE_ANY
+#define PPCVEC	PPC_OPCODE_VEC | PPC_OPCODE_ANY
+#define	VEC	PPCVEC
 #define PPCONLY	PPC_OPCODE_PPC
 #define PPC403	PPC
+#define PPC750	PPC
 #define PPC860	PPC
 #define	POWER   PPC_OPCODE_POWER | PPC_OPCODE_ANY
 #define	POWER2	PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_ANY
@@ -1314,6 +1439,164 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "twi",     OP(3),	OP_MASK,	PPCCOM,		{ TO, RA, SI } },
 { "ti",      OP(3),	OP_MASK,	PWRCOM,		{ TO, RA, SI } },
 
+{ "vaddubm",    VX(4,0),        VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxub",     VX(4,2),        VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrlb",       VX(4,4),        VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpequb",   VXRC(4,6,0),    VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpequb.",  VXRC(4,6,1),    VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmuloub",    VX(4,8),        VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vaddfp",     VX(4,10),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmrghb",     VX(4,12),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkuhum",    VX(4,14),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmhaddshs",  VA(4,32),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmhraddshs", VA(4,33),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmladduhm",  VA(4,34),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsumubm",   VA(4,36),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsummbm",   VA(4,37),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsumuhm",   VA(4,38),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsumuhs",   VA(4,39),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsumshm",   VA(4,40),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vmsumshs",   VA(4,41),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vsel",       VA(4,42),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vperm",      VA(4,43),       VA_MASK,      VEC,  { VRT, VRA, VRB, VRC } },
+{ "vsldoi",     VA(4,44),       VA_MASK,      VEC,  { VRT, VRA, VRB, VSH } },
+{ "vmaddfp",    VA(4,46),       VA_MASK,      VEC,  { VRT, VRA, VRC, VRB } },
+{ "vnmsubfp",   VA(4,47),       VA_MASK,      VEC,  { VRT, VRA, VRC, VRB } },
+{ "vadduhm",    VX(4,64),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxuh",     VX(4,66),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrlh",       VX(4,68),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpequh",   VXRC(4,70,0),   VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpequh.",  VXRC(4,70,1),   VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmulouh",    VX(4,72),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubfp",     VX(4,74),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmrghh",     VX(4,76),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkuwum",    VX(4,78),       VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vadduwm",    VX(4,128),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxuw",     VX(4,130),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrlw",       VX(4,132),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpequw",   VXRC(4,134,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpequw.",  VXRC(4,134,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmrghw",     VX(4,140),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkuhus",    VX(4,142),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpeqfp",   VXRC(4,198,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpeqfp.",  VXRC(4,198,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vpkuwus",    VX(4,206),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxsb",     VX(4,258),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vslb",       VX(4,260),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmulosb",    VX(4,264),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrefp",      VX(4,266),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vmrglb",     VX(4,268),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkshus",    VX(4,270),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxsh",     VX(4,322),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vslh",       VX(4,324),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmulosh",    VX(4,328),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrsqrtefp",  VX(4,330),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vmrglh",     VX(4,332),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkswus",    VX(4,334),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vaddcuw",    VX(4,384),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxsw",     VX(4,386),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vslw",       VX(4,388),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vexptefp",   VX(4,394),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vmrglw",     VX(4,396),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vpkshss",    VX(4,398),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsl",        VX(4,452),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgefp",   VXRC(4,454,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgefp.",  VXRC(4,454,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vlogefp",    VX(4,458),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vpkswss",    VX(4,462),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vaddubs",    VX(4,512),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminub",     VX(4,514),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsrb",       VX(4,516),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtub",   VXRC(4,518,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtub.",  VXRC(4,518,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmuleub",    VX(4,520),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrfin",      VX(4,522),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vspltb",     VX(4,524),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vupkhsb",    VX(4,526),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vadduhs",    VX(4,576),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminuh",     VX(4,578),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsrh",       VX(4,580),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtuh",   VXRC(4,582,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtuh.",  VXRC(4,582,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmuleuh",    VX(4,584),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vrfiz",      VX(4,586),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vsplth",     VX(4,588),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vupkhsh",    VX(4,590),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vadduws",    VX(4,640),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminuw",     VX(4,642),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsrw",       VX(4,644),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtuw",   VXRC(4,646,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtuw.",  VXRC(4,646,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vrfip",      VX(4,650),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vspltw",     VX(4,652),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vupklsb",    VX(4,654),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vsr",        VX(4,708),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtfp",   VXRC(4,710,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtfp.",  VXRC(4,710,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vrfim",      VX(4,714),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vupklsh",    VX(4,718),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vaddsbs",    VX(4,768),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminsb",     VX(4,770),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsrab",      VX(4,772),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsb",   VXRC(4,774,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsb.",  VXRC(4,774,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmulesb",    VX(4,776),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcfux",      VX(4,778),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vspltisb",   VX(4,780),      VXVB_MASK,    VEC,  { VRT, VSI } },
+{ "vpkpx",      VX(4,782),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vaddshs",    VX(4,832),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminsh",     VX(4,834),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsrah",      VX(4,836),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsh",   VXRC(4,838,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsh.",  VXRC(4,838,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vmulesh",    VX(4,840),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcfsx",      VX(4,842),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vspltish",   VX(4,844),      VXVB_MASK,    VEC,  { VRT, VSI } },
+{ "vupkhpx",    VX(4,846),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vaddsws",    VX(4,896),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminsw",     VX(4,898),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsraw",      VX(4,900),      VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsw",   VXRC(4,902,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpgtsw.",  VXRC(4,902,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vctuxs",     VX(4,906),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vspltisw",   VX(4,908),      VXVB_MASK,    VEC,  { VRT, VSI } },
+{ "vcmpbfp",    VXRC(4,966,0),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vcmpbfp.",   VXRC(4,966,1),  VXRC_MASK,    VEC,  { VRT, VRA, VRB } },
+{ "vctsxs",     VX(4,970),      VX_MASK,      VEC,  { VRT, VRB, VUI } },
+{ "vupklpx",    VX(4,974),      VXVA_MASK,    VEC,  { VRT, VRB } },
+{ "vsububm",    VX(4,1024),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavgub",     VX(4,1026),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vand",       VX(4,1028),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vmaxfp",     VX(4,1034),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vslo",       VX(4,1036),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubuhm",    VX(4,1088),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavguh",     VX(4,1090),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vandc",      VX(4,1092),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vminfp",     VX(4,1098),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsro",       VX(4,1100),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubuwm",    VX(4,1152),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavguw",     VX(4,1154),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vor",        VX(4,1156),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vxor",       VX(4,1220),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavgsb",     VX(4,1282),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vnor",       VX(4,1284),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavgsh",     VX(4,1346),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubcuw",    VX(4,1408),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vavgsw",     VX(4,1410),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsububs",    VX(4,1536),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "mfvscr",     VX(4,1540),     VXVAVB_MASK,  VEC,  { VRT } },
+{ "vsum4ubs",   VX(4,1544),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubuhs",    VX(4,1600),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "mtvscr",     VX(4,1604),     VXVTVA_MASK,  VEC,  { VRB } },
+{ "vsum4shs",   VX(4,1608),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubuws",    VX(4,1664),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsum2sws",   VX(4,1672),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubsbs",    VX(4,1792),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsum4sbs",   VX(4,1800),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubshs",    VX(4,1856),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsubsws",    VX(4,1920),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+{ "vsumsws",    VX(4,1928),     VX_MASK,      VEC,  { VRT, VRA, VRB } },
+
 { "mulli",   OP(7),	OP_MASK,	PPCCOM,		{ RT, RA, SI } },
 { "muli",    OP(7),	OP_MASK,	PWRCOM,		{ RT, RA, SI } },
 
@@ -2016,6 +2299,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "tw",      X(31,4),	X_MASK,		PPCCOM,		{ TO, RA, RB } },
 { "t",       X(31,4),	X_MASK,		PWRCOM,		{ TO, RA, RB } },
 
+{ "lvsl",    X(31,6),   X_MASK,         VEC,           { VRT, RA, RB } },
+{ "lvebx",   X(31,7),   X_MASK,         VEC,           { VRT, RA, RB } },
+
 { "subfc",   XO(31,8,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
 { "sf",      XO(31,8,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 { "subc",    XO(31,8,0,0), XO_MASK,	PPC,		{ RT, RB, RA } },
@@ -2061,7 +2347,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "cntlzw",  XRC(31,26,0), XRB_MASK,	PPCCOM,		{ RA, RS } },
 { "cntlz",   XRC(31,26,0), XRB_MASK,	PWRCOM,		{ RA, RS } },
 { "cntlzw.", XRC(31,26,1), XRB_MASK,	PPCCOM,		{ RA, RS } },
-{ "cntlz.",  XRC(31,26,1), XRB_MASK, 	PWRCOM,		{ RA, RS } },
+{ "cntlz.",  XRC(31,26,1), XRB_MASK,	PWRCOM,		{ RA, RS } },
 
 { "sld",     XRC(31,27,0), X_MASK,	PPC64,		{ RA, RS, RB } },
 { "sld.",    XRC(31,27,1), X_MASK,	PPC64,		{ RA, RS, RB } },
@@ -2077,6 +2363,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "cmpl",    X(31,32),	XCMP_MASK,	 PPCONLY,	{ BF, L, RA, RB } },
 { "cmpl",    X(31,32),	XCMPL_MASK,	 PWRCOM,	{ BF, RA, RB } },
 
+{ "lvsr",    X(31,38),  X_MASK,         VEC,           { VRT, RA, RB } },
+{ "lvehx",   X(31,39),  X_MASK,         VEC,           { VRT, RA, RB } },
+
 { "subf",    XO(31,40,0,0), XO_MASK,	PPC,		{ RT, RA, RB } },
 { "sub",     XO(31,40,0,0), XO_MASK,	PPC,		{ RT, RB, RA } },
 { "subf.",   XO(31,40,0,1), XO_MASK,	PPC,		{ RT, RA, RB } },
@@ -2115,6 +2404,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "tdne",    XTO(31,68,TONE), XTO_MASK,  PPC64,		{ RA, RB } },
 { "td",	     X(31,68),	X_MASK,		 PPC64,		{ TO, RA, RB } },
 
+{ "lvewx",   X(31,71),  X_MASK,         VEC,           { VRT, RA, RB } },
+
 { "mulhd",   XO(31,73,0,0), XO_MASK,	 PPC64,		{ RT, RA, RB } },
 { "mulhd.",  XO(31,73,0,1), XO_MASK,	 PPC64,		{ RT, RA, RB } },
 
@@ -2129,6 +2420,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "lbzx",    X(31,87),	X_MASK,		COM,		{ RT, RA, RB } },
 
+{ "lvx",     X(31,103), X_MASK,         VEC,           { VRT, RA, RB } },
+
 { "neg",     XO(31,104,0,0), XORB_MASK,	COM,		{ RT, RA } },
 { "neg.",    XO(31,104,0,1), XORB_MASK,	COM,		{ RT, RA } },
 { "nego",    XO(31,104,1,0), XORB_MASK,	COM,		{ RT, RA } },
@@ -2150,6 +2443,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "wrtee",   X(31,131),	XRARB_MASK,	PPC403,		{ RS } },
 
+{ "stvebx",  X(31,135), X_MASK,         VEC,           { VRS, RA, RB } },
+
 { "subfe",   XO(31,136,0,0), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
 { "sfe",     XO(31,136,0,0), XO_MASK,	PWRCOM,		{ RT, RA, RB } },
 { "subfe.",  XO(31,136,0,1), XO_MASK,	PPCCOM,		{ RT, RA, RB } },
@@ -2188,6 +2483,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "wrteei",  X(31,163),	XE_MASK,	PPC403,		{ E } },
 
+{ "stvehx",  X(31,167), X_MASK,         VEC,           { VRS, RA, RB } },
+
 { "stdux",   X(31,181),	X_MASK,		PPC64,		{ RS, RAS, RB } },
 
 { "stwux",   X(31,183),	X_MASK,		PPCCOM,		{ RS, RAS, RB } },
@@ -2196,6 +2493,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "sliq",    XRC(31,184,0), X_MASK,	M601,		{ RA, RS, SH } },
 { "sliq.",   XRC(31,184,1), X_MASK,	M601,		{ RA, RS, SH } },
 
+{ "stvewx",  X(31,199), X_MASK,         VEC,           { VRS, RA, RB } },
+
 { "subfze",  XO(31,200,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
 { "sfze",    XO(31,200,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
 { "subfze.", XO(31,200,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
@@ -2226,6 +2525,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "sleq",    XRC(31,217,0), X_MASK,	M601,		{ RA, RS, RB } },
 { "sleq.",   XRC(31,217,1), X_MASK,	M601,		{ RA, RS, RB } },
 
+{ "stvx",    X(31,231), X_MASK,         VEC,           { VRS, RA, RB } },
+
 { "subfme",  XO(31,232,0,0), XORB_MASK, PPCCOM,		{ RT, RA } },
 { "sfme",    XO(31,232,0,0), XORB_MASK, PWRCOM,		{ RT, RA } },
 { "subfme.", XO(31,232,0,1), XORB_MASK, PPCCOM,		{ RT, RA } },
@@ -2416,7 +2717,23 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "mfmd_dbcam", XSPR(31,339,824), XSPR_MASK, PPC860,	{ RT } },
 { "mfmd_dbram0",XSPR(31,339,825), XSPR_MASK, PPC860,	{ RT } },
 { "mfmd_dbram1",XSPR(31,339,826), XSPR_MASK, PPC860,	{ RT } },
+{ "mfzpr",   XSPR(31,339,944), XSPR_MASK, PPC403,	{ RT } },
+{ "mfpid",   XSPR(31,339,945), XSPR_MASK, PPC403,	{ RT } },
 { "mficdbdr",XSPR(31,339,979), XSPR_MASK, PPC403,	{ RT } },
+{ "mfummcr0",	XSPR(31,339,936),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfupmc1",	XSPR(31,339,937),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfupmc2",	XSPR(31,339,938),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfusia",	XSPR(31,339,939),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfummcr1",	XSPR(31,339,940),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfupmc3",	XSPR(31,339,941),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfupmc4",	XSPR(31,339,942),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfmmcr0",	XSPR(31,339,952),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc1",	XSPR(31,339,953),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc2",	XSPR(31,339,954),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfsia",	XSPR(31,339,955),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfmmcr1",	XSPR(31,339,956),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc3",	XSPR(31,339,957),  XSPR_MASK, PPC750,	{ RT } },
+{ "mfpmc4",	XSPR(31,339,958),  XSPR_MASK, PPC750,	{ RT } },
 { "mfesr",   XSPR(31,339,980), XSPR_MASK, PPC403,	{ RT } },
 { "mfdear",  XSPR(31,339,981), XSPR_MASK, PPC403,	{ RT } },
 { "mfevpr",  XSPR(31,339,982), XSPR_MASK, PPC403,	{ RT } },
@@ -2439,6 +2756,11 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "mfpbu1",  XSPR(31,339,1021), XSPR_MASK, PPC403,	{ RT } },
 { "mfpbl2",  XSPR(31,339,1022), XSPR_MASK, PPC403,	{ RT } },
 { "mfpbu2",  XSPR(31,339,1023), XSPR_MASK, PPC403,	{ RT } },
+{ "mfl2cr",	XSPR(31,339,1017), XSPR_MASK, PPC750,	{ RT } },
+{ "mfictc",	XSPR(31,339,1019), XSPR_MASK, PPC750,	{ RT } },
+{ "mfthrm1",	XSPR(31,339,1020), XSPR_MASK, PPC750,	{ RT } },
+{ "mfthrm2",	XSPR(31,339,1021), XSPR_MASK, PPC750,	{ RT } },
+{ "mfthrm3",	XSPR(31,339,1022), XSPR_MASK, PPC750,	{ RT } },
 { "mfspr",   X(31,339),	X_MASK,		COM,		{ RT, SPR } },
 
 { "lwax",    X(31,341),	X_MASK,		PPC64,		{ RT, RA, RB } },
@@ -2447,6 +2769,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "dccci",   X(31,454),	XRT_MASK,	PPC,		{ RA, RB } },
 
+{ "lvxl",    X(31,359), X_MASK,         VEC,           { VRT, RA, RB } },
+
 { "abs",     XO(31,360,0,0), XORB_MASK, M601,		{ RT, RA } },
 { "abs.",    XO(31,360,0,1), XORB_MASK, M601,		{ RT, RA } },
 { "abso",    XO(31,360,1,0), XORB_MASK, M601,		{ RT, RA } },
@@ -2527,6 +2851,25 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "mtdmasa3", XSPR(31,451,219), XSPR_MASK, PPC403,	{ RT } },
 { "mtdmacc3", XSPR(31,451,220), XSPR_MASK, PPC403,	{ RT } },
 { "mtdmasr", XSPR(31,451,224), XSPR_MASK, PPC403,	{ RT } },
+{ "mtummcr0",	XSPR(31,451,936),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtupmc1",	XSPR(31,451,937),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtupmc2",	XSPR(31,451,938),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtusia",	XSPR(31,451,939),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtummcr1",	XSPR(31,451,940),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtupmc3",	XSPR(31,451,941),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtupmc4",	XSPR(31,451,942),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtmmcr0",	XSPR(31,451,952),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtpmc1",	XSPR(31,451,953),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtpmc2",	XSPR(31,451,954),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtsia",	XSPR(31,451,955),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtmmcr1",	XSPR(31,451,956),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtpmc3",	XSPR(31,451,957),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtpmc4",	XSPR(31,451,958),  XSPR_MASK, PPC750,	{ RT } },
+{ "mtl2cr",	XSPR(31,451,1017), XSPR_MASK, PPC750,	{ RT } },
+{ "mtictc",	XSPR(31,451,1019), XSPR_MASK, PPC750,	{ RT } },
+{ "mtthrm1",	XSPR(31,451,1020), XSPR_MASK, PPC750,	{ RT } },
+{ "mtthrm2",	XSPR(31,451,1021), XSPR_MASK, PPC750,	{ RT } },
+{ "mtthrm3",	XSPR(31,451,1022), XSPR_MASK, PPC750,	{ RT } },
 { "mtdcr",   X(31,451),	X_MASK,		PPC,		{ SPR, RS } },
 
 { "divdu",   XO(31,457,0,0), XO_MASK,	PPC64,		{ RT, RA, RB } },
@@ -2582,6 +2925,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "mtibatl", XSPR(31,467,529), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
 { "mtdbatu", XSPR(31,467,536), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
 { "mtdbatl", XSPR(31,467,537), XSPRBAT_MASK, PPC,	{ SPRBAT, RS } },
+{ "mtzpr",   XSPR(31,467,944), XSPR_MASK, PPC403,	{ RT } },
+{ "mtpid",   XSPR(31,467,945), XSPR_MASK, PPC403,	{ RT } },
 { "mticdbdr",XSPR(31,467,979), XSPR_MASK, PPC403,	{ RT } },
 { "mtesr",   XSPR(31,467,980), XSPR_MASK, PPC403,	{ RT } },
 { "mtevpr",  XSPR(31,467,982), XSPR_MASK, PPC403,	{ RT } },
@@ -2613,6 +2958,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "dcread",  X(31,486),	XRT_MASK,	PPC403,		{ RA, RB } },
 
+{ "stvxl",   X(31,487), X_MASK,         VEC,           { VRS, RA, RB } },
+
 { "nabs",    XO(31,488,0,0), XORB_MASK, M601,		{ RT, RA } },
 { "nabs.",   XO(31,488,0,1), XORB_MASK, M601,		{ RT, RA } },
 { "nabso",   XO(31,488,1,0), XORB_MASK, M601,		{ RT, RA } },
@@ -2710,6 +3057,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "sreq",    XRC(31,729,0), X_MASK,	M601,		{ RA, RS, RB } },
 { "sreq.",   XRC(31,729,1), X_MASK,	M601,		{ RA, RS, RB } },
 
+{ "dcba",    X(31,758),	XRT_MASK,	PPC403,		{ RA, RB } },
+
 { "stfdux",  X(31,759),	X_MASK,		COM,		{ FRS, RAS, RB } },
 
 { "srliq",   XRC(31,760,0), X_MASK,	M601,		{ RA, RS, SH } },
@@ -2734,6 +3083,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "eieio",   X(31,854),	0xffffffff,	PPC,		{ 0 } },
 
+{ "tlbsx",   XRC(31,914,0), X_MASK, PPC403,	{ RT, RA, RB } },
+{ "tlbsx.",  XRC(31,914,1), X_MASK, PPC403,	{ RT, RA, RB } },
+
 { "sthbrx",  X(31,918),	X_MASK,		COM,		{ RS, RA, RB } },
 
 { "sraq",    XRC(31,920,0), X_MASK,	M601,		{ RA, RS, RB } },
@@ -2747,6 +3099,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "extsh.",  XRC(31,922,1), XRB_MASK,	PPCCOM,		{ RA, RS } },
 { "exts.",   XRC(31,922,1), XRB_MASK,	PWRCOM,		{ RA, RS } },
 
+{ "tlbre",   X(31,946),	X_MASK,		PPC403,		{ RT, RA, SH } },
+
 { "sraiq",   XRC(31,952,0), X_MASK,	M601,		{ RA, RS, SH } },
 { "sraiq.",  XRC(31,952,1), X_MASK,	M601,		{ RA, RS, SH } },
 
@@ -2756,6 +3110,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "iccci",   X(31,966),	XRT_MASK,	PPC,		{ RA, RB } },
 
 { "tlbld",   X(31,978),	XRTRA_MASK,	PPC,		{ RB } },
+{ "tlbwe",   X(31,978),	X_MASK,		PPC403,		{ RS, RA, SH } },
 
 { "icbi",    X(31,982),	XRT_MASK,	PPC,		{ RA, RB } },
 
@@ -2771,6 +3126,14 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "dcbz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 { "dclz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 
+{ "dst",     XV(31,342,0), XV_MASK,     VEC,           { RA, RB, TAG } },
+{ "dstt",    XV(31,342,1), XV_MASK,     VEC,           { RA, RB, TAG } },
+{ "dstst",   XV(31,374,0), XV_MASK,     VEC,           { RA, RB, TAG } },
+{ "dststt",  XV(31,374,1), XV_MASK,     VEC,           { RA, RB, TAG } },
+
+{ "dss",     XV(31,822,0), XVRARB_MASK, VEC,           { TAG } },
+{ "dssall",  XV(31,822,1), XVRARBTG_MASK, VEC,         { 0 } },
+
 { "lwz",     OP(32),	OP_MASK,	PPCCOM,		{ RT, D, RA } },
 { "l",	     OP(32),	OP_MASK,	PWRCOM,		{ RT, D, RA } },
 
@@ -2977,6 +3340,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 { "fcfid",   XRC(63,846,0), XRA_MASK,	PPC64,		{ FRT, FRB } },
 { "fcfid.",  XRC(63,846,1), XRA_MASK,	PPC64,		{ FRT, FRB } },
 
+{ "mfvrsave",   XSPR(31,339,256),  XSPR_MASK, PPCVEC,       { RT } },
+{ "mtvrsave",  XSPR(31,467,256),  XSPR_MASK, PPCVEC,        { RS } },
+
 };
 
 const int powerpc_num_opcodes =
@@ -2984,6 +3350,16 @@ const int powerpc_num_opcodes =
 
 /* The macro table.  This is only used by the assembler.  */
 
+/* The expressions of the form (-x ! 31) & (x | 31) have the value 0
+   when x=0; 32-x when x is between 1 and 31; are negative if x is
+   negative; and are 32 or more otherwise.  This is what you want
+   when, for instance, you are emulating a right shift by a
+   rotate-left-and-mask, because the underlying instructions support
+   shifts of size 0 but not shifts of size 32.  By comparison, when
+   extracting x bits from some word you want to use just 32-x, because
+   the underlying instructions don't support extracting 0 bits but do
+   support extracting the whole word (32 bits in this case).  */
+
 const struct powerpc_macro powerpc_macros[] = {
 { "extldi",  4,   PPC64,	"rldicr %0,%1,%3,(%2)-1" },
 { "extldi.", 4,   PPC64,	"rldicr. %0,%1,%3,(%2)-1" },
@@ -2991,12 +3367,12 @@ const struct powerpc_macro powerpc_macros[] = {
 { "extrdi.", 4,   PPC64,	"rldicl. %0,%1,(%2)+(%3),64-(%2)" },
 { "insrdi",  4,   PPC64,	"rldimi %0,%1,64-((%2)+(%3)),%3" },
 { "insrdi.", 4,   PPC64,	"rldimi. %0,%1,64-((%2)+(%3)),%3" },
-{ "rotrdi",  3,   PPC64,	"rldicl %0,%1,64-(%2),0" },
-{ "rotrdi.", 3,   PPC64,	"rldicl. %0,%1,64-(%2),0" },
+{ "rotrdi",  3,   PPC64,	"rldicl %0,%1,(-(%2)!63)&((%2)|63),0" },
+{ "rotrdi.", 3,   PPC64,	"rldicl. %0,%1,(-(%2)!63)&((%2)|63),0" },
 { "sldi",    3,   PPC64,	"rldicr %0,%1,%2,63-(%2)" },
 { "sldi.",   3,   PPC64,	"rldicr. %0,%1,%2,63-(%2)" },
-{ "srdi",    3,   PPC64,	"rldicl %0,%1,64-(%2),%2" },
-{ "srdi.",   3,   PPC64,	"rldicl. %0,%1,64-(%2),%2" },
+{ "srdi",    3,   PPC64,	"rldicl %0,%1,(-(%2)!63)&((%2)|63),%2" },
+{ "srdi.",   3,   PPC64,	"rldicl. %0,%1,(-(%2)!63)&((%2)|63),%2" },
 { "clrrdi",  3,   PPC64,	"rldicr %0,%1,0,63-(%2)" },
 { "clrrdi.", 3,   PPC64,	"rldicr. %0,%1,0,63-(%2)" },
 { "clrlsldi",4,   PPC64,	"rldic %0,%1,%3,(%2)-(%3)" },
@@ -3006,20 +3382,20 @@ const struct powerpc_macro powerpc_macros[] = {
 { "extlwi.", 4,   PPCCOM,	"rlwinm. %0,%1,%3,0,(%2)-1" },
 { "extrwi",  4,   PPCCOM,	"rlwinm %0,%1,(%2)+(%3),32-(%2),31" },
 { "extrwi.", 4,   PPCCOM,	"rlwinm. %0,%1,(%2)+(%3),32-(%2),31" },
-{ "inslwi",  4,   PPCCOM,	"rlwimi %0,%1,32-(%3),%3,(%2)+(%3)-1" },
-{ "inslwi.", 4,   PPCCOM,	"rlwimi. %0,%1,32-(%3),%3,(%2)+(%3)-1" },
+{ "inslwi",  4,   PPCCOM,	"rlwimi %0,%1,(-(%3)!31)&((%3)|31),%3,(%2)+(%3)-1" },
+{ "inslwi.", 4,   PPCCOM,	"rlwimi. %0,%1,(-(%3)!31)&((%3)|31),%3,(%2)+(%3)-1"},
 { "insrwi",  4,   PPCCOM,	"rlwimi %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1" },
 { "insrwi.", 4,   PPCCOM,	"rlwimi. %0,%1,32-((%2)+(%3)),%3,(%2)+(%3)-1"},
-{ "rotrwi",  3,   PPCCOM,	"rlwinm %0,%1,32-(%2),0,31" },
-{ "rotrwi.", 3,   PPCCOM,	"rlwinm. %0,%1,32-(%2),0,31" },
+{ "rotrwi",  3,   PPCCOM,	"rlwinm %0,%1,(-(%2)!31)&((%2)|31),0,31" },
+{ "rotrwi.", 3,   PPCCOM,	"rlwinm. %0,%1,(-(%2)!31)&((%2)|31),0,31" },
 { "slwi",    3,   PPCCOM,	"rlwinm %0,%1,%2,0,31-(%2)" },
 { "sli",     3,   PWRCOM,	"rlinm %0,%1,%2,0,31-(%2)" },
 { "slwi.",   3,   PPCCOM,	"rlwinm. %0,%1,%2,0,31-(%2)" },
 { "sli.",    3,   PWRCOM,	"rlinm. %0,%1,%2,0,31-(%2)" },
-{ "srwi",    3,   PPCCOM,	"rlwinm %0,%1,32-(%2),%2,31" },
-{ "sri",     3,   PWRCOM,	"rlinm %0,%1,32-(%2),%2,31" },
-{ "srwi.",   3,   PPCCOM,	"rlwinm. %0,%1,32-(%2),%2,31" },
-{ "sri.",    3,   PWRCOM,	"rlinm. %0,%1,32-(%2),%2,31" },
+{ "srwi",    3,   PPCCOM,	"rlwinm %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "sri",     3,   PWRCOM,	"rlinm %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "srwi.",   3,   PPCCOM,	"rlwinm. %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
+{ "sri.",    3,   PWRCOM,	"rlinm. %0,%1,(-(%2)!31)&((%2)|31),%2,31" },
 { "clrrwi",  3,   PPCCOM,	"rlwinm %0,%1,0,0,31-(%2)" },
 { "clrrwi.", 3,   PPCCOM,	"rlwinm. %0,%1,0,0,31-(%2)" },
 { "clrlslwi",4,   PPCCOM,	"rlwinm %0,%1,%3,(%2)-(%3),31-(%3)" },
diff --git a/texinfo/texinfo.tex b/texinfo/texinfo.tex
index 3ce4715..d7608c2 100644
--- binutils-2.9.1.orig/texinfo/texinfo.tex
+++ binutils-2.9.1/texinfo/texinfo.tex
@@ -1,5 +1,5 @@
 % texinfo.tex -- TeX macros to handle Texinfo files.
-% $Id: texinfo.tex,v 2.227 1998/02/25 22:54:34 karl Exp $
+% $Id: texinfo.tex,v 1.1.1.1 2005/03/15 16:00:24 laire Exp $
 %
 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
 % Free Software Foundation, Inc.
@@ -44,7 +44,7 @@
 
 % This automatically updates the version number based on RCS.
 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 2.227 $
+\deftexinfoversion$Revision: 1.1.1.1 $
 \message{Loading texinfo package [Version \texinfoversion]:}
 
 % If in a .fmt file, print the version number
