1 /* Copyright (C) 1991 Free Software Foundation, Inc.
3 This file is part of GLD, the Gnu Linker.
5 GLD is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 1, or (at your option)
10 GLD is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GLD; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
24 * emulate the Intels port of gld
40 extern char *output_filename;
41 extern boolean lang_float_flag;
44 extern enum bfd_architecture ldfile_output_architecture;
45 extern unsigned long ldfile_output_machine;
46 extern char *ldfile_output_machine_name;
48 extern bfd *output_bfd;
57 static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
61 for ( p = env_variables; *p; p++ ){
62 env = (char *) getenv(*p);
64 ldfile_add_library_path(concat(env,"/lib/libbout",""));
67 ldfile_output_architecture = bfd_arch_i960;
70 #else /* not GNU960 */
72 static void gld960_before_parse()
75 env = getenv("G960LIB");
77 ldfile_add_library_path(env);
79 env = getenv("G960BASE");
81 ldfile_add_library_path(concat(env,"/lib",""));
83 ldfile_output_architecture = bfd_arch_i960;
96 gld960_after_allocation()
102 gld960_before_allocation()
109 gld960_set_output_arch()
111 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, bfd_mach_i960_core);
115 gld960_choose_target()
119 output_filename = "b.out";
120 return bfd_make_targ_name(BFD_BOUT_FORMAT, 0);
124 char *from_outside = getenv(TARGET_ENVIRON);
125 output_filename = "b.out";
127 if (from_outside != (char *)NULL)
129 return GLD960_TARGET;
137 info("%S SYSLIB ignored\n");
143 info("%S HLL ignored\n");
147 static char *script =
148 #include "ldgld960.x"
158 struct ld_emulation_xfer_struct ld_gld960_emulation =
164 gld960_after_allocation,
165 gld960_set_output_arch,
166 gld960_choose_target,
167 gld960_before_allocation,