1 /* NOTE: If there are angle brackets here: <TARGET> then this is a
2 * template file (ldtemplate), intended for processing by sed.
3 * Otherwise, this file has already been processed by sed,
4 * and customized for a particular emulation target.
5 * In that DO NOT EDIT the file; edit ldtemplate instead.
8 /* Copyright (C) 1991 Free Software Foundation, Inc.
10 This file is part of GLD, the Gnu Linker.
12 GLD is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 1, or (at your option)
17 GLD is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with GLD; see the file COPYING. If not, write to
24 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
31 * emulate the original gld for the given <TARGET>
33 * Written by Steve Chamberlain steve@cygnus.com
36 #define TARGET_IS_<TARGET>
47 extern boolean lang_float_flag;
50 extern enum bfd_architecture ldfile_output_architecture;
51 extern unsigned long ldfile_output_machine;
52 extern char *ldfile_output_machine_name;
54 extern bfd *output_bfd;
58 static void gld<target>_before_parse()
60 #ifdef TARGET_IS_M88KBCS
64 #ifndef TARGET_ /* I.e., if not generic */
65 ldfile_output_architecture = bfd_arch_<arch>;
72 gld<target>_after_parse()
78 gld<target>_after_allocation()
84 gld<target>_before_allocation()
91 gld<target>_set_output_arch()
93 /* Set the output architecture and machine if possible */
94 bfd_set_arch_mach(output_bfd,
95 ldfile_output_architecture, ldfile_output_machine);
99 gld<target>_choose_target()
101 char *from_outside = getenv(TARGET_ENVIRON);
102 if (from_outside != (char *)NULL)
104 return GLD<TARGET>_TARGET;
110 info("%S SYSLIB ignored\n");
114 gld<target>_hll(ignore)
117 info("%S HLL ignored\n");
120 static char *gld<target>_script =
121 #include "<ldtarget>.x"
123 static char *gld<target>_script_option_Ur =
124 #include "<ldtarget>.xu"
126 static char *gld<target>_script_option_r =
127 #include "<ldtarget>.xr"
130 static char *gld<target>_get_script()
132 extern ld_config_type config;
133 if (config.relocateable_output == true &&
134 config.build_constructors == true) {
135 return gld<target>_script_option_Ur;
137 if (config.relocateable_output == true ||
138 config.magic_demand_paged == false) {
139 return gld<target>_script_option_r;
142 return gld<target>_script;
144 struct ld_emulation_xfer_struct ld_gld<target>_emulation =
146 gld<target>_before_parse,
149 gld<target>_after_parse,
150 gld<target>_after_allocation,
151 gld<target>_set_output_arch,
152 gld<target>_choose_target,
153 gld<target>_before_allocation,
154 gld<target>_get_script,