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>
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 ldfile_add_library_path("/lib");
65 ldfile_add_library_path("/usr/lib");
66 ldfile_add_library_path("/usr/local/lib");
67 #ifndef TARGET_ /* I.e., if not generic */
68 ldfile_output_architecture = bfd_arch_<arch>;
75 gld<target>_after_parse()
81 gld<target>_after_allocation()
87 gld<target>_before_allocation()
94 gld<target>_set_output_arch()
96 /* Set the output architecture and machine if possible */
97 bfd_set_arch_mach(output_bfd,
98 ldfile_output_architecture, ldfile_output_machine);
102 gld<target>_choose_target()
104 char *from_outside = getenv(TARGET_ENVIRON);
105 if (from_outside != (char *)NULL)
107 return GLD<TARGET>_TARGET;
113 info("%S SYSLIB ignored\n");
117 gld<target>_hll(ignore)
120 info("%S HLL ignored\n");
123 static char *gld<target>_script =
124 #include "<ldtarget>.x"
126 static char *gld<target>_script_option_Ur =
127 #include "<ldtarget>.xu"
129 static char *gld<target>_script_option_r =
130 #include "<ldtarget>.xr"
133 static char *gld<target>_get_script()
135 extern ld_config_type config;
136 if (config.relocateable_output == true &&
137 config.build_constructors == true) {
138 return gld<target>_script_option_Ur;
140 if (config.relocateable_output == true ||
141 config.magic_demand_paged == false) {
142 return gld<target>_script_option_r;
145 return gld<target>_script;
147 struct ld_emulation_xfer_struct ld_gld<target>_emulation =
149 gld<target>_before_parse,
152 gld<target>_after_parse,
153 gld<target>_after_allocation,
154 gld<target>_set_output_arch,
155 gld<target>_choose_target,
156 gld<target>_before_allocation,
157 gld<target>_get_script,