Remove rcfonts.tex after building refcard.
[deliverable/binutils-gdb.git] / ld / ld-gld960.c
CommitLineData
2fa0b342
DHW
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$
2fa0b342
DHW
21*/
22
23/*
24 * emulate the Intels port of gld
25 */
26
27
28#include "sysdep.h"
29#include "bfd.h"
30
31
32#include "ld.h"
33#include "config.h"
34#include "ld-emul.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
99fe4553
SC
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
2fa0b342
DHW
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
99fe4553
SC
86#endif /* GNU960 */
87
2fa0b342
DHW
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{
111 /* Set the output architecture and machine if possible */
112 unsigned long machine = 0;
113 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
114}
115
116static char *
117gld960_choose_target()
118{
99fe4553
SC
119#ifdef GNU960
120
121 output_filename = "b.out";
122 return bfd_make_targ_name(BFD_BOUT_FORMAT,HOST_BYTE_ORDER_BIG_P);
123
124#else
125
2fa0b342
DHW
126 char *from_outside = getenv(TARGET_ENVIRON);
127 output_filename = "b.out";
128
129 if (from_outside != (char *)NULL)
130 return from_outside;
131 return GLD960_TARGET;
99fe4553
SC
132
133#endif
2fa0b342
DHW
134}
135
136static void
137gld960_syslib()
138{
139 info("%S SYSLIB ignored\n");
140}
141
142static void
143gld960_hll()
144{
145 info("%S HLL ignored\n");
146}
147
148
1418c83b
SC
149static char *script =
150#include "ld-gld960.x"
151;
152
2fa0b342
DHW
153
154static char *
155gld960_get_script()
156{
157return script;
158}
159
160struct ld_emulation_xfer_struct ld_gld960_emulation =
161{
162 gld960_before_parse,
163 gld960_syslib,
164 gld960_hll,
165 gld960_after_parse,
166 gld960_after_allocation,
167 gld960_set_output_arch,
168 gld960_choose_target,
169 gld960_before_allocation,
170 gld960_get_script,
171};
This page took 0.041612 seconds and 4 git commands to generate.