aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
committerDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
commit8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb (patch)
treef921e9cedac5cd479f9954d6b30598061db2e93d /ld/emultempl
parent21cc14d8505ad50143ea248c0de12bfa9eecf1e7 (diff)
downloadgdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.zip
gdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.gz
gdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.bz2
* ldfile.c (ldfile_open_command): Don't try .ld extension.
It wasn't documented (or likely used) and wastes time. (try_open): If EXTEN is empty, don't try it. * ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c, ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c, ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls with normal function declarations. * Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh. Move *.sc-sh to scripttempl/*.sc. * {emultempl,emulparams,scripttempl}/README: New files. * sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files removed, replaced with generic.em. * h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from h8[35]00hms.s[ch]. Change their contents to omit the "hms". * *.em (*_get_script): Return script name instead of script contents. * ldlang.c (lang_process): Change caller. * ldlex.l, ldgram.y: Recognize -m option. Check for input files after *all* options in grammar. * ldmain.c (main): Check for -m options. Add default directory for -m. * mkscript.c: File removed. * genscripts.sh: Take two more parameters, tooldirlib and libdir, to add to the default LIB_PATH. Look for input files in the new subdirectories. Create the scripts in emulations subdirectory and don't filter them through mkscript. * configure.in: Make the emulations subdirectory. * Makefile.in: Account for all of the above changes. Remove unused .SUFFIXES. Get libgcc.a path with gcc -print-libgcc-file-name instead of $(libdir)/libgcc.a. Put CFLAGS last in the compilation rules. Add -I../bfd to INCLUDES so sysdep.h is found. * ldfile.c (try_open): If opening without the extension fails, try with the extension even if -v or -V was given. had_script is imported (from ldgram.y), not exported.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/.Sanitize41
-rw-r--r--ld/emultempl/README3
-rw-r--r--ld/emultempl/hppaosf.em115
-rw-r--r--ld/emultempl/vanilla.em74
4 files changed, 233 insertions, 0 deletions
diff --git a/ld/emultempl/.Sanitize b/ld/emultempl/.Sanitize
new file mode 100644
index 0000000..32d8d10
--- /dev/null
+++ b/ld/emultempl/.Sanitize
@@ -0,0 +1,41 @@
+# .Sanitize for devo/ld/config
+
+# Each directory to survive its way into a release will need a file
+# like this one called "./.Sanitize". All keyword lines must exist,
+# and must exist in the order specified by this file. Each directory
+# in the tree will be processed, top down, in the following order.
+
+# Hash started lines like this one are comments and will be deleted
+# before anything else is done. Blank lines will also be squashed
+# out.
+
+# The lines between the "Do-first:" line and the "Things-to-keep:"
+# line are executed as a /bin/sh shell script before anything else is
+# done in this directory.
+
+Do-first:
+
+
+# All files listed between the "Things-to-keep:" line and the
+# "Do-last:" line will be kept. All other files will be removed.
+# Directories listed in this section will have their own Sanitize
+# called. Directories not listed will be removed in their entirety
+# with rm -rf.
+
+Things-to-keep:
+
+README
+generic.em
+gld960.em
+hppaosf.em
+lnk960.em
+vanilla.em
+
+Things-to-lose:
+
+# The lines between the "Do-last:" line and the end of the file
+# are executed as a /bin/sh shell script after everything else is
+# done.
+
+Do-last:
+
diff --git a/ld/emultempl/README b/ld/emultempl/README
new file mode 100644
index 0000000..30ec0ab
--- /dev/null
+++ b/ld/emultempl/README
@@ -0,0 +1,3 @@
+The files in this directory are sourced by genscripts.sh, after
+setting some variables to substitute in, to produce
+C source files that contain jump tables for each emulation.
diff --git a/ld/emultempl/hppaosf.em b/ld/emultempl/hppaosf.em
new file mode 100644
index 0000000..b066f6b
--- /dev/null
+++ b/ld/emultempl/hppaosf.em
@@ -0,0 +1,115 @@
+cat >em_${EMULATION_NAME}.c <<EOF
+/* An emulation for HP PA-RISC OSF/1 linkers.
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ Written by Steve Chamberlain steve@cygnus.com
+
+This file is part of GLD, the Gnu Linker.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#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;
+
+
+#ifdef HPPAOSF
+
+static void hppaosf_before_parse()
+{
+ static char *env_variables[] = { "HPPALIB", "HPPABASE", 0 };
+ char **p;
+ char *env ;
+
+ for ( p = env_variables; *p; p++ ){
+ env = (char *) getenv(*p);
+ if (env) {
+ ldfile_add_library_path(concat(env,"/lib/libbout",""));
+ }
+ }
+ ldfile_output_architecture = bfd_arch_hppa;
+}
+#else
+static void hppaosf_before_parse()
+{
+ char *env ;
+ env = getenv("HPPALIB");
+ if (env) {
+ ldfile_add_library_path(env);
+ }
+ env = getenv("HPPABASE");
+ if (env) {
+ ldfile_add_library_path(concat(env,"/lib",""));
+ }
+ ldfile_output_architecture = bfd_arch_hppa;
+}
+#endif /* HPPAOSF */
+
+static void
+hppaosf_set_output_arch()
+{
+ /* Set the output architecture and machine if possible */
+ unsigned long machine = 0;
+ bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
+}
+
+static char *script =
+"hppaosf.x"
+;
+
+
+static char *script_reloc =
+"hppaosf.xr"
+ ;
+
+
+static char *hppaosf_get_script()
+{
+ extern ld_config_type config;
+ if (config.relocateable_output)
+ return script_reloc;
+ return script;
+
+}
+
+struct ld_emulation_xfer_struct ld_hppaosf_emulation =
+{
+ hppaosf_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ after_allocation_default,
+ hppaosf_set_output_arch,
+ ldemul_default_target,
+ before_allocation_default,
+ hppaosf_get_script,
+ "hppaosf",
+ "elf-big"
+};
+EOF
diff --git a/ld/emultempl/vanilla.em b/ld/emultempl/vanilla.em
new file mode 100644
index 0000000..a754a9a
--- /dev/null
+++ b/ld/emultempl/vanilla.em
@@ -0,0 +1,74 @@
+cat >em_${EMULATION_NAME}.c <<EOF
+/* A vanilla emulation with no defaults
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ Written by Steve Chamberlain steve@cygnus.com
+
+This file is part of GLD, the Gnu Linker.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#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 vanilla_before_parse()
+{
+}
+
+static void
+vanilla_set_output_arch()
+{
+ /* Set the output architecture and machine if possible */
+ unsigned long machine = 0;
+ bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
+}
+
+static char *vanilla_get_script()
+{
+ return "/dev/null";
+}
+
+struct ld_emulation_xfer_struct ld_vanilla_emulation =
+{
+ vanilla_before_parse,
+ syslib_default,
+ hll_default,
+ after_parse_default,
+ after_allocation_default,
+ vanilla_set_output_arch,
+ ldemul_default_target,
+ before_allocation_default,
+ vanilla_get_script,
+ "vanilla",
+ "a.out-sunos-big"
+};
+EOF