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