aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-09-25 18:11:04 +0000
committerSteve Chamberlain <sac@cygnus>1992-09-25 18:11:04 +0000
commit22a78f0d961fdab4eadf6694a636a6b57d3013ad (patch)
tree07a7b2d21ae74990a8f586b78e8fe40db64b86e1
parentf4e56031512d5c5621fa2e21e7f3e964718ff39c (diff)
downloadgdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.zip
gdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.tar.gz
gdb-22a78f0d961fdab4eadf6694a636a6b57d3013ad.tar.bz2
Fri Sep 25 11:08:01 1992 Steve Chamberlain (sac@thepub.cygnus.com)
Added initial support for the z8k * z8ksim.em, z8ksim.sc-sh, z8ksim.sh: new files * configure.in, Makefile.in: modified to reflect above * ldlang.c (lang_check): when linking conflicting architectures, make the output file reflect at least one of the bad inputs.
-rw-r--r--ld/.Sanitize15
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/Makefile.in6
-rw-r--r--ld/ldlang.c54
-rw-r--r--ld/z8ksim.em86
-rwxr-xr-xld/z8ksim.sc-sh26
-rwxr-xr-xld/z8ksim.sh8
7 files changed, 180 insertions, 24 deletions
diff --git a/ld/.Sanitize b/ld/.Sanitize
index b91e519..e22cec0 100644
--- a/ld/.Sanitize
+++ b/ld/.Sanitize
@@ -119,6 +119,9 @@ sun4.sh
vanilla.em
vanilla.sc-sh
vanilla.sh
+z8ksim.em
+z8ksim.sc-sh
+z8ksim.sh
Do-last:
@@ -127,7 +130,17 @@ echo Done in `pwd`.
#
#
# $Log$
-# Revision 1.46 1992/09/11 20:43:30 sac
+# Revision 1.47 1992/09/25 18:10:41 sac
+# Fri Sep 25 11:08:01 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+#
+# Added initial support for the z8k
+# * z8ksim.em, z8ksim.sc-sh, z8ksim.sh: new files
+# * configure.in, Makefile.in: modified to reflect above
+#
+# * ldlang.c (lang_check): when linking conflicting architectures,
+# make the output file reflect at least one of the bad inputs.
+#
+# Revision 1.46 1992/09/11 20:43:30 sac
# Sanitize slip
#
# Revision 1.45 1992/09/11 17:47:22 sac
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ed5ad59..c9cc7f4 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+Fri Sep 25 11:08:01 1992 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ Added initial support for the z8k
+ * z8ksim.em, z8ksim.sc-sh, z8ksim.sh: new files
+ * configure.in, Makefile.in: modified to reflect above
+
+ * ldlang.c (lang_check): when linking conflicting architectures,
+ make the output file reflect at least one of the bad inputs.
+
Tue Sep 15 15:35:38 1992 Ian Lance Taylor (ian@cygnus.com)
* Makefile.in (install): if $(tooldir) exists, install ld in
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 194c901..926766b 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -119,7 +119,7 @@ ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o \
em_h8300hms.o em_ebmon29k.o em_sun4.o em_gld960.o \
em_m68kcoff.o em_h8300xray.o em_st2000.o em_sa29200.o \
- em_vanilla.o em_i386coff.o
+ em_vanilla.o em_i386coff.o em_z8ksim.o
EMULATION_OFILES=${ALL_EMULATIONS}
#EMULATION_OFILES=em_${EMUL}.o ${OTHER_EMULATIONS}
@@ -228,6 +228,9 @@ em_h8300xray.c: $(srcdir)/h8300xray.sh \
em_st2000.c: $(srcdir)/st2000.sh \
$(srcdir)/st2000.em $(srcdir)/st2000.sc-sh ${GEN_DEPENDS}
${GENSCRIPTS} st2000.sh
+em_z8ksim.c: $(srcdir)/z8ksim.sh \
+ $(srcdir)/z8ksim.em $(srcdir)/z8ksim.sc-sh ${GEN_DEPENDS}
+ ${GENSCRIPTS} z8ksim.sh
em_vanilla.c: $(srcdir)/vanilla.sh \
$(srcdir)/vanilla.em $(srcdir)/vanilla.sc-sh ${GEN_DEPENDS}
${GENSCRIPTS} vanilla.sh
@@ -381,6 +384,7 @@ ldgram.c:ldgram.y
h8300hms.o:h8300hms.c
h8300xray.o:h8300xray.c
st2000.o:st2000.c
+z8ksim.o:z8ksim.c
stage1: force
-mkdir stage1
diff --git a/ld/ldlang.c b/ld/ldlang.c
index cb6ad58..447f2b8 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1846,34 +1846,44 @@ static void
DEFUN_VOID (lang_finish)
{
ldsym_type *lgs;
-
+ int warn = 1;
if (entry_symbol == (char *) NULL)
- {
- /* No entry has been specified, look for start */
- entry_symbol = "start";
- }
+ {
+ /* No entry has been specified, look for start, but don't warn */
+ entry_symbol = "start";
+ warn =0;
+ }
lgs = ldsym_get_soft (entry_symbol);
if (lgs && lgs->sdefs_chain)
- {
- asymbol *sy = *(lgs->sdefs_chain);
+ {
+ asymbol *sy = *(lgs->sdefs_chain);
- /* We can set the entry address*/
- bfd_set_start_address (output_bfd,
- outside_symbol_address (sy));
+ /* We can set the entry address*/
+ bfd_set_start_address (output_bfd,
+ outside_symbol_address (sy));
- }
+ }
else
+ {
+ /* Can't find anything reasonable,
+ use the first address in the text section
+ */
+ asection *ts = bfd_get_section_by_name (output_bfd, ".text");
+ if (ts)
{
- /* Can't find anything reasonable,
- use the first address in the text section
- */
- asection *ts = bfd_get_section_by_name (output_bfd, ".text");
+ if (warn)
+ einfo ("%P: Warning, can't find entry symbol %s, defaulting to %V\n",
+ entry_symbol, ts->vma);
- if (ts)
- {
- bfd_set_start_address (output_bfd, ts->vma);
- }
+ bfd_set_start_address (output_bfd, ts->vma);
}
+ else
+ {
+ if (warn)
+ einfo ("%P: Warning, can't find entry symbol %s, not setting start address\n",
+ entry_symbol);
+ }
+ }
}
/* By now we know the target architecture, and we may have an */
@@ -1905,7 +1915,7 @@ DEFUN_VOID (lang_check)
compatible = bfd_arch_get_compatible (input_bfd,
output_bfd);
-
+
if (compatible)
{
ldfile_output_machine = compatible->mach;
@@ -1919,8 +1929,8 @@ DEFUN_VOID (lang_check)
bfd_printable_name (output_bfd));
bfd_set_arch_mach (output_bfd,
- ldfile_new_output_architecture,
- ldfile_new_output_machine);
+ input_architecture,
+ input_machine);
}
}
diff --git a/ld/z8ksim.em b/ld/z8ksim.em
new file mode 100644
index 0000000..f97ab82
--- /dev/null
+++ b/ld/z8ksim.em
@@ -0,0 +1,86 @@
+cat >em_${EMULATION_NAME}.c <<EOF
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of GLD, the Gnu Linker.
+
+GLD is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+GLD is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GLD; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ Written by Steve Chamberlain steve@cygnus.com
+
+*/
+
+#include "bfd.h"
+#include "sysdep.h"
+
+#include "ld.h"
+#include "config.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldmisc.h"
+
+extern boolean lang_float_flag;
+
+
+extern enum bfd_architecture ldfile_output_architecture;
+extern unsigned long ldfile_output_machine;
+extern char *ldfile_output_machine_name;
+
+extern bfd *output_bfd;
+
+
+
+static void z8ksim_before_parse()
+{
+ ldfile_output_architecture = bfd_arch_z8k;
+}
+
+static char *z8ksim_script =
+#include "z8ksim.x"
+;
+static char *z8ksim_script_option_Ur =
+#include "z8ksim.x"
+;
+static char *z8ksim_script_option_r =
+#include "z8ksim.x"
+;
+
+static char *z8ksim_get_script()
+{
+ extern ld_config_type config;
+ if (config.relocateable_output == true &&
+ config.build_constructors == true) {
+ return z8ksim_script_option_Ur;
+ }
+ if (config.relocateable_output) {
+ return z8ksim_script_option_r;
+ }
+
+ return z8ksim_script;
+}
+struct ld_emulation_xfer_struct ld_z8ksim_emulation =
+{
+ z8ksim_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ after_allocation_default,
+ set_output_arch_default,
+ ldemul_default_target,
+ before_allocation_default,
+ z8ksim_get_script,
+ "z8ksim"
+};
+EOF
diff --git a/ld/z8ksim.sc-sh b/ld/z8ksim.sc-sh
new file mode 100755
index 0000000..7ee132a
--- /dev/null
+++ b/ld/z8ksim.sc-sh
@@ -0,0 +1,26 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+
+SECTIONS
+{
+.text :
+ {
+ *(.text)
+ *(.strings)
+ _etext = .;
+ *(.data)
+ _edata = .;
+ *(.bss)
+ *(COMMON)
+ _end = .;
+
+}
+
+}
+EOF
+
+
+
+
diff --git a/ld/z8ksim.sh b/ld/z8ksim.sh
new file mode 100755
index 0000000..1b5a405
--- /dev/null
+++ b/ld/z8ksim.sh
@@ -0,0 +1,8 @@
+EMULATION_NAME=z8ksim
+SCRIPT_NAME=z8ksim
+OUTPUT_FORMAT="coff-z8k"
+TEXT_START_ADDR=0x0
+PAGE_SIZE=128
+ARCH=z8k
+TEMPLATE_NAME=z8ksim
+