aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-06 22:53:43 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-06 22:53:43 +0000
commitb7577823b60110d3b33ac7753e68a0291f0b132a (patch)
tree2889e39d803567e04add5e03ef7fcf6302651c52
parentdd6ed5ab2ddcf5b307b5b847ff336ff51e9d3974 (diff)
downloadgdb-b7577823b60110d3b33ac7753e68a0291f0b132a.zip
gdb-b7577823b60110d3b33ac7753e68a0291f0b132a.tar.gz
gdb-b7577823b60110d3b33ac7753e68a0291f0b132a.tar.bz2
* configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG. Check that various header files exist. Check that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc and/or free need to be declared. Don't make a link to sysdep.h. Define TRAD_HEADER for various hosts. * configure: Rebuild. * configure.host: Don't set my_host. Add definitions taken from host header files for various entries. Remove entries which now do nothing. * acconfig.h: New file. * config.h.in: New file, built by autoheader. * sysdep.h: New file. * Makefile.in (do_distclean): Don't remove sysdep.h. (RECONFIG): Remove. (LOCAL_H_DEPS): New variable. ($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and $(RECONFIG). ($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise. ($(OPTIONAL_BACKENDS)): Likewise. (stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than looking through sysdep.h. * bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile. (BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG. (fprintf_vma, sprintf_vma): Likewise. (int64_type, uint64_type): Don't define. * bfd-in2.h: Rebuild. * archures.c, bfd.c, srec.c: Include <ctype.h>. * elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS. * lynx-core.c: Include stuff from old hosts/lynx.h. * opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL), rather than NO_FCNTL. * targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__ rather than NATIVE_HPPAHPUX_COMPILER. * trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it is defined. * hosts/*.h: Remove all header files which merely include, declare, and define things. Leave header files which define information needed by trad-core.c.
-rw-r--r--bfd/.Sanitize3
-rw-r--r--bfd/ChangeLog46
-rw-r--r--bfd/Makefile.in53
-rw-r--r--bfd/acconfig.h11
-rw-r--r--bfd/archures.c188
-rw-r--r--bfd/bfd-in.h60
-rw-r--r--bfd/bfd-in2.h60
-rw-r--r--bfd/bfd.c12
-rw-r--r--bfd/config.h.in43
-rwxr-xr-xbfd/configure600
-rw-r--r--bfd/configure.host162
-rw-r--r--bfd/configure.in192
-rw-r--r--bfd/hosts/.Sanitize45
-rw-r--r--bfd/hosts/aix4.h23
-rw-r--r--bfd/hosts/alphaosf.h26
-rw-r--r--bfd/hosts/apollo68.h26
-rw-r--r--bfd/hosts/apollov68.h38
-rw-r--r--bfd/hosts/delta68.h0
-rw-r--r--bfd/hosts/delta88.h84
-rw-r--r--bfd/hosts/delta88v4.h8
-rw-r--r--bfd/hosts/dgux.h29
-rw-r--r--bfd/hosts/dose.h16
-rw-r--r--bfd/hosts/esix.h6
-rw-r--r--bfd/hosts/go32.h19
-rw-r--r--bfd/hosts/harris.h31
-rw-r--r--bfd/hosts/hp300.h38
-rw-r--r--bfd/hosts/hppabsd.h38
-rw-r--r--bfd/hosts/hppahpux.h43
-rw-r--r--bfd/hosts/hppaosf.h38
-rw-r--r--bfd/hosts/i386aix.h46
-rw-r--r--bfd/hosts/i386bsd.h40
-rw-r--r--bfd/hosts/i386lynx.h10
-rw-r--r--bfd/hosts/i386osf1mk.h11
-rw-r--r--bfd/hosts/i386v.h37
-rw-r--r--bfd/hosts/i386v4.h48
-rw-r--r--bfd/hosts/i386win32.h20
-rw-r--r--bfd/hosts/irix3.h25
-rw-r--r--bfd/hosts/irix4.h27
-rw-r--r--bfd/hosts/lynx.h42
-rw-r--r--bfd/hosts/m68klynx.h10
-rw-r--r--bfd/hosts/m68kv4.h51
-rw-r--r--bfd/hosts/miniframe.h14
-rw-r--r--bfd/hosts/nbsd.h25
-rw-r--r--bfd/hosts/ncr3000.h50
-rw-r--r--bfd/hosts/rs6000.h23
-rw-r--r--bfd/hosts/rs6000lynx.h10
-rw-r--r--bfd/hosts/rtbsd.h20
-rw-r--r--bfd/hosts/solaris2.h1
-rw-r--r--bfd/hosts/sparc-ll.h111
-rw-r--r--bfd/hosts/sparc.h14
-rw-r--r--bfd/hosts/sparclynx.h10
-rw-r--r--bfd/hosts/std-host.h66
-rw-r--r--bfd/hosts/stratus.h50
-rw-r--r--bfd/hosts/sun3.h44
-rw-r--r--bfd/hosts/sysv4.h37
-rw-r--r--bfd/hosts/ultra3.h20
-rw-r--r--bfd/hosts/we32k.h28
-rw-r--r--bfd/opncls.c6
-rw-r--r--bfd/srec.c6
-rw-r--r--bfd/targets.c14
-rw-r--r--bfd/trad-core.c32
61 files changed, 1055 insertions, 1831 deletions
diff --git a/bfd/.Sanitize b/bfd/.Sanitize
index 0d6f5d1..311aca5 100644
--- a/bfd/.Sanitize
+++ b/bfd/.Sanitize
@@ -47,6 +47,7 @@ Makefile.in
PORTING
TODO
VERSION
+acconfig.h
aclocal.m4
aix386-core.c
aout-adobe.c
@@ -95,6 +96,7 @@ coffgen.c
cofflink.c
coffswap.h
config.bfd
+config.h.in
configure
configure.bat
configure.host
@@ -227,6 +229,7 @@ srec.c
stab-syms.c
sunos.c
syms.c
+sysdep.h
targets.c
tekhex.c
trad-core.c
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e8f9f72..c36f574 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,49 @@
+Wed Sep 6 15:00:33 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Call AC_CONFIG_HEADER. Substitute
+ HOST_64BIT_LONG. Check that various header files exist. Check
+ that fcntl exists. Call BFD_BINARY_FOPEN. Check whether malloc
+ and/or free need to be declared. Don't make a link to sysdep.h.
+ Define TRAD_HEADER for various hosts.
+ * configure: Rebuild.
+ * configure.host: Don't set my_host. Add definitions taken from
+ host header files for various entries. Remove entries which now
+ do nothing.
+ * acconfig.h: New file.
+ * config.h.in: New file, built by autoheader.
+ * sysdep.h: New file.
+ * Makefile.in (do_distclean): Don't remove sysdep.h.
+ (RECONFIG): Remove.
+ (LOCAL_H_DEPS): New variable.
+ ($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
+ $(RECONFIG).
+ ($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
+ ($(OPTIONAL_BACKENDS)): Likewise.
+ (stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
+ looking through sysdep.h.
+ * bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
+ (BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
+ (fprintf_vma, sprintf_vma): Likewise.
+ (int64_type, uint64_type): Don't define.
+ * bfd-in2.h: Rebuild.
+ * archures.c, bfd.c, srec.c: Include <ctype.h>.
+ * elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
+ * lynx-core.c: Include stuff from old hosts/lynx.h.
+ * opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
+ rather than NO_FCNTL.
+ * targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
+ rather than NATIVE_HPPAHPUX_COMPILER.
+ * trad-core.c: Don't include <errno.h>. Include TRAD_HEADER if it
+ is defined.
+ * hosts/*.h: Remove all header files which merely include,
+ declare, and define things. Leave header files which define
+ information needed by trad-core.c.
+
+ * aclocal.m4 (BFD_BINARY_FOPEN): Define.
+ (BFD_CC_FOR_BUILD): Define.
+ * configure.in: Use BFD_CC_FOR_BUILD.
+ * configure: Rebuild.
+
Tue Sep 5 19:35:28 1995 Ian Lance Taylor <ian@cygnus.com>
* aclocal.m4: Don't try to grep ../Makefile if it doesn't exist.
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index feb11f0..0279f0a 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -45,17 +45,18 @@ docdir = doc
SHELL = /bin/sh
-INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
-AR = ar
+AR = @AR@
AR_FLAGS = rc
-CFLAGS = -g
+CC = @CC@
+CFLAGS = @CFLAGS@
MAKEINFO = makeinfo
RANLIB = @RANLIB@
-CC_FOR_BUILD = $(CC)
+CC_FOR_BUILD = @CC_FOR_BUILD@
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
@@ -233,10 +234,6 @@ TDEFAULTS = @tdefaults@
all:
-#### host and target dependent Makefile fragments come in here.
-# @host_makefile_frag@
-###
-
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
@@ -253,7 +250,7 @@ FLAGS_TO_PASS = \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"BISON=$(BISON)"
-ALL_CFLAGS=$(CFLAGS) $(HDEFINES) @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES)
+ALL_CFLAGS=@HDEFINES@ @COREFLAG@ @TDEFINES@ $(CSEARCH) $(CSWITCHES) $(CFLAGS)
.c.o:
$(CC) -c $(ALL_CFLAGS) $<
@@ -342,7 +339,6 @@ $(TARGETLIB): $(OFILES) ofiles
# When compiling archures.c and targets.c, supply the default target
# info from configure.
-
targets.o: targets.c Makefile
$(CC) -c $(ALL_CFLAGS) $(TDEFAULTS) $<
@@ -379,7 +375,7 @@ do_clean: do_mostlyclean
rm -f libbfd.a TAGS bfd.h stmp-bfd.h ofiles \
elf32-target.h elf64-target.h
do_distclean: do_clean
- rm -f Makefile config.status sysdep.h config.cache
+ rm -f Makefile config.status config.cache
# Should we remove $(srcdir)/libcoff.h $(srcdir)/libbfd.h $(srcdir)/bfd-in2.h?
# make-stds.texi says it depends on whether they can be regenerated using
@@ -399,15 +395,12 @@ clobber realclean:
$(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS)
$(MAKE) do_realclean
-# Mark everything as depending on config.status, since the timestamp on
-# sysdep.h might actually move backwards if we reconfig and relink it
-# to a different hosts/h-xxx.h file. This will force a recompile anyway.
BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h
-RECONFIG = config.status
-$(BFD_LIBS): libbfd.h $(BFD_H) $(RECONFIG) $(BFD_H_DEPS)
-$(BFD_MACHINES): libbfd.h $(BFD_H) $(RECONFIG) $(BFD_H_DEPS)
-$(BFD_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) $(BFD_H_DEPS)
-$(OPTIONAL_BACKENDS): libbfd.h $(BFD_H) $(RECONFIG) $(BFD_H_DEPS)
+LOCAL_H_DEPS= libbfd.h sysdep.h config.h
+$(BFD_LIBS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(BFD_MACHINES): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(BFD_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
+$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
# Get around a Sun Make bug in SunOS 4.1.1 with VPATH
cpu-i386.o:cpu-i386.c
@@ -483,7 +476,7 @@ install:
Makefile: Makefile.in config.status
$(SHELL) config.status
-config.status: configure configure.host config.bfd @frags@
+config.status: configure configure.host config.bfd
$(SHELL) config.status --recheck
# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
@@ -528,26 +521,14 @@ BFDIN_H= $(srcdir)/bfd-in2.h
$(BFD_H): stmp-bfd.h ; @true
-# The file ../include/bfd.h is from earlier attempts to get this right.
-# If the file is still there, kill it.
-# The weird sh*t with grep is to avoid printing "exit 1 (ignored)" type
-# messages from make, and avoid various ways in which different versions
-# of make will screw up exit status checks.
-# -grep... -> make prints "exit 1" message
-# grep ... ; exit 0 -> sun(?) make notices grep failure
-# grep ... || exit 0 -> bsd4.4 make still notices
-# if grep ... -> seems okay so far
stmp-bfd.h : $(srcdir)/bfd-in2.h Makefile
- rm -f bfd.h-new 64 ../include/bfd.h
- if grep BFD_HOST_64_BIT sysdep.h > 64 2>/dev/null; then true; \
- else true; fi
+ rm -f bfd.h-new
sed -e 's/@WORDSIZE@/$(WORDSIZE)/' \
-e "s/@VERSION@/`cat $(srcdir)/VERSION`/" \
- -e '/64-bit.*sysdep.h/ r 64' \
+ -e 's/@BFD_HOST_64BIT_LONG@/@HOST_64BIT_LONG@/' \
< $(srcdir)/bfd-in2.h \
> bfd.h-new
$(srcdir)/../move-if-change bfd.h-new $(BFD_H)
- rm -f 64
touch stmp-bfd.h
# Could really use a "copy-if-change"...
diff --git a/bfd/acconfig.h b/bfd/acconfig.h
new file mode 100644
index 0000000..69c7ab0
--- /dev/null
+++ b/bfd/acconfig.h
@@ -0,0 +1,11 @@
+/* Do we need to use the b modifier when opening binary files? */
+#undef USE_BINARY_FOPEN
+
+/* Whether malloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Whether free must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_FREE
+
+/* Name of host specific header file to include in trad-core.c. */
+#undef TRAD_HEADER
diff --git a/bfd/archures.c b/bfd/archures.c
index a249ad0..1b8f58e 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -1,5 +1,5 @@
/* BFD library support routines for architectures.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -16,7 +16,7 @@ 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. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
@@ -87,6 +87,8 @@ DESCRIPTION
.
. bfd_arch_a29k, {* AMD 29000 *}
. bfd_arch_sparc, {* SPARC *}
+.#define bfd_mach_sparc 1
+.#define bfd_mach_sparc64 2
. bfd_arch_mips, {* MIPS Rxxxx *}
. bfd_arch_i386, {* Intel 386 *}
. bfd_arch_we32k, {* AT&T WE32xxx *}
@@ -111,11 +113,16 @@ DESCRIPTION
. bfd_arch_alpha, {* Dec Alpha *}
. bfd_arch_arm, {* Advanced Risc Machines ARM *}
. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
+. bfd_arch_w65, {* WDC 65816 *}
. {* start-sanitize-rce *}
. bfd_arch_rce, {* Motorola RCE *}
. {* end-sanitize-rce *}
. {* start-sanitize-arc *}
. bfd_arch_arc, {* Argonaut RISC Core *}
+.#define bfd_mach_arc_base 0
+.#define bfd_mach_arc_host 1
+.#define bfd_mach_arc_graphics 2
+.#define bfd_mach_arc_audio 3
. {* end-sanitize-arc *}
. bfd_arch_last
. };
@@ -126,6 +133,7 @@ DESCRIPTION
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
+#include <ctype.h>
/*
@@ -246,6 +254,14 @@ bfd_arch_get_compatible (abfd, bbfd)
CONST bfd *abfd;
CONST bfd *bbfd;
{
+ /* If either architecture is unknown, then all we can do is assume
+ the user knows what he's doing. */
+ if (abfd->arch_info->arch == bfd_arch_unknown)
+ return bbfd->arch_info;
+ if (bbfd->arch_info->arch == bfd_arch_unknown)
+ return abfd->arch_info;
+
+ /* Otherwise architecture-specific code has to decide. */
return abfd->arch_info->compatible(abfd->arch_info,bbfd->arch_info);
}
@@ -452,6 +468,7 @@ extern void bfd_vax_arch PARAMS ((void));
extern void bfd_we32k_arch PARAMS ((void));
extern void bfd_z8k_arch PARAMS ((void));
extern void bfd_ns32k_arch PARAMS ((void));
+extern void bfd_w65_arch PARAMS ((void));
static void (*const archures_init_table[]) PARAMS ((void)) =
{
@@ -483,6 +500,7 @@ static void (*const archures_init_table[]) PARAMS ((void)) =
bfd_we32k_arch,
bfd_z8k_arch,
bfd_ns32k_arch,
+ bfd_w65_arch,
#endif
0
};
@@ -578,108 +596,112 @@ bfd_default_scan (info, string)
CONST struct bfd_arch_info *info;
CONST char *string;
{
- CONST char *ptr_src;
- CONST char *ptr_tst;
- unsigned long number;
- enum bfd_architecture arch;
- /* First test for an exact match */
- if (strcmp(string, info->printable_name) == 0) return true;
-
- /* See how much of the supplied string matches with the
- architecture, eg the string m68k:68020 would match the 68k entry
- up to the :, then we get left with the machine number */
-
- for (ptr_src = string,
- ptr_tst = info->arch_name;
- *ptr_src && *ptr_tst;
- ptr_src++,
- ptr_tst++)
+ CONST char *ptr_src;
+ CONST char *ptr_tst;
+ unsigned long number;
+ enum bfd_architecture arch;
+ /* First test for an exact match */
+ if (strcmp(string, info->printable_name) == 0) return true;
+
+ /* See how much of the supplied string matches with the
+ architecture, eg the string m68k:68020 would match the 68k entry
+ up to the :, then we get left with the machine number */
+
+ for (ptr_src = string,
+ ptr_tst = info->arch_name;
+ *ptr_src && *ptr_tst;
+ ptr_src++,
+ ptr_tst++)
{
- if (*ptr_src != *ptr_tst) break;
+ if (*ptr_src != *ptr_tst) break;
}
- /* Chewed up as much of the architecture as will match, skip any
- colons */
- if (*ptr_src == ':') ptr_src++;
+ /* Chewed up as much of the architecture as will match, skip any
+ colons */
+ if (*ptr_src == ':') ptr_src++;
- if (*ptr_src == 0) {
- /* nothing more, then only keep this one if it is the default
- machine for this architecture */
- return info->the_default;
- }
- number = 0;
- while (isdigit(*ptr_src)) {
- number = number * 10 + *ptr_src - '0';
- ptr_src++;
- }
+ if (*ptr_src == 0) {
+ /* nothing more, then only keep this one if it is the default
+ machine for this architecture */
+ return info->the_default;
+ }
+ number = 0;
+ while (isdigit(*ptr_src)) {
+ number = number * 10 + *ptr_src - '0';
+ ptr_src++;
+ }
- switch (number)
+ switch (number)
{
- case 300:
+ case 65:
+ arch = bfd_arch_w65;
+ break;
+
+ case 300:
arch = bfd_arch_h8300;
break;
- case 500:
+ case 500:
arch = bfd_arch_h8500;
break;
- case 68010:
- case 68020:
- case 68030:
- case 68040:
- case 68332:
- case 68050:
- case 68000:
- arch = bfd_arch_m68k;
- break;
- case 386:
- case 80386:
- case 486:
- case 80486:
- arch = bfd_arch_i386;
- break;
- case 29000:
- arch = bfd_arch_a29k;
- break;
+ case 68010:
+ case 68020:
+ case 68030:
+ case 68040:
+ case 68332:
+ case 68050:
+ case 68000:
+ arch = bfd_arch_m68k;
+ break;
+ case 386:
+ case 80386:
+ case 486:
+ case 80486:
+ arch = bfd_arch_i386;
+ break;
+ case 29000:
+ arch = bfd_arch_a29k;
+ break;
- case 8000:
- arch = bfd_arch_z8k;
- break;
+ case 8000:
+ arch = bfd_arch_z8k;
+ break;
- case 32000:
- arch = bfd_arch_we32k;
- break;
+ case 32000:
+ arch = bfd_arch_we32k;
+ break;
- case 860:
- case 80860:
- arch = bfd_arch_i860;
- break;
- case 960:
- case 80960:
- arch = bfd_arch_i960;
- break;
+ case 860:
+ case 80860:
+ arch = bfd_arch_i860;
+ break;
+ case 960:
+ case 80960:
+ arch = bfd_arch_i960;
+ break;
- case 2000:
- case 3000:
- case 4000:
- case 4400:
- arch = bfd_arch_mips;
- break;
+ case 2000:
+ case 3000:
+ case 4000:
+ case 4400:
+ arch = bfd_arch_mips;
+ break;
- case 6000:
- arch = bfd_arch_rs6000;
- break;
+ case 6000:
+ arch = bfd_arch_rs6000;
+ break;
- default:
- return false;
+ default:
+ return false;
}
- if (arch != info->arch)
- return false;
+ if (arch != info->arch)
+ return false;
- if (number != info->mach)
- return false;
+ if (number != info->mach)
+ return false;
- return true;
+ return true;
}
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 694cd69..afb907f 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -52,8 +52,9 @@ extern "C" {
#include "obstack.h"
/* These two lines get substitutions done by commands in Makefile.in. */
-#define BFD_VERSION "@VERSION@"
+#define BFD_VERSION "@VERSION@"
#define BFD_ARCH_SIZE @WORDSIZE@
+#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
#if BFD_ARCH_SIZE >= 64
#define BFD64
@@ -67,9 +68,6 @@ extern "C" {
#endif
#endif
-/* 64-bit type definition (if any) from bfd's sysdep.h goes here */
-
-
/* forward declaration */
typedef struct _bfd bfd;
@@ -109,43 +107,42 @@ typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
typedef long int file_ptr;
/* Support for different sizes of target format ints and addresses.
- If the host implements 64-bit values, it defines BFD_HOST_64_BIT to
- be the appropriate type. Otherwise, this code will fall back on
- gcc's "long long" type if gcc is being used. BFD_HOST_64_BIT must
- be defined in such a way as to be a valid type name by itself or
- with "unsigned" prefixed. It should be a signed type by itself.
+ If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
+ set to 1 above. Otherwise, if gcc is being used, this code will
+ use gcc's "long long" type. Otherwise, the compilation will fail
+ if 64-bit targets are requested. */
- If neither is the case, then compilation will fail if 64-bit
- targets are requested. If you don't request any 64-bit targets,
- you should be safe. */
+#ifdef BFD64
-#ifdef BFD64
-
-#if defined (__GNUC__) && !defined (BFD_HOST_64_BIT)
+#ifndef BFD_HOST_64_BIT
+#if BFD_HOST_64BIT_LONG
+#define BFD_HOST_64_BIT long
+#else
+#ifdef __GNUC__
#define BFD_HOST_64_BIT long long
-typedef BFD_HOST_64_BIT int64_type;
-typedef unsigned BFD_HOST_64_BIT uint64_type;
-#endif
-
-#if !defined (uint64_type) && defined (__GNUC__)
-#define uint64_type unsigned long long
-#define int64_type long long
-#endif
-#ifndef uint64_typeLOW
-#define uint64_typeLOW(x) ((unsigned long)(((x) & 0xffffffff)))
-#define uint64_typeHIGH(x) ((unsigned long)(((x) >> 32) & 0xffffffff))
-#endif
+#endif /* defined (__GNUC__) */
+#endif /* ! BFD_HOST_64BIT_LONG */
+#endif /* ! defined (BFD_HOST_64_BIT) */
typedef unsigned BFD_HOST_64_BIT bfd_vma;
typedef BFD_HOST_64_BIT bfd_signed_vma;
typedef unsigned BFD_HOST_64_BIT bfd_size_type;
typedef unsigned BFD_HOST_64_BIT symvalue;
+
#ifndef fprintf_vma
+#if BFD_HOST_64BIT_LONG
+#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
+#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
+#else
+#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
+#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
- fprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
+ fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
- sprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
+ sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#endif
+#endif
+
#else /* not BFD64 */
/* Represent a target address. Also used as a generic unsigned type
@@ -391,6 +388,11 @@ extern struct bfd_hash_entry *bfd_hash_lookup
PARAMS ((struct bfd_hash_table *, const char *, boolean create,
boolean copy));
+/* Replace an entry in a hash table. */
+extern void bfd_hash_replace
+ PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
+ struct bfd_hash_entry *nw));
+
/* Base method for creating a hash table entry. */
extern struct bfd_hash_entry *bfd_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index ced4171..62858a5 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -52,8 +52,9 @@ extern "C" {
#include "obstack.h"
/* These two lines get substitutions done by commands in Makefile.in. */
-#define BFD_VERSION "@VERSION@"
+#define BFD_VERSION "@VERSION@"
#define BFD_ARCH_SIZE @WORDSIZE@
+#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
#if BFD_ARCH_SIZE >= 64
#define BFD64
@@ -67,9 +68,6 @@ extern "C" {
#endif
#endif
-/* 64-bit type definition (if any) from bfd's sysdep.h goes here */
-
-
/* forward declaration */
typedef struct _bfd bfd;
@@ -109,43 +107,42 @@ typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
typedef long int file_ptr;
/* Support for different sizes of target format ints and addresses.
- If the host implements 64-bit values, it defines BFD_HOST_64_BIT to
- be the appropriate type. Otherwise, this code will fall back on
- gcc's "long long" type if gcc is being used. BFD_HOST_64_BIT must
- be defined in such a way as to be a valid type name by itself or
- with "unsigned" prefixed. It should be a signed type by itself.
+ If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
+ set to 1 above. Otherwise, if gcc is being used, this code will
+ use gcc's "long long" type. Otherwise, the compilation will fail
+ if 64-bit targets are requested. */
- If neither is the case, then compilation will fail if 64-bit
- targets are requested. If you don't request any 64-bit targets,
- you should be safe. */
+#ifdef BFD64
-#ifdef BFD64
-
-#if defined (__GNUC__) && !defined (BFD_HOST_64_BIT)
+#ifndef BFD_HOST_64_BIT
+#if BFD_HOST_64BIT_LONG
+#define BFD_HOST_64_BIT long
+#else
+#ifdef __GNUC__
#define BFD_HOST_64_BIT long long
-typedef BFD_HOST_64_BIT int64_type;
-typedef unsigned BFD_HOST_64_BIT uint64_type;
-#endif
-
-#if !defined (uint64_type) && defined (__GNUC__)
-#define uint64_type unsigned long long
-#define int64_type long long
-#endif
-#ifndef uint64_typeLOW
-#define uint64_typeLOW(x) ((unsigned long)(((x) & 0xffffffff)))
-#define uint64_typeHIGH(x) ((unsigned long)(((x) >> 32) & 0xffffffff))
-#endif
+#endif /* defined (__GNUC__) */
+#endif /* ! BFD_HOST_64BIT_LONG */
+#endif /* ! defined (BFD_HOST_64_BIT) */
typedef unsigned BFD_HOST_64_BIT bfd_vma;
typedef BFD_HOST_64_BIT bfd_signed_vma;
typedef unsigned BFD_HOST_64_BIT bfd_size_type;
typedef unsigned BFD_HOST_64_BIT symvalue;
+
#ifndef fprintf_vma
+#if BFD_HOST_64BIT_LONG
+#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
+#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
+#else
+#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
+#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
- fprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
+ fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
- sprintf(s,"%08lx%08lx", uint64_typeHIGH(x), uint64_typeLOW(x))
+ sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#endif
+#endif
+
#else /* not BFD64 */
/* Represent a target address. Also used as a generic unsigned type
@@ -391,6 +388,11 @@ extern struct bfd_hash_entry *bfd_hash_lookup
PARAMS ((struct bfd_hash_table *, const char *, boolean create,
boolean copy));
+/* Replace an entry in a hash table. */
+extern void bfd_hash_replace
+ PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
+ struct bfd_hash_entry *nw));
+
/* Base method for creating a hash table entry. */
extern struct bfd_hash_entry *bfd_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index d58e971..7cf65f6 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -16,7 +16,7 @@ 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. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
SECTION
@@ -152,6 +152,7 @@ CODE_FRAGMENT
. struct _oasys_data *oasys_obj_data;
. struct _oasys_ar_data *oasys_ar_data;
. struct coff_tdata *coff_obj_data;
+. struct pe_tdata *pe_obj_data;
. struct ecoff_tdata *ecoff_obj_data;
. struct ieee_data_struct *ieee_data;
. struct ieee_ar_data_struct *ieee_ar_data;
@@ -200,6 +201,7 @@ CODE_FRAGMENT
#undef obj_symbols
#include "libelf.h"
+#include <ctype.h>
/* provide storage for subsystem, stack and heap data which may have been
passed in on the command line. Ld puts this data into a bfd_link_info
@@ -207,9 +209,7 @@ CODE_FRAGMENT
it to the following struct so that the data will be available in coffcode.h
where it is needed. The typedef's used are defined in bfd.h */
-enum bfd_link_subsystem NT_subsystem;
-bfd_link_stack_heap NT_stack_heap;
/*
SECTION
@@ -995,6 +995,9 @@ DESCRIPTION
.#define bfd_get_dynamic_symtab_upper_bound(abfd) \
. BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
.
+.#define bfd_print_private_bfd_data(abfd, file)\
+. BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
+.
.#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
. BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
.
@@ -1039,3 +1042,6 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
return (*fn) (abfd, link_info, link_order, data, relocateable, symbols);
}
+
+
+
diff --git a/bfd/config.h.in b/bfd/config.h.in
new file mode 100644
index 0000000..0e14247
--- /dev/null
+++ b/bfd/config.h.in
@@ -0,0 +1,43 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Do we need to use the b modifier when opening binary files? */
+#undef USE_BINARY_FOPEN
+
+/* Whether malloc must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_MALLOC
+
+/* Whether free must be declared even if <stdlib.h> is included. */
+#undef NEED_DECLARATION_FREE
+
+/* Name of host specific header file to include in trad-core.c. */
+#undef TRAD_HEADER
+
+/* Define if you have the fcntl function. */
+#undef HAVE_FCNTL
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
diff --git a/bfd/configure b/bfd/configure
index ac19834..64696be 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -425,6 +425,8 @@ if test -n "$enableval"; then
esac
fi
+
+
ac_aux_dir=
for ac_dir in `cd $srcdir/..;pwd` $srcdir/`cd $srcdir/..;pwd`; do
if test -f $ac_dir/install-sh; then
@@ -556,8 +558,6 @@ target64=false
# host stuff:
-HDEFINES=
-
# Permit host specific settings.
. ${srcdir}/configure.host
@@ -672,7 +672,12 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-# Put a plausible default for CC_FOR_BUILD in Makefile.
+HOST_64BIT_LONG=0
+if test "x${HOST_64BIT_TYPE}" = "xlong"; then
+ HOST_64BIT_LONG=1
+fi
+
+
# If we cannot run a trivial program, we must be cross compiling.
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
@@ -682,7 +687,7 @@ else
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
-#line 686 "configure"
+#line 691 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
@@ -698,6 +703,7 @@ fi
cross_compiling=$ac_cv_c_cross
echo "$ac_t""$ac_cv_c_cross" 1>&6
+# Put a plausible default for CC_FOR_BUILD in Makefile.
if test "x$cross_compiling" = "xno"; then
CC_FOR_BUILD='$(CC)'
else
@@ -705,15 +711,269 @@ else
fi
-# Set up to make a link between the host's include file and "sysdep.h".
-files=hosts/${my_host}.h
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 730 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 744 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
+do
+ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+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 777 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in fcntl.h sys/file.h sys/procfs.h
+do
+ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+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 813 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in fcntl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+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 848 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+char $ac_func();
+
+int main() { return 0; }
+int t() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if eval $ac_link; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+case "${host}" in
+i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-win32)
+ cat >> confdefs.h <<\EOF
+#define USE_BINARY_FOPEN 1
+EOF
+ ;;
+esac
+
+echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
+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 906 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() { return 0; }
+int t() {
+char *(*pfn) = (char *(*)) malloc
+; return 0; }
+EOF
+if eval $ac_compile; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_malloc=no
+else
+ rm -rf conftest*
+ bfd_cv_decl_needed_malloc=yes
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
+if test $bfd_cv_decl_needed_malloc = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_MALLOC 1
+EOF
-if test ! -f ${srcdir}/${files} ; then
- files=../bfd/hosts/std-host.h
- echo "configure: warning: BFD has no specific support for host ${host} -- using std-host" 1>&2
fi
+echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
+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 945 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() { return 0; }
+int t() {
+int (*pfn) = (int (*)) free
+; return 0; }
+EOF
+if eval $ac_compile; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_free=no
+else
+ rm -rf conftest*
+ bfd_cv_decl_needed_free=yes
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
+if test $bfd_cv_decl_needed_free = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_FREE 1
+EOF
+
+fi
# If we are configured native, pick a core file support file.
COREFILE=
@@ -726,37 +986,142 @@ if test "${target}" = "${host}"; then
hppa*-*-hiux*) COREFILE=hpux-core.o ;;
hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
- i[345]86-sequent-bsd*) COREFILE=trad-core.o ;;
+ i[345]86-sequent-bsd*)
+ COREFILE=trad-core.o;
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/symmetry.h"
+EOF
+
+ ;;
i[345]86-sequent-sysv4*) ;;
- i[345]86-sequent-sysv*) COREFILE=trad-core.o ;;
- i[345]86-*-bsd*) COREFILE=trad-core.o ;;
- i[345]86-*-freebsd*) COREFILE=trad-core.o ;;
- i[345]86-*-netbsd*) COREFILE=trad-core.o ;;
- i[345]86-esix-sysv3*) COREFILE=trad-core.o ;;
- i[345]86-*-sco*) COREFILE=trad-core.o ;;
- i[345]86-*-mach3*) COREFILE=trad-core.o ;;
- i[345]86-*-linux*) COREFILE=trad-core.o ;;
+ i[345]86-sequent-sysv*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/symmetry.h"
+EOF
+
+ ;;
+ i[345]86-*-bsd* | i[345]86-*-freebsd* | i[345]86-*-netbsd*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/i386bsd.h"
+EOF
+
+ ;;
+ i[345]86-esix-sysv3*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/esix.h"
+EOF
+
+ ;;
+ i[345]86-*-sco* | i[345]86-*-isc*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/i386sco.h"
+EOF
+
+ ;;
+ i[345]86-*-mach3*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/i386mach3.h"
+EOF
+
+ ;;
+ i[345]86-*-linux*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/i386linux.h"
+EOF
+
+ ;;
i[345]86-*-isc*) COREFILE=trad-core.o ;;
i[345]86-*-aix*) COREFILE=aix386-core.o ;;
- mips-dec-bsd*) COREFILE=trad-core.o ;;
- mips-dec-mach3*) COREFILE=trad-core.o ;;
- mips-dec-*) COREFILE=trad-core.o ;;
+ mips-dec-bsd*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/mipsbsd.h"
+EOF
+
+ ;;
+ mips-dec-mach3*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/mipsmach3.h"
+EOF
+
+ ;;
+ mips-dec-*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/decstation.h"
+EOF
+
+ ;;
mips-sgi-irix4*) COREFILE=irix-core.o ;;
mips-sgi-irix5*) COREFILE=irix-core.o ;;
- mips-*-mach3*) COREFILE=trad-core.o ;;
+ mips-*-mach3*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/mipsmach3.h"
+EOF
+
+ ;;
mips-*-sysv4*) ;;
- mips-*-sysv*) COREFILE=trad-core.o ;;
- mips-*-riscos*) COREFILE=trad-core.o ;;
- mips-sony-bsd*) COREFILE=trad-core.o ;;
- m68*-bull*-sysv*) COREFILE=trad-core.o ;;
+ mips-*-sysv* | mips-*-riscos*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/riscos.h"
+EOF
+
+ ;;
+ mips-sony-bsd*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/news-mips".h
+EOF
+
+ ;;
+ m68*-bull*-sysv*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/dpx2.h"
+EOF
+
+ ;;
m68*-hp-hpux*) COREFILE=hpux-core.o ;;
- m68*-hp-bsd*) COREFILE=trad-core.o ;;
+ m68*-hp-bsd*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/hp300bsd.h"
+EOF
+
+ ;;
m68*-motorola-sysv*) COREFILE=ptrace-core.o ;;
- m68*-sony-*) COREFILE=trad-core.o ;;
+ m68*-sony-*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/news.h"
+EOF
+
+ ;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=trad-core.o ;;
- m88*-*-mach3*) COREFILE=trad-core.o ;;
- ns32k-pc532-mach) COREFILE=trad-core.o ;;
+ m88*-*-mach3*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/m88kmach3.h"
+EOF
+
+ ;;
+ ns32k-pc532-mach)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/pc532mach.h"
+EOF
+
+ ;;
rs6000-*-lynx*) COREFILE=lynx-core.o ;;
rs6000-*-aix4*) COREFILE=rs6000-core.o
COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
@@ -764,10 +1129,34 @@ if test "${target}" = "${host}"; then
powerpc-*-aix4*) COREFILE=rs6000-core.o
COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
powerpc-*-aix*) COREFILE=rs6000-core.o ;;
- tahoe-*-*) COREFILE=trad-core.o ;;
- vax-*-ultrix2*) COREFILE=trad-core.o ;;
- vax-*-ultrix*) COREFILE=trad-core.o ;;
- vax-*-*) COREFILE=trad-core.o ;;
+ tahoe-*-*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/tahoe.h"
+EOF
+
+ ;;
+ vax-*-ultrix2*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/vaxult2.h"
+EOF
+
+ ;;
+ vax-*-ultrix*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/vaxult2.h"
+EOF
+
+ ;;
+ vax-*-*)
+ COREFILE=trad-core.o
+ cat >> confdefs.h <<\EOF
+#define TRAD_HEADER "hosts/vaxbsd.h"
+EOF
+
+ ;;
esac
case "$COREFILE" in
@@ -779,7 +1168,7 @@ if test "${target}" = "${host}"; then
osf-core.o) COREFLAG=-DOSF_CORE ;;
ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
- trad-core.o) COREFLAG=-DTRAD_CORE ;;
+ trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
fi
@@ -1073,19 +1462,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.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
+DEFS=-DHAVE_CONFIG_H
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -1123,7 +1500,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile doc/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile doc/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
@@ -1160,7 +1537,9 @@ s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@HOST_64BIT_LONG@%$HOST_64BIT_LONG%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@CPP@%$CPP%g
s%@COREFILE@%$COREFILE%g
s%@COREFLAG@%$COREFLAG%g
s%@TDEFINES@%$TDEFINES%g
@@ -1230,51 +1609,102 @@ s%@INSTALL@%$INSTALL%g
fi; done
rm -f conftest.subs
-EOF
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$files"
-ac_dests="sysdep.h"
-EOF
+ echo creating $ac_file
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
+ rm -f conftest.frag conftest.in conftest.out
+ cp $ac_given_srcdir/$ac_file_in conftest.in
- echo "linking $srcdir/$ac_source to $ac_dest"
+EOF
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
+# 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.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+# Maximum number of lines to put in a single here document.
+ac_max_here_lines=12
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
+ rm -f $ac_file
+ mv conftest.h $ac_file
fi
-done
+fi; done
+
exit 0
diff --git a/bfd/configure.host b/bfd/configure.host
index 1053ce6..e062ac4 100644
--- a/bfd/configure.host
+++ b/bfd/configure.host
@@ -1,13 +1,25 @@
-# This file is a shell script that supplies the information necessary
-# to tailor a template configure script into the configure script
-# appropriate for this directory. For more information, check any
-# existing configure script.
+# This file is a shell script that overrides some of the tools and
+# flags used on a host specific basis.
# Since the "bfd/hosts" directory is shared by the bfd, opcodes, and
# binutils directories (at least), the index to it is also shared.
# This is that index. Each configure.in file should source this file
# in its per-host part.
+# This sets the following shell variables:
+# CC compiler to use (only if needed and not already set)
+# CFLAGS override CFLAGS (only if needed and not already set)
+# LDFLAGS override LDFLAGS (only if needed and not already set)
+# AR archiver to use (only if needed and not already set)
+# RANLIB ranlib to use (only if needed and not already set)
+# HDEFINES host specific compiler options
+# host64 set to true if this is a 64 bit host
+# HOST_64BIT_TYPE host 64 bit type
+
+HDEFINES=
+host64=false
+HOST_64BIT_TYPE=
+
case "${host}" in
# WHEN ADDING ENTRIES TO THIS MATRIX:
# Make sure that the left side always has two dashes. Otherwise you
@@ -17,95 +29,57 @@ case "${host}" in
# Note that these entries cannot be fully alphabetical. Don't try.
# The order of matching is critical when multiple lines could match.
-alpha-*-*) my_host=alphaosf ; host64=true ;;
-arm-*-riscix) my_host=riscix ;;
-a29k-*-*) my_host=ultra3 ;;
-
-hppa*-*-hpux*) my_host=hppahpux ;;
-hppa*-*-hiux*) my_host=hppahpux ;;
-hppa*-*-bsd*) my_host=hppabsd ;;
-hppa*-*-osf*) my_host=hppaosf ;;
-
-i[345]86-sequent-bsd*) my_host=symmetry ;;
-i[345]86-sequent-sysv4*) my_host=sysv4 ;;
-i[345]86-sequent-sysv*) my_host=symmetry ;;
-i[345]86-*-bsd*) my_host=i386bsd ;;
-i[345]86-*-freebsd*) my_host=i386bsd ;;
-i[345]86-*-netbsd*) my_host=i386bsd ;;
-i[345]86-ncr*-sysv4*) my_host=ncr3000 ;;
-i[345]86-*-go32*) my_host=go32 ;;
-i[345]86-*-pe*) my_host=i386pe ;;
-i[345]86-esix-sysv3*) my_host=esix ;;
-i[345]86-*-sysv4*) my_host=i386v4 ;;
-i[345]86-*-sysv*) my_host=i386v ;;
-i[345]86-*-solaris*) my_host=solaris2 ;;
-i[345]86-*-sco*) my_host=i386sco ;;
-i[345]86-*-mach3*) my_host=i386mach3 ;;
-i[345]86-*-osf1mk*) my_host=i386osf1mk ;;
-i[345]86-*-msdos*) my_host=dose ;;
-i[345]86-*-linux*) my_host=i386linux ;;
-i[345]86-*-lynxos*) my_host=i386lynx ;;
-i[345]86-*-isc*) my_host=i386sco ;;
-i[345]86-*-aix*) my_host=i386aix ;;
-
-i860-*-*) my_host=stratus ;;
-
-mips-dec-bsd*) my_host=mipsbsd ;;
-mips-dec-mach3*) my_host=mipsmach3 ;;
-mips-dec-*) my_host=decstation ;;
-mips-sgi-irix3*) my_host=irix3 ;;
-mips-sgi-irix4*) my_host=irix4 ;;
-mips-sgi-irix5*) my_host=irix5 ;;
-mips-*-mach3*) my_host=mipsmach3 ;;
-mips-*-sysv4*) my_host=sysv4 ;;
-mips-*-sysv*) my_host=riscos ;;
-mips-*-riscos*) my_host=riscos ;;
-mips-sony-bsd*) my_host=news-mips ;;
-
-m68*-apollo*-sysv*) my_host=apollov68 ;;
-m68*-apollo*-bsd*) my_host=apollo68 ;;
-m68*-atari-sysv4*) my_host=m68kv4 ;;
-m68*-bull*-sysv*) my_host=dpx2 ;;
-m68*-convergent-sysv*) my_host=miniframe ;;
-m68*-cbm-amigados*) my_host=amigados ;;
-m68*-cbm-sysv4*) my_host=m68kv4 ;;
-m68*-hp-hpux*) my_host=hp300 ;;
-m68*-hp-bsd*) my_host=hp300bsd ;;
-m68*-*-lynxos*) my_host=m68klynx ;;
-m68*-motorola-sysv*) my_host=delta68 ;;
-m68*-sony-*) my_host=news ;;
-m68*-sun-*) my_host=sun3 ;;
-
-m88*-*-sysv4*) my_host=delta88v4 ;;
-m88*-motorola-sysv*) my_host=delta88 ;;
-m88*-harris-*) my_host=harris ;;
-m88*-*-dgux*) my_host=dgux ;;
-m88*-*-mach3*) my_host=m88kmach3 ;;
-
-ns32k-pc532-mach) my_host=pc532mach ;;
-ns32k-*-netbsd*) my_host=ns32knbsd ;;
-
-romp-*-*) my_host=rtbsd ;;
-
-rs6000-*-lynx*) my_host=rs6000lynx ;;
-
-rs6000-*-*) my_host=rs6000 ;;
-powerpc-*-aix*) my_host=rs6000 ;;
-
-sparc-*-lynxos*) my_host=sparclynx ;;
-sparc-*-netbsd*) my_host=sparcnbsd;;
-sparc-*-sunos64*) my_host=sparc-ll ;;
-sparc-*-sysv4*) my_host=sysv4 ;;
-sparc-*-solaris2*) my_host=solaris2 ;;
-sparc-*-sysv64*) my_host=sysv4-ll ;;
-sparc-*-*) my_host=sparc ;;
-
-tahoe-*-*) my_host=tahoe ;;
-
-vax-*-ultrix2*) my_host=vaxult2 ;;
-vax-*-ultrix*) my_host=vaxult ;;
-vax-*-*) my_host=vaxbsd ;;
-
-we32k-*-*) my_host=we32k ;;
+alpha-*-*) host64=true; HOST_64BIT_TYPE=long ;;
+
+a29k-*-*) CC=${CC-u3cc}; AR=${AR-u3ar} ;;
+
+hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;;
+hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
+hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
+hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
+
+i[345]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;;
+i[345]86-sequent-sysv4*) ;;
+i[345]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;;
+i[345]86-ncr*-sysv4*) CC=${CC-/usr/ccs/ATT/cc}
+ test -z "$CFLAGS" && CFLAGS=" "
+ ;;
+i[345]86-*-go32*) test -z "$CC" && CC="i386-go32-gcc -fno-omit-frame-pointer -O2 -Wl,-S"
+ AR=${AR-i386-go32-ar}
+ RANLIB=${RANLIB-i386-go32-ranlib}
+ ;;
+i[345]86-*-win32) test -z "$CC" && CC="i386-win32-gcc -O2"
+ AR=${AR-i386-win32-ar}
+ RANLIB=${RANLIB-i386-win32-ranlib}
+ ;;
+
+mips-dec-*) HDEFINES="-G 4" ;;
+mips-sgi-irix3*) HDEFINES="-G 4"
+ test -z "$LDFLAGS" && LDFLAGS=-lmalloc
+ ;;
+mips-sgi-irix4*) HDEFINES="-G 4"
+ test -z "$LDFLAGS" && LDFLAGS=-lmalloc
+ ;;
+mips-*-sysv4*) ;;
+mips-*-sysv*) HDEFINES="-G 4" ;;
+mips-*-riscos*) HDEFINES="-G 4" ;;
+
+m68*-apollo*-sysv*) # sef@cygnus.com says this is how to compile
+ # on an apollo in the SysV environment.
+ test -z "$CC" && CC="cc -A nansi -A cpu,3000 -A runtype,any -A systype,any -DSHORT_ENUM_BUG -DUSG -U__STDC__ -Dm68000=mc68000"
+ ;;
+m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
+
+m88*-*-dgux*) test -z "$CC" && CC="gcc -Wall -ansi -D__using_DGUX"
+ ;;
+
+romp-*-*) # hc/pcc just can't cut it
+ CC=${CC-gcc}
+ ;;
+
+rs6000-*-aix4) HDEFINES=-DHOST_AIX ;;
+rs6000-*-*) HDEFINES=-DHOST_AIX ;;
+powerpc-*-aix4*) HDEFINES=-DHOST_AIX ;;
+powerpc-*-aix*) HDEFINES=-DHOST_AIX ;;
esac
diff --git a/bfd/configure.in b/bfd/configure.in
index d22a3ef..7bfe2a1 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -19,6 +19,8 @@ AC_ARG_ENABLE(targets,
*) enable_targets=$enableval ;;
esac])dnl
+AC_CONFIG_HEADER(config.h)
+
AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
AC_CANONICAL_SYSTEM
if test -z "$target" ; then
@@ -31,8 +33,6 @@ target64=false
# host stuff:
-HDEFINES=
-
# Permit host specific settings.
. ${srcdir}/configure.host
@@ -44,24 +44,53 @@ AC_SUBST(AR)
AC_PROG_RANLIB
AC_PROG_INSTALL
-# Put a plausible default for CC_FOR_BUILD in Makefile.
-AC_C_CROSS
-if test "x$cross_compiling" = "xno"; then
- CC_FOR_BUILD='$(CC)'
-else
- CC_FOR_BUILD=gcc
+HOST_64BIT_LONG=0
+if test "x${HOST_64BIT_TYPE}" = "xlong"; then
+ HOST_64BIT_LONG=1
fi
-AC_SUBST(CC_FOR_BUILD)
-
-# Set up to make a link between the host's include file and "sysdep.h".
-files=hosts/${my_host}.h
-
-if test ! -f ${srcdir}/${files} ; then
- files=../bfd/hosts/std-host.h
- AC_MSG_WARN(BFD has no specific support for host ${host} -- using std-host)
+AC_SUBST(HOST_64BIT_LONG)
+
+BFD_CC_FOR_BUILD
+
+AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h sys/file.h sys/procfs.h)
+AC_CHECK_FUNCS(fcntl)
+
+BFD_BINARY_FOPEN
+
+AC_MSG_CHECKING([whether malloc must be declared])
+AC_CACHE_VAL(bfd_cv_decl_needed_malloc,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],
+[char *(*pfn) = (char *(*)) malloc],
+bfd_cv_decl_needed_malloc=no, bfd_cv_decl_needed_malloc=yes)])
+AC_MSG_RESULT($bfd_cv_decl_needed_malloc)
+if test $bfd_cv_decl_needed_malloc = yes; then
+ AC_DEFINE(NEED_DECLARATION_MALLOC)
fi
-AC_LINK_FILES($files, sysdep.h)
+AC_MSG_CHECKING([whether free must be declared])
+AC_CACHE_VAL(bfd_cv_decl_needed_free,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],
+[int (*pfn) = (int (*)) free],
+bfd_cv_decl_needed_free=no, bfd_cv_decl_needed_free=yes)])
+AC_MSG_RESULT($bfd_cv_decl_needed_free)
+if test $bfd_cv_decl_needed_free = yes; then
+ AC_DEFINE(NEED_DECLARATION_FREE)
+fi
# If we are configured native, pick a core file support file.
COREFILE=
@@ -75,38 +104,103 @@ if test "${target}" = "${host}"; then
hppa*-*-bsd*) COREFILE="hpux-core.o hppabsd-core.o"
COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
changequote(,)dnl
- i[345]86-sequent-bsd*) COREFILE=trad-core.o ;;
+ i[345]86-sequent-bsd*)
+changequote([,])dnl
+ COREFILE=trad-core.o;
+ AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
+ ;;
+changequote(,)dnl
i[345]86-sequent-sysv4*) ;;
- i[345]86-sequent-sysv*) COREFILE=trad-core.o ;;
- i[345]86-*-bsd*) COREFILE=trad-core.o ;;
- i[345]86-*-freebsd*) COREFILE=trad-core.o ;;
- i[345]86-*-netbsd*) COREFILE=trad-core.o ;;
- i[345]86-esix-sysv3*) COREFILE=trad-core.o ;;
- i[345]86-*-sco*) COREFILE=trad-core.o ;;
- i[345]86-*-mach3*) COREFILE=trad-core.o ;;
- i[345]86-*-linux*) COREFILE=trad-core.o ;;
+ i[345]86-sequent-sysv*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/symmetry.h")
+ ;;
+changequote(,)dnl
+ i[345]86-*-bsd* | i[345]86-*-freebsd* | i[345]86-*-netbsd*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/i386bsd.h")
+ ;;
+changequote(,)dnl
+ i[345]86-esix-sysv3*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/esix.h")
+ ;;
+changequote(,)dnl
+ i[345]86-*-sco* | i[345]86-*-isc*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/i386sco.h")
+ ;;
+changequote(,)dnl
+ i[345]86-*-mach3*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/i386mach3.h")
+ ;;
+changequote(,)dnl
+ i[345]86-*-linux*)
+changequote([,])dnl
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/i386linux.h")
+ ;;
+changequote(,)dnl
i[345]86-*-isc*) COREFILE=trad-core.o ;;
i[345]86-*-aix*) COREFILE=aix386-core.o ;;
changequote([,])dnl
- mips-dec-bsd*) COREFILE=trad-core.o ;;
- mips-dec-mach3*) COREFILE=trad-core.o ;;
- mips-dec-*) COREFILE=trad-core.o ;;
+ mips-dec-bsd*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/mipsbsd.h")
+ ;;
+ mips-dec-mach3*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
+ ;;
+ mips-dec-*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/decstation.h")
+ ;;
mips-sgi-irix4*) COREFILE=irix-core.o ;;
mips-sgi-irix5*) COREFILE=irix-core.o ;;
- mips-*-mach3*) COREFILE=trad-core.o ;;
+ mips-*-mach3*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/mipsmach3.h")
+ ;;
mips-*-sysv4*) ;;
- mips-*-sysv*) COREFILE=trad-core.o ;;
- mips-*-riscos*) COREFILE=trad-core.o ;;
- mips-sony-bsd*) COREFILE=trad-core.o ;;
- m68*-bull*-sysv*) COREFILE=trad-core.o ;;
+ mips-*-sysv* | mips-*-riscos*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/riscos.h")
+ ;;
+ mips-sony-bsd*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/news-mips".h)
+ ;;
+ m68*-bull*-sysv*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/dpx2.h")
+ ;;
m68*-hp-hpux*) COREFILE=hpux-core.o ;;
- m68*-hp-bsd*) COREFILE=trad-core.o ;;
+ m68*-hp-bsd*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/hp300bsd.h")
+ ;;
m68*-motorola-sysv*) COREFILE=ptrace-core.o ;;
- m68*-sony-*) COREFILE=trad-core.o ;;
+ m68*-sony-*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/news.h")
+ ;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=trad-core.o ;;
- m88*-*-mach3*) COREFILE=trad-core.o ;;
- ns32k-pc532-mach) COREFILE=trad-core.o ;;
+ m88*-*-mach3*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/m88kmach3.h")
+ ;;
+ ns32k-pc532-mach)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/pc532mach.h")
+ ;;
rs6000-*-lynx*) COREFILE=lynx-core.o ;;
rs6000-*-aix4*) COREFILE=rs6000-core.o
COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
@@ -114,10 +208,22 @@ changequote([,])dnl
powerpc-*-aix4*) COREFILE=rs6000-core.o
COREFLAG=-DALTERNATE_AIX_CORE_FORMAT ;;
powerpc-*-aix*) COREFILE=rs6000-core.o ;;
- tahoe-*-*) COREFILE=trad-core.o ;;
- vax-*-ultrix2*) COREFILE=trad-core.o ;;
- vax-*-ultrix*) COREFILE=trad-core.o ;;
- vax-*-*) COREFILE=trad-core.o ;;
+ tahoe-*-*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/tahoe.h")
+ ;;
+ vax-*-ultrix2*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
+ ;;
+ vax-*-ultrix*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/vaxult2.h")
+ ;;
+ vax-*-*)
+ COREFILE=trad-core.o
+ AC_DEFINE(TRAD_HEADER,"hosts/vaxbsd.h")
+ ;;
esac
case "$COREFILE" in
@@ -129,7 +235,7 @@ changequote([,])dnl
osf-core.o) COREFLAG=-DOSF_CORE ;;
ptrace-core.o) COREFLAG=-DPTRACE_CORE ;;
rs6000-core.o) COREFLAG="$COREFLAG -DAIX_CORE" ;;
- trad-core.o) COREFLAG=-DTRAD_CORE ;;
+ trad-core.o) COREFLAG="$COREFLAG -DTRAD_CORE" ;;
esac
fi
AC_SUBST(COREFILE)
diff --git a/bfd/hosts/.Sanitize b/bfd/hosts/.Sanitize
index 0932b43..f68d72b 100644
--- a/bfd/hosts/.Sanitize
+++ b/bfd/hosts/.Sanitize
@@ -24,78 +24,33 @@ Do-first:
Things-to-keep:
-aix4.h
-alphaosf.h
-apollo68.h
-apollov68.h
decstation.h
-delta68.h
-delta88.h
-delta88v4.h
-dgux.h
-dose.h
dpx2.h
-go32.h
-harris.h
-hp300.h
hp300bsd.h
-hppabsd.h
-hppahpux.h
-hppaosf.h
-i386aix.h
-i386bsd.h
i386linux.h
-i386lynx.h
i386mach3.h
i386nbsd.h
-i386osf1mk.h
i386sco.h
-i386v.h
-i386v4.h
-i386win32.h
-irix3.h
-irix4.h
-lynx.h
-m68klynx.h
m68knbsd.h
-m68kv4.h
m88kmach3.h
-miniframe.h
mipsbsd.h
mipsmach3.h
mpw.h
nbsd.h
-ncr3000.h
news-mips.h
news.h
ns32knbsd.h
pc532mach.h
riscos.h
-rs6000.h
-rs6000lynx.h
-rtbsd.h
-solaris2.h
-sparc-ll.h
-sparc.h
-sparclynx.h
sparcnbsd.h
-std-host.h
-stratus.h
-sun3.h
symmetry.h
-sysv4.h
tahoe.h
-ultra3.h
vaxbsd.h
vaxult.h
vaxult2.h
-we32k.h
Things-to-lose:
-
-esix.h
-
Do-last:
# End of file.
diff --git a/bfd/hosts/aix4.h b/bfd/hosts/aix4.h
deleted file mode 100644
index 07bff7d..0000000
--- a/bfd/hosts/aix4.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This file is *really* for an Power, PowerPC running AIX 4... */
-
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h> /* for malloc() */
-
-/* Defining this variable turns on AIX core file and archive support. */
-#define HOST_AIX
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/alphaosf.h b/bfd/hosts/alphaosf.h
deleted file mode 100644
index 670c2fc..0000000
--- a/bfd/hosts/alphaosf.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <alloca.h>
-#include <stdlib.h>
-
-/* Make the basic types 64-bit quantities on the host.
- Also provide the support macros BFD needs. */
-#define BFD_HOST_64_BIT long
-#define sprintf_vma(s,x) sprintf (s, "%016lx", x) /* BFD_HOST_64_BIT */
-#define fprintf_vma(f,x) fprintf (f, "%016lx", x) /* BFD_HOST_64_BIT */
-
-#define BYTES_IN_PRINTF_INT 4
-
-/* These must have type unsigned long because they are used as
- arguments in printf functions. */
-#define uint64_typeLOW(x) ((unsigned long) (((x) & 0xffffffff))) /* BFD_HOST_64_BIT */
-#define uint64_typeHIGH(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) /* BFD_HOST_64_BIT */
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/apollo68.h b/bfd/hosts/apollo68.h
deleted file mode 100644
index 734f62a..0000000
--- a/bfd/hosts/apollo68.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#endif
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif /* MAXPATHLEN */
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-extern void free PARAMS ((PTR));
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/apollov68.h b/bfd/hosts/apollov68.h
deleted file mode 100644
index bf82c18..0000000
--- a/bfd/hosts/apollov68.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif /* MAXPATHLEN */
-
-#define POSIX_UTIME
-
-/* Some things that need to be defined in order to make code written for
- BSD Unix compile under System V Unix. */
-
-#include <memory.h>
-#define bcmp(b1,b2,len) memcmp(b1,b2,len)
-#define bcopy(src,dst,len) memcpy(dst,src,len)
-#define bzero(s,n) memset(s,0,n)
-
-#include <string.h>
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-extern void free PARAMS ((PTR));
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/delta68.h b/bfd/hosts/delta68.h
deleted file mode 100644
index e69de29..0000000
--- a/bfd/hosts/delta68.h
+++ /dev/null
diff --git a/bfd/hosts/delta88.h b/bfd/hosts/delta88.h
deleted file mode 100644
index c8e7bbd..0000000
--- a/bfd/hosts/delta88.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#include <ansidecl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <stdio.h>
-
-#define USE_UTIME
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-#endif
-extern int abort PARAMS ((void));
-extern int free PARAMS ((PTR));
-extern void bcopy PARAMS ((char*,char*,int));
-extern void exit PARAMS ((int));
-extern int strtol PARAMS ((char *, char **, int));
-extern void bzero PARAMS ((char *, int));
-#define NO_STDARG 1
-extern int abort PARAMS ((void));
-extern int close PARAMS ((int));
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern int fcntl PARAMS ((int des, int cmd, int e));
-#endif
-extern int qsort PARAMS ((void *data,int els, int siz, int func()));
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern int fseek PARAMS ((FILE*, int, int));
-#endif
-extern int fclose PARAMS ((FILE*));
-extern void bcopy PARAMS ((char*,char*,int));
-extern int bcmp PARAMS ((char *, char *, int));
-extern void bzero PARAMS ((char *, int));
-extern void perror PARAMS ((CONST char *));
-extern PTR memchr PARAMS ((const void *, int, unsigned ));
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern unsigned short getuid PARAMS ((void));
-extern unsigned short getgid PARAMS ((void));
-#endif
-
-extern char * strchr();
-
-extern char *getenv();
-extern char *strrchr();
-extern int chmod();
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern int fread();
-#endif
-extern int fstat();
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern int fwrite();
-#endif
-extern int sscanf();
-extern int stat();
-extern int strtol();
-extern int fileno();
-extern char *strrchr();
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-#if 0
-/* Conflicts with system headers on SVR4. */
-extern int time();
-#endif
-extern int utime();
-extern int vfprintf();
-extern long atol();
-extern char *getenv();
-extern int fputc();
-extern int unlink();
-
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/delta88v4.h b/bfd/hosts/delta88v4.h
deleted file mode 100644
index 3662ab2..0000000
--- a/bfd/hosts/delta88v4.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Delta88 running SVR4. */
-
-#include <unistd.h>
-
-#define STDC_HEADERS
-#include "hosts/std-host.h"
-
-#define HAVE_PROCFS /* This host has /proc support */
diff --git a/bfd/hosts/dgux.h b/bfd/hosts/dgux.h
deleted file mode 100644
index 0760462..0000000
--- a/bfd/hosts/dgux.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <ansidecl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/dg_c_generics.h>
-#include <unistd.h>
-
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <stdio.h>
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-#endif
-extern int abort PARAMS ((void));
-extern void free PARAMS ((PTR));
-extern void bcopy PARAMS ((char*,char*,int));
-extern void exit PARAMS ((int));
-extern void bzero PARAMS ((char *, int));
-extern int strtol();
-#define NO_STDARG 1
-
-
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/dose.h b/bfd/hosts/dose.h
deleted file mode 100644
index b01cc88..0000000
--- a/bfd/hosts/dose.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#include "fopen-bin.h"
diff --git a/bfd/hosts/esix.h b/bfd/hosts/esix.h
deleted file mode 100644
index 731791d..0000000
--- a/bfd/hosts/esix.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "hosts/std-host.h"
-
-#define NBPG NBPC
-#define UPAGES USIZE
-#define HOST_DATA_START_ADDR u.u_exdata.ux_datorg
-#define HOST_STACK_END_ADDR 0x80000000
diff --git a/bfd/hosts/go32.h b/bfd/hosts/go32.h
deleted file mode 100644
index 7e1af18..0000000
--- a/bfd/hosts/go32.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define NO_FCNTL
-
-#include "fopen-bin.h"
diff --git a/bfd/hosts/harris.h b/bfd/hosts/harris.h
deleted file mode 100644
index 5ad4777..0000000
--- a/bfd/hosts/harris.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <ansidecl.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <string.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ctype.h>
-
-#include <stdio.h>
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-#endif
-extern int abort PARAMS ((void));
-extern int free PARAMS ((PTR));
-extern void bcopy PARAMS ((char*,char*,int));
-extern void exit PARAMS ((int));
-extern void bzero PARAMS ((char *, int));
-
-extern int strtol();
-
-#include "fopen-same.h"
-
-#define POSIX_UTIME
-#ifndef _ES_MP
-#define HAVE_PROCFS /* Used for core file stuff only */
-#endif
diff --git a/bfd/hosts/hp300.h b/bfd/hosts/hp300.h
deleted file mode 100644
index 28dcb51..0000000
--- a/bfd/hosts/hp300.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stddef.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define HOST_HP300HPUX
-
-#define USE_UTIME
-
-/* Some things that need to be defined in order to make code written for
- BSD Unix compile under System V Unix. */
-
-#include <memory.h>
-#define bcmp(b1,b2,len) memcmp(b1,b2,len)
-#define bcopy(src,dst,len) memcpy(dst,src,len)
-#define bzero(s,n) memset(s,0,n)
-
-#if 0
-static int
-rename(from, to)
-{
- unlink(to);
- return(link(from, to));
-}
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/hppabsd.h b/bfd/hosts/hppabsd.h
deleted file mode 100644
index 4abc594..0000000
--- a/bfd/hosts/hppabsd.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _HPPABSD_H
-#define _HPPABSD_H
-
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#define HOST_HPPABSD
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#include <machine/machparam.h>
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_SEGMENT_SIZE NBPG /* Data seg start addr rounds to NBPG */
-#define HOST_MACHINE_ARCH bfd_arch_hppa
-/* #define HOST_MACHINE_MACHINE */
-
-#define HOST_TEXT_START_ADDR UTEXTSEG
-#define HOST_DATA_START_ADDR UDATASEG
-#define HOST_STACK_END_ADDR KSTAKSEG
-
-#include "fopen-same.h"
-
-#endif /* _HPPABSD_H */
diff --git a/bfd/hosts/hppahpux.h b/bfd/hosts/hppahpux.h
deleted file mode 100644
index a0cc696..0000000
--- a/bfd/hosts/hppahpux.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _HPPAHPUX_H
-#define _HPPAHPUX_H
-
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <memory.h>
-#include <stdlib.h>
-
-#define HOST_HPPAHPUX
-
-void free();
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#ifndef __STDC__
-#define NATIVE_HPPAHPUX_COMPILER
-#endif
-
-#define USE_UTIME
-
-#if 0
-static int
-rename(from, to)
-{
- unlink(to);
- return(link(from, to));
-}
-#endif
-
-#include "fopen-same.h"
-
-#endif /* _HPPAHPUX_H */
diff --git a/bfd/hosts/hppaosf.h b/bfd/hosts/hppaosf.h
deleted file mode 100644
index eb524b6..0000000
--- a/bfd/hosts/hppaosf.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _HPPAOSF_H
-#define _HPPAOSF_H
-
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#define HOST_HPPAOSF
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#include <machine/machparam.h>
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_SEGMENT_SIZE NBPG /* Data seg start addr rounds to NBPG */
-#define HOST_MACHINE_ARCH bfd_arch_hppa
-/* #define HOST_MACHINE_MACHINE */
-
-#define HOST_TEXT_START_ADDR UTEXTSEG
-#define HOST_DATA_START_ADDR UDATASEG
-#define HOST_STACK_END_ADDR KSTAKSEG
-
-#include "fopen-same.h"
-
-#endif /* _HPPAOSF_H */
diff --git a/bfd/hosts/i386aix.h b/bfd/hosts/i386aix.h
deleted file mode 100644
index ef621ca..0000000
--- a/bfd/hosts/i386aix.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* i386 AIX 1.2.x host system */
-/* From Minh Tran-Le <TRANLE@INTELLICORP.COM>. */
-
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-
-extern void abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern void exit PARAMS ((int));
-extern int fclose PARAMS ((FILE*));
-extern void free PARAMS ((PTR));
-extern int fseek PARAMS ((FILE*, long, int));
-extern void perror PARAMS ((CONST char *));
-
-extern char *getenv();
-extern int chmod();
-extern int fstat();
-extern int stat();
-
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern int fputc();
-extern int unlink();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/i386bsd.h b/bfd/hosts/i386bsd.h
deleted file mode 100644
index 56d7522..0000000
--- a/bfd/hosts/i386bsd.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef hosts_i386bsd_H
-/* Intel 386 running any BSD Unix */
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <machine/param.h>
-#include <machine/vmparam.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_MACHINE_ARCH bfd_arch_i386
-#define HOST_TEXT_START_ADDR USRTEXT
-
-#ifdef __bsdi__
-/* This seems to be the right thing for BSDI. */
-#define HOST_STACK_END_ADDR USRSTACK
-#else
-/* This seems to be the right thing for 386BSD release 0.1. */
-#define HOST_STACK_END_ADDR (USRSTACK - MAXSSIZ)
-#endif
-
-#define TRAD_UNIX_CORE_FILE_FAILING_SIGNAL(core_bfd) \
- ((core_bfd)->tdata.trad_core_data->u.u_sig)
-#define u_comm u_kproc.kp_proc.p_comm
-
-#include "fopen-same.h"
-#define hosts_i386bsd_H
-#endif
diff --git a/bfd/hosts/i386lynx.h b/bfd/hosts/i386lynx.h
deleted file mode 100644
index b5be30c..0000000
--- a/bfd/hosts/i386lynx.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Intel 386 running LynxOS */
-
-#ifndef hosts_i386lynx_h
-#define hosts_i386lynx_h
-
-#include "hosts/lynx.h"
-
-#define HOST_MACHINE_ARCH bfd_arch_i386
-
-#endif /* hosts_i386lynx_h */
diff --git a/bfd/hosts/i386osf1mk.h b/bfd/hosts/i386osf1mk.h
deleted file mode 100644
index cef73b4..0000000
--- a/bfd/hosts/i386osf1mk.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "hosts/std-host.h"
-
-#include <machine/machparam.h>
-
-#define HAVE_STRERROR
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_SEGMENT_SIZE NBPG
-#define HOST_MACHINE_ARCH bfd_arch_i386
-#define HOST_TEXT_START_ADDR 0x10000 /* By inspection */
-#define HOST_STACK_END_ADDR KERNBASE
diff --git a/bfd/hosts/i386v.h b/bfd/hosts/i386v.h
deleted file mode 100644
index ee7daeb..0000000
--- a/bfd/hosts/i386v.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#endif
-
-#define USE_UTIME
-
-/* Some things that need to be defined in order to make code written for
- BSD Unix compile under System V Unix. */
-
-/*#include <memory.h>*/
-#define bcmp(b1,b2,len) memcmp(b1,b2,len)
-#define bcopy(src,dst,len) memcpy(dst,src,len)
-#define bzero(s,n) memset(s,0,n)
-
-#include <string.h>
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-extern void free PARAMS ((PTR));
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/i386v4.h b/bfd/hosts/i386v4.h
deleted file mode 100644
index 655e554..0000000
--- a/bfd/hosts/i386v4.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* SVR4 Unix host system */
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-#define HAVE_PROCFS /* This host has /proc support */
-
-extern void abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern void exit PARAMS ((int));
-extern int fclose PARAMS ((FILE*));
-extern void free PARAMS ((PTR));
-extern int fseek PARAMS ((FILE*, long, int));
-extern gid_t getgid PARAMS ((void));
-extern uid_t getuid PARAMS ((void));
-extern PTR malloc PARAMS ((unsigned));
-extern void perror PARAMS ((CONST char *));
-extern PTR realloc PARAMS ((PTR, unsigned));
-
-extern char *getenv();
-extern int chmod();
-extern int fstat();
-extern int stat();
-
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern int fputc();
-extern int unlink();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/i386win32.h b/bfd/hosts/i386win32.h
deleted file mode 100644
index c4d8532..0000000
--- a/bfd/hosts/i386win32.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#define FPRINTF_ALREADY_DECLARED
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define NO_FCNTL
-
-#include "fopen-bin.h"
-
diff --git a/bfd/hosts/irix3.h b/bfd/hosts/irix3.h
deleted file mode 100644
index caa7901..0000000
--- a/bfd/hosts/irix3.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <malloc.h>
-
-#if 0
-#include <ctype.h>
-#include <sys/file.h>
-#endif
-
-#if !defined (O_ACCMODE)
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#if !defined (SEEK_SET)
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/irix4.h b/bfd/hosts/irix4.h
deleted file mode 100644
index 5da3636..0000000
--- a/bfd/hosts/irix4.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <malloc.h>
-
-#define HOST_IRIX4
-
-#if 0
-#include <ctype.h>
-#include <sys/file.h>
-#endif
-
-#if !defined (O_ACCMODE)
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#if !defined (SEEK_SET)
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/lynx.h b/bfd/hosts/lynx.h
deleted file mode 100644
index 0243227..0000000
--- a/bfd/hosts/lynx.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Architecture independant LynxOS host support for 2.2 */
-
-#ifndef hosts_lynx_h
-#define hosts_lynx_h
-
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <sys/conf.h>
-#include <sys/kernel.h>
-/* sys/kernel.h should define this, but doesn't always, sigh. */
-#ifndef __LYNXOS
-#define __LYNXOS
-#endif
-#include <sys/mem.h>
-#include <sys/signal.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/itimer.h>
-#include <sys/file.h>
-#include <sys/proc.h>
-
-#define HOST_PAGE_SIZE NBPG
-#define HOST_TEXT_START_ADDR USRTEXT
-
-#define HOST_LYNX
-
-#include "fopen-same.h"
-
-#define FPRINTF_ALREADY_DECLARED
-
-#undef I386 /* Lynx defines this for some reason */
-
-/* Lynx has calloc, but no cfree, and gprof uses it. */
-
-#define cfree free
-
-#endif /* hosts_lynx_h */
diff --git a/bfd/hosts/m68klynx.h b/bfd/hosts/m68klynx.h
deleted file mode 100644
index 2d370da..0000000
--- a/bfd/hosts/m68klynx.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Motorola 680x0 running LynxOS */
-
-#ifndef hosts_m68klynx_H
-#define hosts_m68klynx_H
-
-#include "hosts/lynx.h"
-
-#define HOST_MACHINE_ARCH bfd_arch_m68k
-
-#endif /* hosts_m68klynx_H */
diff --git a/bfd/hosts/m68kv4.h b/bfd/hosts/m68kv4.h
deleted file mode 100644
index 6860390..0000000
--- a/bfd/hosts/m68kv4.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Amiga/Atari SVR4 Unix host system */
-
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-#define HAVE_PROCFS /* This host has /proc support */
-
-extern void abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern void exit PARAMS ((int));
-extern int fclose PARAMS ((FILE*));
-extern void free PARAMS ((PTR));
-extern int fseek PARAMS ((FILE*, long, int));
-extern int getgid PARAMS (());
-extern int getuid PARAMS (());
-extern PTR malloc PARAMS ((unsigned));
-extern void perror PARAMS ((CONST char *));
-extern int qsort PARAMS ((void *data, int els, int siz, int func()));
-extern PTR realloc PARAMS ((PTR, unsigned));
-
-extern char *getenv();
-extern int chmod();
-extern int fstat();
-extern int stat();
-extern int strtol();
-
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern int fputc();
-extern int unlink();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/miniframe.h b/bfd/hosts/miniframe.h
deleted file mode 100644
index cf6408d..0000000
--- a/bfd/hosts/miniframe.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "hosts/std-host.h"
-
-#define USE_UTIME
-
-#define NEED_MKDIR
-#define NEED_RMDIR
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 1024
-#endif /* MAXPATHLEN */
-
-#define bcmp(b1,b2,len) memcmp(b1,b2,len)
-#define bcopy(src,dst,len) memcpy(dst,src,len)
-#define bzero(s,n) memset(s,0,n)
diff --git a/bfd/hosts/nbsd.h b/bfd/hosts/nbsd.h
index 1c7a779..dda5757 100644
--- a/bfd/hosts/nbsd.h
+++ b/bfd/hosts/nbsd.h
@@ -1,34 +1,9 @@
/* Architecture independant NetBSD host support */
-#ifndef hosts_nbsd_H_
-#define hosts_nbsd_H__
-
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/reg.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-
-#include "fopen-same.h"
-
#define HOST_PAGE_SIZE NBPG
#define HOST_TEXT_START_ADDR USRTEXT
#define HOST_STACK_END_ADDR USRSTACK
-
-#endif
diff --git a/bfd/hosts/ncr3000.h b/bfd/hosts/ncr3000.h
deleted file mode 100644
index 3679c80..0000000
--- a/bfd/hosts/ncr3000.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* SVR4 Unix host system */
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-#define HAVE_PROCFS /* This host has /proc support */
-
-extern void abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern void exit PARAMS ((int));
-extern int fclose PARAMS ((FILE*));
-extern void free PARAMS ((PTR));
-extern int fseek PARAMS ((FILE*, long, int));
-extern int getgid PARAMS (());
-extern int getuid PARAMS (());
-extern PTR malloc PARAMS ((unsigned));
-extern void perror PARAMS ((CONST char *));
-extern int qsort PARAMS ((void *data, int els, int siz, int func()));
-extern PTR realloc PARAMS ((PTR, unsigned));
-
-extern char *getenv();
-extern int chmod();
-extern int fstat();
-extern int stat();
-extern int strtol();
-
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern int fputc();
-extern int unlink();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/rs6000.h b/bfd/hosts/rs6000.h
deleted file mode 100644
index 3a38968..0000000
--- a/bfd/hosts/rs6000.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This file is *really* for an RS6000 running AIX... */
-
-#include <stddef.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h> /* for malloc() */
-
-/* Defining this variable turns on AIX core file and archive support. */
-#define HOST_AIX
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/rs6000lynx.h b/bfd/hosts/rs6000lynx.h
deleted file mode 100644
index 16d5a5a..0000000
--- a/bfd/hosts/rs6000lynx.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* RS6000 running LynxOS */
-
-#ifndef hosts_rs6000lynx_h
-#define hosts_rs6000lynx_h
-
-#include "hosts/lynx.h"
-
-#define HOST_MACHINE_ARCH bfd_arch_rs6000
-
-#endif /* hosts_rs6000lynx_h */
diff --git a/bfd/hosts/rtbsd.h b/bfd/hosts/rtbsd.h
deleted file mode 100644
index 957065f..0000000
--- a/bfd/hosts/rtbsd.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-extern char *malloc();
-extern void free();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/solaris2.h b/bfd/hosts/solaris2.h
deleted file mode 100644
index 90148f7..0000000
--- a/bfd/hosts/solaris2.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "hosts/sysv4.h"
diff --git a/bfd/hosts/sparc-ll.h b/bfd/hosts/sparc-ll.h
deleted file mode 100644
index 23fc3bd..0000000
--- a/bfd/hosts/sparc-ll.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Host definition file for Sun-4 running with gcc, using "long long"
- for addresses, to handle 64-bit target systems. */
-#include <stddef.h>
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <alloca.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-/* Make the basic types 64-bit quantities on the host */
-#define BFD_HOST_64_BIT long long
-
-extern int abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern int fcntl PARAMS ((int des, int cmd, int e));
-extern int fprintf PARAMS ((FILE *,char *,...));
-extern int printf PARAMS ((char *,...));
-extern int qsort PARAMS ((void *data, int els, int siz, int func()));
-extern void exit PARAMS ((int));
-extern int fseek PARAMS ((FILE*, int, int));
-extern int fclose PARAMS ((FILE*));
-extern void bcopy PARAMS ((char*, char*, int));
-extern int bcmp PARAMS ((char *, char *, int));
-extern void bzero PARAMS ((char *, int));
-extern PTR memset PARAMS ((PTR, int, unsigned int));
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-#endif
-
-#ifndef __GNUC__
- PTR memcpy PARAMS ((PTR, CONST PTR, unsigned int));
-#else
-/* char * memcpy PARAMS ((char *, CONST char *, unsigned int)); */
-#endif
-
-extern int getuid PARAMS (());
-extern int getgid PARAMS (());
-extern char * strchr();
-extern void perror PARAMS ((CONST char *));
-extern char *getenv();
-extern char *memchr();
-extern char *strrchr();
-extern int chmod();
-extern int fread();
-extern int fstat();
-extern int fwrite();
-extern int sscanf();
-extern int stat();
-extern int strtol();
-
-extern int free PARAMS ((PTR));
-
-
-extern char *strrchr();
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int time();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern char *getenv();
-extern int fputc();
-extern int unlink();
-
-
-#ifdef __GNUC__
-typedef unsigned long long uint64e_type;
-
-#else
-typedef struct {
- unsigned long low, high;
-} uint64e_type;
-
-#endif
-
-#ifdef __GNUC__
-typedef unsigned long long uint64_type;
-typedef long long int64_type;
-#else
-typedef struct {
- unsigned long low, high;
-} uint64_type;
-
-typedef struct {
- unsigned long low, high;
-} int64_type;
-
-#endif
-
-#define BYTES_IN_PRINTF_INT 4
-#ifndef __GNUC__
-#define uint64_typeLOW(x) (unsigned long)(((x).low))
-#define uint64_typeHIGH(x) (unsigned long)(((x).high))
-#else
-#define uint64_typeLOW(x) (unsigned long)(((x) & 0xffffffff))
-#define uint64_typeHIGH(x) (unsigned long)(((x) >> 32) & 0xffffffff)
-#endif
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/sparc.h b/bfd/hosts/sparc.h
deleted file mode 100644
index 08fce90..0000000
--- a/bfd/hosts/sparc.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef hosts_sparc_H
-#define STDC_HEADERS
-#define FILE_OFFSET_IS_CHAR_INDEX
-#if defined(__STDC__) && __GNUC__ >= 2
-#define abort __hide_abort
-#define exit __hide_exit
-#endif
-#include "hosts/std-host.h"
-#include <alloca.h>
-#include <memory.h>
-#undef exit
-#undef abort
-#define hosts_sparc_H
-#endif
diff --git a/bfd/hosts/sparclynx.h b/bfd/hosts/sparclynx.h
deleted file mode 100644
index 0a2f9f2..0000000
--- a/bfd/hosts/sparclynx.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Sparc running LynxOS */
-
-#ifndef hosts_sparclynx_h
-#define hosts_sparclynx_h
-
-#include "hosts/lynx.h"
-
-#define HOST_MACHINE_ARCH bfd_arch_sparc
-
-#endif /* hosts_sparclynx_h */
diff --git a/bfd/hosts/std-host.h b/bfd/hosts/std-host.h
deleted file mode 100644
index 6ce80da..0000000
--- a/bfd/hosts/std-host.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef hosts_std_host_H
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include "ansidecl.h"
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-/*#include <string.h>*/
-#else
-extern char *mktemp ();
-extern PTR memset ();
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc ();
-extern PTR realloc ();
-#endif
-
-#ifndef __GNUC__
-extern PTR memcpy ();
-#else
-/* char * memcpy (); */
-#endif
-
-#ifdef __STDC__
-extern void free ();
-#else
-extern int free();
-#endif
-
-extern char * strchr();
-extern char *getenv();
-extern PTR memchr();
-extern char *strrchr();
-
-extern char *strrchr();
-extern char *ctime();
-extern long atol();
-extern char *getenv();
-#endif /* STDC_HEADERS */
-
-#ifndef BYTES_IN_PRINTF_INT
-#define BYTES_IN_PRINTF_INT 4
-#endif
-
-#include "fopen-same.h"
-#define hosts_std_host_H
-#endif
-
-#ifdef STDC_HEADERS
-#include <stddef.h>
-#endif /* STDC_HEADERS */
diff --git a/bfd/hosts/stratus.h b/bfd/hosts/stratus.h
deleted file mode 100644
index 1f8df76..0000000
--- a/bfd/hosts/stratus.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Stratus FTX2 host system */
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#define POSIX_UTIME
-#define HAVE_PROCFS /* This host has /proc support */
-
-extern void abort PARAMS ((void));
-extern int close PARAMS ((int));
-extern void exit PARAMS ((int));
-extern int fclose PARAMS ((FILE*));
-extern void free PARAMS ((PTR));
-extern int fseek PARAMS ((FILE*, long, int));
-extern int getgid PARAMS (());
-extern int getuid PARAMS (());
-extern PTR malloc PARAMS ((unsigned));
-extern void perror PARAMS ((CONST char *));
-extern int qsort PARAMS ((void *data, int els, int siz, int func()));
-extern PTR realloc PARAMS ((PTR, unsigned));
-
-extern char *getenv();
-extern int chmod();
-extern int fstat();
-extern int stat();
-extern int strtol();
-
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern int fputc();
-extern int unlink();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/sun3.h b/bfd/hosts/sun3.h
deleted file mode 100644
index 245eddb..0000000
--- a/bfd/hosts/sun3.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <stdlib.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-extern int close PARAMS ((int));
-extern int fprintf PARAMS ((FILE *,CONST char *,...));
-extern int fclose PARAMS ((FILE*));
-extern void bcopy PARAMS ((char*,char*,int));
-extern int bcmp PARAMS ((char *, char *, int));
-extern void bzero PARAMS ((char *, int));
-extern void perror PARAMS ((CONST char *));
-extern char * strchr();
-extern char *memchr();
-extern char *strrchr();
-extern int chmod();
-extern int fstat();
-extern int stat();
-extern int strtol();
-
-extern char *strrchr();
-extern char *ctime();
-extern int _flsbuf();
-extern int fclose();
-extern int utimes();
-extern int vfprintf();
-extern long atol();
-extern char *getenv();
-extern int fputc();
-extern int unlink();
-
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/sysv4.h b/bfd/hosts/sysv4.h
deleted file mode 100644
index 5880d33..0000000
--- a/bfd/hosts/sysv4.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* System V Release 4 Unix host system */
-
-#include <stddef.h>
-#include <ansidecl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <utime.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#define POSIX_UTIME
-
-/* Note that we also use this for ptx4 (sequent). ptx4 does not
- really have procfs, but it has the relevant headers for BFD to read
- core files, so the proper thing to do for ptx4 is define
- HAVE_PROCFS in BFD but not GDB. */
-
-#define HAVE_PROCFS /* This host has /proc support */
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/ultra3.h b/bfd/hosts/ultra3.h
deleted file mode 100644
index cb3f82c..0000000
--- a/bfd/hosts/ultra3.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-
-#define SEEK_SET 0
-#define SEEK_CUR 1
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-extern char *malloc();
-extern void free();
-
-#include "fopen-same.h"
diff --git a/bfd/hosts/we32k.h b/bfd/hosts/we32k.h
deleted file mode 100644
index 00b2878..0000000
--- a/bfd/hosts/we32k.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <ansidecl.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/file.h>
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#ifndef DONTDECLARE_MALLOC
-extern PTR malloc PARAMS ((unsigned));
-extern PTR realloc PARAMS ((PTR, unsigned));
-#endif
-extern int abort PARAMS ((void));
-extern int free PARAMS ((PTR));
-extern void bcopy PARAMS ((char*, char*, int));
-extern void exit PARAMS ((int));
-extern void bzero PARAMS ((char *, int));
-extern int strtol();
-#define NO_STDARG 1
-
-#include "fopen-same.h"
diff --git a/bfd/opncls.c b/bfd/opncls.c
index b28d6b0..f3872bf 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -1,5 +1,5 @@
/* opncls.c -- open and close a BFD.
- Copyright (C) 1990 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -16,7 +16,7 @@ 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. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -199,7 +199,7 @@ bfd_fdopenr (filename, target, fd)
bfd_set_error (bfd_error_system_call);
-#ifdef NO_FCNTL
+#if ! defined(HAVE_FCNTL) || ! defined(F_GETFL)
fdflags = O_RDWR; /* Assume full access */
#else
fdflags = fcntl (fd, F_GETFL, NULL);
diff --git a/bfd/srec.c b/bfd/srec.c
index 34c8ce7..2e4b732 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -107,6 +107,7 @@ DESCRIPTION
#include "sysdep.h"
#include "libbfd.h"
#include "libiberty.h"
+#include <ctype.h>
static void srec_init PARAMS ((void));
static boolean srec_mkobject PARAMS ((bfd *));
@@ -773,7 +774,8 @@ srec_get_section_contents (abfd, section, location, offset, count)
return false;
}
- memcpy (location, (bfd_byte *) section->used_by_bfd + offset, count);
+ memcpy (location, (bfd_byte *) section->used_by_bfd + offset,
+ (size_t) count);
return true;
}
@@ -809,7 +811,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
bfd_set_error (bfd_error_no_memory);
return false;
}
- memcpy ((PTR) data, location, bytes_to_do);
+ memcpy ((PTR) data, location, (size_t) bytes_to_do);
if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
{
diff --git a/bfd/targets.c b/bfd/targets.c
index 369ffd2..8d741a6 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -267,7 +267,8 @@ The general target vector.
.CAT(NAME,_bfd_merge_private_bfd_data),\
.CAT(NAME,_bfd_copy_private_section_data),\
.CAT(NAME,_bfd_copy_private_symbol_data),\
-.CAT(NAME,_bfd_set_private_flags)
+.CAT(NAME,_bfd_set_private_flags),\
+.CAT(NAME,_bfd_print_private_bfd_data)\
. {* Called to copy BFD general private data from one object file
. to another. *}
. boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
@@ -285,6 +286,9 @@ The general target vector.
. {* Called to set private backend flags *}
. boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
.
+. {* Called to print private BFD data *}
+. boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, void *));
+.
. {* Core file entry points. *}
.#define BFD_JUMP_TABLE_CORE(NAME)\
.CAT(NAME,_core_file_failing_command),\
@@ -661,8 +665,10 @@ const bfd_target * const bfd_target_vector[] = {
&i386os9k_vec,
&i386pe_vec,
&i386pei_vec,
- &armpe_vec,
- &armpei_vec,
+ &armpe_little_vec,
+ &armpe_big_vec,
+ &armpei_little_vec,
+ &armpei_big_vec,
&icoff_big_vec,
&icoff_little_vec,
&ieee_vec,
@@ -829,7 +835,7 @@ const char **
bfd_target_list ()
{
int vec_length= 0;
-#ifdef NATIVE_HPPAHPUX_COMPILER
+#if defined (HOST_HPPAHPUX) && ! defined (__STDC__)
/* The native compiler on the HP9000/700 has a bug which causes it
to loop endlessly when compiling this file. This avoids it. */
volatile
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index 9c16bd7..427f6fc 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -1,5 +1,5 @@
/* BFD back end for traditional Unix core files (U-area and raw sections)
- Copyright 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -16,15 +16,7 @@ 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. */
-
-/* To use this file on a particular host, configure the host with these
- parameters in the config/h-HOST file:
-
- HDEFINES=-DTRAD_CORE
- HDEPFILES=trad-core.o
-
- */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@@ -38,15 +30,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <signal.h>
#include <sys/user.h> /* After a.out.h */
-#if 0
-/* file.h is included by std-host.h. So we better not try to include it
- twice; on some systems (dpx2) it is not protected against multiple
- inclusion. I have checked that all the hosts which use this file
- include sys/file.h in the hosts file. */
-#include <sys/file.h>
-#endif
-#include <errno.h>
+#ifdef TRAD_HEADER
+#include TRAD_HEADER
+#endif
struct trad_core_struct
{
@@ -63,7 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* forward declarations */
-bfd_target * trad_unix_core_file_p PARAMS ((bfd *abfd));
+const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd));
char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd));
int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd));
boolean trad_unix_core_file_matches_executable_p
@@ -72,7 +59,7 @@ boolean trad_unix_core_file_matches_executable_p
/* Handle 4.2-style (and perhaps also sysV-style) core dump file. */
/* ARGSUSED */
-bfd_target *
+const bfd_target *
trad_unix_core_file_p (abfd)
bfd *abfd;
@@ -185,7 +172,7 @@ trad_unix_core_file_p (abfd)
core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
- core_regsec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+ core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
core_datasec (abfd)->_raw_size = NBPG * u.u_dsize
#ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
@@ -290,7 +277,7 @@ swap_abort()
#define NO_SIGNED_GET \
((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
-bfd_target trad_core_vec =
+const bfd_target trad_core_vec =
{
"trad-core",
bfd_target_unknown_flavour,
@@ -334,6 +321,7 @@ bfd_target trad_core_vec =
BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
BFD_JUMP_TABLE_WRITE (_bfd_generic),
BFD_JUMP_TABLE_LINK (_bfd_nolink),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
(PTR) 0 /* backend_data */
};