Add '#define HAVE_PROCFS', move '#include "fopen-same.h" to end of file
[deliverable/binutils-gdb.git] / ld / ldgld960.c
CommitLineData
15ed1567
SC
1/* Copyright (C) 1991 Free Software Foundation, Inc.
2
3This file is part of GLD, the Gnu Linker.
4
5GLD is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 1, or (at your option)
8any later version.
9
10GLD is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with GLD; see the file COPYING. If not, write to
17the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
18
19/*
20 $Id$
21*/
22
23/*
24 * emulate the Intels port of gld
25 */
26
27
15ed1567 28#include "bfd.h"
f177a611 29#include "sysdep.h"
15ed1567
SC
30
31
32#include "ld.h"
33#include "config.h"
34#include "ldemul.h"
35#include "ldfile.h"
36#include "ldmisc.h"
37
38
39/* IMPORTS */
40extern char *output_filename;
41extern boolean lang_float_flag;
42
43
44extern enum bfd_architecture ldfile_output_architecture;
45extern unsigned long ldfile_output_machine;
46extern char *ldfile_output_machine_name;
47
48extern bfd *output_bfd;
49
50
51
52#ifdef GNU960
53
54static void
55gld960_before_parse()
56{
57 static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
58 char **p;
59 char *env ;
60
61 for ( p = env_variables; *p; p++ ){
62 env = (char *) getenv(*p);
63 if (env) {
64 ldfile_add_library_path(concat(env,"/lib/libbout",""));
65 }
66 }
67 ldfile_output_architecture = bfd_arch_i960;
68}
69
70#else /* not GNU960 */
71
72static void gld960_before_parse()
73{
74 char *env ;
75 env = getenv("G960LIB");
76 if (env) {
77 ldfile_add_library_path(env);
78 }
79 env = getenv("G960BASE");
80 if (env) {
81 ldfile_add_library_path(concat(env,"/lib",""));
82 }
83 ldfile_output_architecture = bfd_arch_i960;
84}
85
86#endif /* GNU960 */
87
88
89static void
90gld960_after_parse()
91{
92
93}
94
95static void
96gld960_after_allocation()
97{
98
99}
100
101static void
102gld960_before_allocation()
103{
104
105}
106
107
108static void
109gld960_set_output_arch()
110{
19b03b7a 111 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, bfd_mach_i960_core);
15ed1567
SC
112}
113
114static char *
115gld960_choose_target()
116{
117#ifdef GNU960
118
119 output_filename = "b.out";
19b03b7a 120 return bfd_make_targ_name(BFD_BOUT_FORMAT, 0);
15ed1567
SC
121
122#else
123
124 char *from_outside = getenv(TARGET_ENVIRON);
125 output_filename = "b.out";
126
127 if (from_outside != (char *)NULL)
128 return from_outside;
129 return GLD960_TARGET;
130
131#endif
132}
133
134static void
135gld960_syslib()
136{
137 info("%S SYSLIB ignored\n");
138}
139
140static void
141gld960_hll()
142{
143 info("%S HLL ignored\n");
144}
145
146
147static char *script =
148#include "ldgld960.x"
149;
150
151
152static char *
153gld960_get_script()
154{
155return script;
156}
157
158struct ld_emulation_xfer_struct ld_gld960_emulation =
159{
160 gld960_before_parse,
161 gld960_syslib,
162 gld960_hll,
163 gld960_after_parse,
164 gld960_after_allocation,
165 gld960_set_output_arch,
166 gld960_choose_target,
167 gld960_before_allocation,
168 gld960_get_script,
169};
This page took 0.040939 seconds and 4 git commands to generate.