* mipsread.c: Pass NULL name pointer to init_type, not 0.
[deliverable/binutils-gdb.git] / ld / ld-gld68k.c
CommitLineData
a7fe4c59
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 original gld running on a 68k system
25 *
26 * Written by Steve Chamberlain steve@cygnus.com
27 */
28
29
30#include "sysdep.h"
31#include "bfd.h"
32
33#include "ld.h"
34#include "config.h"
35#include "ld-emul.h"
36#include "ldfile.h"
37#include "ldmisc.h"
38
39extern boolean lang_float_flag;
40
41
42extern enum bfd_architecture ldfile_output_architecture;
43extern unsigned long ldfile_output_machine;
44extern char *ldfile_output_machine_name;
45
46extern bfd *output_bfd;
47
48
49
50static void gld68k_before_parse()
51{
52 ldfile_add_library_path("/lib");
53 ldfile_add_library_path("/usr/lib");
54 ldfile_add_library_path("/usr/local/lib/lib");
55 ldfile_output_architecture = bfd_arch_m68k;
56}
57
58
59static void
60gld68k_after_parse()
61{
62
63}
64
65static void
66gld68k_after_allocation()
67{
68
69}
70
71static void
72gld68k_before_allocation()
73{
74
75}
76
77
78static void
79gld68k_set_output_arch()
80{
81 /* Set the output architecture and machine if possible */
82 unsigned long machine = 0;
83 bfd_set_arch_mach(output_bfd, ldfile_output_architecture, machine);
84}
85
86static char *
87gld68k_choose_target()
88{
89 char *from_outside = getenv(TARGET_ENVIRON);
90 if (from_outside != (char *)NULL)
91 return from_outside;
92 return GLD68K_TARGET;
93}
94
95static void
96gld68k_syslib()
97{
98 info("%S SYSLIB ignored\n");
99}
100
101static void
102gld68k_hll(ignore)
103char *ignore;
104{
105 info("%S HLL ignored\n");
106}
107
1418c83b
SC
108static char *gld68k_script =
109#include "ld-gld68k.x"
110;
111
112static char *gld68k_script_option_Ur =
113#include "ld-gld68k-Ur.x"
114;
115static char *gld68k_script_option_r =
116#include "ld-gld68k-r.x"
117;
a7fe4c59
SC
118static char *gld68k_get_script()
119{
120 extern ld_config_type config;
121 if (config.relocateable_output == true &&
122 config.build_constructors == true) {
123 return gld68k_script_option_Ur;
124 }
125 if (config.relocateable_output) {
126 return gld68k_script_option_r;
127 }
128
129 return gld68k_script;
130}
131struct ld_emulation_xfer_struct ld_gld68k_emulation =
132{
133 gld68k_before_parse,
134 gld68k_syslib,
135 gld68k_hll,
136 gld68k_after_parse,
137 gld68k_after_allocation,
138 gld68k_set_output_arch,
139 gld68k_choose_target,
140 gld68k_before_allocation,
141 gld68k_get_script,
142};
143
This page took 0.054298 seconds and 4 git commands to generate.