* ldmain.c (main): Make config.magic_demand_paged be true
[deliverable/binutils-gdb.git] / ld / ldtemplate
1 /* NOTE: If there are angle brackets here: <TARGET> then this is a
2 * template file (ldtemplate), intended for processing by sed.
3 * Otherwise, this file has already been processed by sed,
4 * and customized for a particular emulation target.
5 * In that DO NOT EDIT the file; edit ldtemplate instead.
6 */
7
8 /* Copyright (C) 1991 Free Software Foundation, Inc.
9
10 This file is part of GLD, the Gnu Linker.
11
12 GLD is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 1, or (at your option)
15 any later version.
16
17 GLD is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with GLD; see the file COPYING. If not, write to
24 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
25
26 /*
27 * $Id:#
28 */
29
30 /*
31 * emulate the original gld for the given <TARGET>
32 *
33 * Written by Steve Chamberlain steve@cygnus.com
34 */
35
36 #define TARGET_IS_<TARGET>
37
38
39 #include "bfd.h"
40 #include "sysdep.h"
41 #include "ld.h"
42 #include "config.h"
43 #include "ldemul.h"
44 #include "ldfile.h"
45 #include "ldmisc.h"
46
47 extern boolean lang_float_flag;
48
49
50 extern enum bfd_architecture ldfile_output_architecture;
51 extern unsigned long ldfile_output_machine;
52 extern char *ldfile_output_machine_name;
53
54 extern bfd *output_bfd;
55
56
57
58 static void gld<target>_before_parse()
59 {
60 #ifdef TARGET_IS_M88KBCS
61 extern char lprefix;
62 lprefix = '@';
63 #else
64 #ifndef TARGET_ /* I.e., if not generic */
65 ldfile_output_architecture = bfd_arch_<arch>;
66 #endif
67 #endif
68 }
69
70
71 static void
72 gld<target>_after_parse()
73 {
74
75 }
76
77 static void
78 gld<target>_after_allocation()
79 {
80
81 }
82
83 static void
84 gld<target>_before_allocation()
85 {
86
87 }
88
89
90 static void
91 gld<target>_set_output_arch()
92 {
93 /* Set the output architecture and machine if possible */
94 bfd_set_arch_mach(output_bfd,
95 ldfile_output_architecture, ldfile_output_machine);
96 }
97
98 static char *
99 gld<target>_choose_target()
100 {
101 char *from_outside = getenv(TARGET_ENVIRON);
102 if (from_outside != (char *)NULL)
103 return from_outside;
104 return GLD<TARGET>_TARGET;
105 }
106
107 static void
108 gld<target>_syslib()
109 {
110 info("%S SYSLIB ignored\n");
111 }
112
113 static void
114 gld<target>_hll(ignore)
115 char *ignore;
116 {
117 info("%S HLL ignored\n");
118 }
119
120 static char *gld<target>_script =
121 #include "<ldtarget>.x"
122 ;
123 static char *gld<target>_script_option_Ur =
124 #include "<ldtarget>.xu"
125 ;
126 static char *gld<target>_script_option_r =
127 #include "<ldtarget>.xr"
128 ;
129
130 static char *gld<target>_get_script()
131 {
132 extern ld_config_type config;
133 if (config.relocateable_output == true &&
134 config.build_constructors == true) {
135 return gld<target>_script_option_Ur;
136 }
137 if (config.relocateable_output == true) {
138 return gld<target>_script_option_r;
139 }
140
141 return gld<target>_script;
142 }
143 struct ld_emulation_xfer_struct ld_gld<target>_emulation =
144 {
145 gld<target>_before_parse,
146 gld<target>_syslib,
147 gld<target>_hll,
148 gld<target>_after_parse,
149 gld<target>_after_allocation,
150 gld<target>_set_output_arch,
151 gld<target>_choose_target,
152 gld<target>_before_allocation,
153 gld<target>_get_script,
154 };
This page took 0.033135 seconds and 5 git commands to generate.