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. */
25 * emulate the original gld
27 * Written by Steve Chamberlain steve@cygnus.com
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;
52 static void gld_before_parse()
54 ldfile_add_library_path("/lib");
55 ldfile_add_library_path("/usr/lib");
56 ldfile_add_library_path("/usr/local/lib/lib");
57 ldfile_output_architecture = bfd_arch_sparc;
68 gld_after_allocation()
74 gld_before_allocation()
83 /* Set the output architecture and machine if possible */
84 unsigned long machine = 0;
85 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
91 char *from_outside = getenv(TARGET_ENVIRON);
92 if (from_outside != (char *)NULL)
100 info("%S SYSLIB ignored\n");
107 info("%S HLL ignored\n");
110 static char *gld_script =
114 static char *gld_script_option_Ur =
115 #include "ld-gld-Ur.x"
118 static char *gld_script_option_r =
119 #include "ld-gld-r.x"
122 static char *gld_get_script()
124 extern ld_config_type config;
125 if (config.relocateable_output == true &&
126 config.build_constructors == true) {
127 return gld_script_option_Ur;
129 if (config.relocateable_output) {
130 return gld_script_option_r;
135 struct ld_emulation_xfer_struct ld_gld_emulation =
141 gld_after_allocation,
144 gld_before_allocation,