Back from Intel with Steve
[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$
21
22 $Log$
c074abee
DHW
23 Revision 1.1.1.1 1991/03/21 21:28:27 gumby
24 Back from Intel with Steve
2fa0b342 25
c074abee
DHW
26 * Revision 1.1 1991/03/21 21:28:26 gumby
27 * Initial revision
28 *
2fa0b342
DHW
29 * Revision 1.3 1991/03/16 22:27:24 rich
30 * fish
31 *
32 * Revision 1.2 1991/03/15 18:45:55 rich
33 * foo
34 *
35 * Revision 1.1 1991/03/13 00:48:12 chrisb
36 * Initial revision
37 *
38 * Revision 1.4 1991/03/10 09:31:19 rich
39 * Modified Files:
40 * Makefile config.h ld-emul.c ld-emul.h ld-gld.c ld-gld960.c
41 * ld-lnk960.c ld.h lddigest.c ldexp.c ldexp.h ldfile.c ldfile.h
42 * ldgram.y ldinfo.h ldlang.c ldlang.h ldlex.h ldlex.l ldmain.c
43 * ldmain.h ldmisc.c ldmisc.h ldsym.c ldsym.h ldversion.c
44 * ldversion.h ldwarn.h ldwrite.c ldwrite.h y.tab.h
45 *
46 * As of this round of changes, ld now builds on all hosts of (Intel960)
47 * interest and copy passes my copy test on big endian hosts again.
48 *
49 * Revision 1.3 1991/02/22 17:14:57 sac
50 * Added RCS keywords and copyrights
51 *
52*/
53
54/*
55 * emulate the Intels port of gld
56 */
57
58
59#include "sysdep.h"
60#include "bfd.h"
61
62
63#include "ld.h"
64#include "config.h"
65#include "ld-emul.h"
66#include "ldfile.h"
67#include "ldmisc.h"
68
69
70/* IMPORTS */
71extern char *output_filename;
72extern boolean lang_float_flag;
73
74
75extern enum bfd_architecture ldfile_output_architecture;
76extern unsigned long ldfile_output_machine;
77extern char *ldfile_output_machine_name;
78
79extern bfd *output_bfd;
80
81
82
83static void gld960_before_parse()
84{
85 char *env ;
86 env = getenv("G960LIB");
87 if (env) {
88 ldfile_add_library_path(env);
89 }
90 env = getenv("G960BASE");
91 if (env) {
92 ldfile_add_library_path(concat(env,"/lib",""));
93 }
94 ldfile_output_architecture = bfd_arch_i960;
95}
96
97
98static void
99gld960_after_parse()
100{
101
102}
103
104static void
105gld960_after_allocation()
106{
107
108}
109
110static void
111gld960_before_allocation()
112{
113
114}
115
116
117static void
118gld960_set_output_arch()
119{
120 /* Set the output architecture and machine if possible */
121 unsigned long machine = 0;
122 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
123}
124
125static char *
126gld960_choose_target()
127{
128 char *from_outside = getenv(TARGET_ENVIRON);
129 output_filename = "b.out";
130
131 if (from_outside != (char *)NULL)
132 return from_outside;
133 return GLD960_TARGET;
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
149static char *script = "\
150 \
151SECTIONS \
152{ \
153 .text : \
154 { \
155 CREATE_OBJECT_SYMBOLS \
156 *(.text) \
157 _etext =.;\
158 } \
159 \
160 .data SIZEOF(.text) + ADDR(.text):\
161 { \
162 \
163 *(.data) \
164 _edata = .; \
165 } \
166 .bss SIZEOF(.data) + ADDR(.data) : \
167 { _bss_start = .;\
168 *(.bss) \
169 [COMMON] \
170 _end = . ; \
171 } \
172} \
173";
174
175static char *
176gld960_get_script()
177{
178return script;
179}
180
181struct ld_emulation_xfer_struct ld_gld960_emulation =
182{
183 gld960_before_parse,
184 gld960_syslib,
185 gld960_hll,
186 gld960_after_parse,
187 gld960_after_allocation,
188 gld960_set_output_arch,
189 gld960_choose_target,
190 gld960_before_allocation,
191 gld960_get_script,
192};
This page took 0.02998 seconds and 4 git commands to generate.