* configure.in (case ${host}): Map *-*-sysv4* to gas_host=sysv.
[deliverable/binutils-gdb.git] / ld / emultempl / m88kbcs.em
CommitLineData
a6152e39
DM
1# This shell script emits a C file. -*- C -*-
2# It does some substitutions.
3cat >em_${EMULATION_NAME}.c <<EOF
4/* This file is is generated by a shell script. DO NOT EDIT! */
5
6/* emulate the original gld for the given ${EMULATION_NAME}
7 Copyright (C) 1991 Free Software Foundation, Inc.
8 Written by Steve Chamberlain steve@cygnus.com
9
10This file is part of GLD, the Gnu Linker.
11
12This program is free software; you can redistribute it and/or modify
13it under the terms of the GNU General Public License as published by
14the Free Software Foundation; either version 2 of the License, or
15(at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
25
26#define TARGET_IS_${EMULATION_NAME}
27
28#include "bfd.h"
29#include "sysdep.h"
30#include "ld.h"
31#include "config.h"
32#include "ldemul.h"
33#include "ldfile.h"
34#include "ldmisc.h"
35
36extern boolean lang_float_flag;
37
38extern enum bfd_architecture ldfile_output_architecture;
39extern unsigned long ldfile_output_machine;
40extern char *ldfile_output_machine_name;
41
42static void
43gld${EMULATION_NAME}_before_parse()
44{
45 extern char lprefix;
46 lprefix = '@';
47
48 ldfile_output_architecture = bfd_arch_${ARCH};
49}
50
51static char *
52gld${EMULATION_NAME}_get_script(isfile)
53 int *isfile;
54EOF
55
56if test "$DEFAULT_EMULATION" = "$EMULATION_NAME"
57then
58# Scripts compiled in.
59
60# sed commands to quote an ld script as a C string.
61sc='s/["\\]/\\&/g
62s/$/\\n\\/
631s/^/"{/
64$s/$/n}"/
65'
66
67cat >>em_${EMULATION_NAME}.c <<EOF
68{
69 extern ld_config_type config;
70
71 *isfile = 0;
72
73 if (config.relocateable_output == true && config.build_constructors == true)
74 return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
75 else if (config.relocateable_output == true)
76 return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
77 else if (!config.text_read_only)
78 return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
79 else if (!config.magic_demand_paged)
80 return `sed "$sc" ldscripts/${EMULATION_NAME}.xn`;
81 else
82 return `sed "$sc" ldscripts/${EMULATION_NAME}.x`;
83}
84EOF
85
86else
87# Scripts read from the filesystem.
88
89cat >>em_${EMULATION_NAME}.c <<EOF
90{
91 extern ld_config_type config;
92
93 *isfile = 1;
94
95 if (config.relocateable_output == true && config.build_constructors == true)
96 return "ldscripts/${EMULATION_NAME}.xu";
97 else if (config.relocateable_output == true)
98 return "ldscripts/${EMULATION_NAME}.xr";
99 else if (!config.text_read_only)
100 return "ldscripts/${EMULATION_NAME}.xbn";
101 else if (!config.magic_demand_paged)
102 return "ldscripts/${EMULATION_NAME}.xn";
103 else
104 return "ldscripts/${EMULATION_NAME}.x";
105}
106EOF
107
108fi
109
110cat >>em_${EMULATION_NAME}.c <<EOF
111
112struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation =
113{
114 gld${EMULATION_NAME}_before_parse,
115 syslib_default,
116 hll_default,
117 after_parse_default,
118 after_allocation_default,
119 set_output_arch_default,
120 ldemul_default_target,
121 before_allocation_default,
122 gld${EMULATION_NAME}_get_script,
123 "${EMULATION_NAME}",
124 "${OUTPUT_FORMAT}"
125};
126EOF
This page took 0.026856 seconds and 4 git commands to generate.