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 original gld running on an i386v system
26 * Written by David Wood @ New York University
39 extern boolean lang_float_flag
;
42 extern enum bfd_architecture ldfile_output_architecture
;
43 extern unsigned long ldfile_output_machine
;
44 extern char *ldfile_output_machine_name
;
46 extern bfd
*output_bfd
;
50 static void gldi386v_before_parse()
52 #ifndef NOTDEF /* Cross developing for now */
53 ldfile_add_library_path("/usr/local/lib/386gcc-lib/lib");
54 ldfile_add_library_path("/usr/local/lib/386gcc-lib/usr/lib");
55 ldfile_add_library_path("/usr/local/lib/386gcc-lib/usr/local/lib");
57 ldfile_output_architecture
= bfd_arch_i386
;
62 gldi386v_after_parse()
68 gldi386v_after_allocation()
74 gldi386v_before_allocation()
80 gldi386v_set_output_arch()
82 /* Set the output architecture and machine if possible */
83 unsigned long machine
= 0;
84 bfd_set_arch_mach(output_bfd
, ldfile_output_architecture
, machine
);
88 gldi386v_choose_target()
90 char *from_outside
= getenv(TARGET_ENVIRON
);
91 if (from_outside
!= (char *)NULL
)
93 return GLDi386v_TARGET
;
99 info("%S SYSLIB ignored\n");
106 info("%S HLL ignored\n");
109 static char *gldi386v_script
=
110 #include "ldgldi386v.x"
113 static char *gldi386v_script_option_Ur
=
114 #include "ldgldi386vUr.x"
116 static char *gldi386v_script_option_r
=
117 #include "ldgldi386vr.x"
119 static char *gldi386v_get_script()
121 extern ld_config_type config
;
122 if (config
.relocateable_output
== true &&
123 config
.build_constructors
== true) {
124 return gldi386v_script_option_Ur
;
126 if (config
.relocateable_output
) {
127 return gldi386v_script_option_r
;
130 return gldi386v_script
;
132 struct ld_emulation_xfer_struct ld_gldi386v_emulation
=
134 gldi386v_before_parse
,
137 gldi386v_after_parse
,
138 gldi386v_after_allocation
,
139 gldi386v_set_output_arch
,
140 gldi386v_choose_target
,
141 gldi386v_before_allocation
,