checkpoint before a merge
[deliverable/binutils-gdb.git] / ld / ld-emul.c
1
2
3 /* Copyright (C) 1991 Free Software Foundation, Inc.
4
5 This file is part of GLD, the Gnu Linker.
6
7 GLD is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 1, or (at your option)
10 any later version.
11
12 GLD is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GLD; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 /*
22 $Id$
23 *
24 */
25 /*
26 * clearing house for ld emulation states
27 */
28
29 #include "sysdep.h"
30 #include "bfd.h"
31
32 #include "config.h"
33 #include "ld.h"
34 #include "ld-emul.h"
35 #include "ldmisc.h"
36
37 extern ld_emulation_xfer_type ld_lnk960_emulation;
38 extern ld_emulation_xfer_type ld_gld_emulation;
39 extern ld_emulation_xfer_type ld_vanilla_emulation;
40 extern ld_emulation_xfer_type ld_gld68k_emulation;
41 extern ld_emulation_xfer_type ld_gld960_emulation;
42
43
44
45 ld_emulation_xfer_type *ld_emulation;
46
47 void
48 ldemul_hll(name)
49 char *name;
50 {
51 ld_emulation->hll(name);
52 }
53
54
55 void ldemul_syslib(name)
56 char *name;
57 {
58 ld_emulation->syslib(name);
59 }
60
61 void
62 ldemul_after_parse()
63 {
64 ld_emulation->after_parse();
65 }
66
67 void
68 ldemul_before_parse()
69 {
70 ld_emulation->before_parse();
71 }
72
73 void
74 ldemul_after_allocation()
75 {
76 ld_emulation->after_allocation();
77 }
78
79 void
80 ldemul_before_allocation()
81 {
82 if (ld_emulation->before_allocation) {
83 ld_emulation->before_allocation();
84 }
85 }
86
87
88 void
89 ldemul_set_output_arch()
90 {
91 ld_emulation->set_output_arch();
92 }
93
94 char *
95 ldemul_choose_target()
96 {
97 return ld_emulation->choose_target();
98 }
99
100 char *
101 ldemul_get_script()
102 {
103 return ld_emulation->get_script();
104 }
105
106 void
107 ldemul_choose_mode(target)
108 char *target;
109 {
110 if (strcmp(target,LNK960_EMULATION_NAME)==0) {
111 ld_emulation = &ld_lnk960_emulation;
112 }
113 else if (strcmp(target,GLD_EMULATION_NAME)==0) {
114 ld_emulation = &ld_gld_emulation;
115 }
116 else if (strcmp(target,VANILLA_EMULATION_NAME)==0) {
117 ld_emulation = &ld_vanilla_emulation;
118 }
119 else if (strcmp(target,GLD68K_EMULATION_NAME)==0) {
120 ld_emulation = &ld_gld68k_emulation;
121 }
122 else if (strcmp(target,GLD960_EMULATION_NAME)==0) {
123 ld_emulation = &ld_gld960_emulation;
124 }
125 else {
126 info("%P%F unrecognised emulation mode: %s\n",target);
127 }
128 }
129
130
131
This page took 0.031699 seconds and 5 git commands to generate.