Cut 2. Subdirs.
[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_gld68k_emulation;
40 extern ld_emulation_xfer_type ld_gld960_emulation;
41
42
43
44 ld_emulation_xfer_type *ld_emulation;
45
46 void
47 ldemul_hll(name)
48 char *name;
49 {
50 ld_emulation->hll(name);
51 }
52
53
54 void ldemul_syslib(name)
55 char *name;
56 {
57 ld_emulation->syslib(name);
58 }
59
60 void
61 ldemul_after_parse()
62 {
63 ld_emulation->after_parse();
64 }
65
66 void
67 ldemul_before_parse()
68 {
69 ld_emulation->before_parse();
70 }
71
72 void
73 ldemul_after_allocation()
74 {
75 ld_emulation->after_allocation();
76 }
77
78 void
79 ldemul_before_allocation()
80 {
81 if (ld_emulation->before_allocation) {
82 ld_emulation->before_allocation();
83 }
84 }
85
86
87 void
88 ldemul_set_output_arch()
89 {
90 ld_emulation->set_output_arch();
91 }
92
93 char *
94 ldemul_choose_target()
95 {
96 return ld_emulation->choose_target();
97 }
98
99 char *
100 ldemul_get_script()
101 {
102 return ld_emulation->get_script();
103 }
104
105 void
106 ldemul_choose_mode(target)
107 char *target;
108 {
109 if (strcmp(target,LNK960_EMULATION_NAME)==0) {
110 ld_emulation = &ld_lnk960_emulation;
111 }
112 else if (strcmp(target,GLD_EMULATION_NAME)==0) {
113 ld_emulation = &ld_gld_emulation;
114 }
115 else if (strcmp(target,GLD68K_EMULATION_NAME)==0) {
116 ld_emulation = &ld_gld68k_emulation;
117 }
118 else if (strcmp(target,GLD960_EMULATION_NAME)==0) {
119 ld_emulation = &ld_gld960_emulation;
120 }
121 else {
122 info("%P%F unrecognised emulation mode: %s\n",target);
123 }
124 }
125
126
127
This page took 0.031207 seconds and 4 git commands to generate.