More cleanups for gprof, especially with the '386 target.
[deliverable/binutils-gdb.git] / ld / h8300hms.c
CommitLineData
ab6c26ba
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 Written by Steve Chamberlain steve@cygnus.com
21
22 The controller which tells the gnu linker how to behave like one for
23 the Hitach H8/300 with IEEE records.
24*/
25
26#include "bfd.h"
27#include "sysdep.h"
28
29#include "ld.h"
30#include "config.h"
31#include "ldemul.h"
32#include "ldfile.h"
33#include "ldmisc.h"
34
35extern boolean lang_float_flag;
36
37
38extern enum bfd_architecture ldfile_output_architecture;
39extern unsigned long ldfile_output_machine;
40extern char *ldfile_output_machine_name;
41
42extern bfd *output_bfd;
43
44
45
46static void h8300hms_before_parse()
47{
48 ldfile_output_architecture = bfd_arch_h8300;
49}
50
51
52static void
53h8300hms_after_parse()
54{
55
56}
57
58static void
59h8300hms_after_allocation()
60{
61
62}
63
64static void
65h8300hms_before_allocation()
66{
67
68}
69
70
71static void
72h8300hms_set_output_arch()
73{
74 /* Set the output architecture and machine if possible */
75 bfd_set_arch_mach(output_bfd,
76 ldfile_output_architecture, ldfile_output_machine);
77}
78
79static char *
80h8300hms_choose_target()
81{
82 char *from_outside = getenv(TARGET_ENVIRON);
83 if (from_outside != (char *)NULL)
84 return from_outside;
85 return H8300HMS_TARGET;
86}
87
88static void
89h8300hms_syslib()
90{
91 info("%S SYSLIB ignored\n");
92}
93
94static void
95h8300hms_hll(ignore)
96char *ignore;
97{
98 info("%S HLL ignored\n");
99}
100
101static char *h8300hms_script =
102#include "h8300hms.x"
103;
104static char *h8300hms_script_option_Ur =
105#include "h8300hms.x"
106;
107static char *h8300hms_script_option_r =
108#include "h8300hms.x"
109;
110
111static char *h8300hms_get_script()
112{
113 extern ld_config_type config;
114 if (config.relocateable_output == true &&
115 config.build_constructors == true) {
116 return h8300hms_script_option_Ur;
117 }
118 if (config.relocateable_output) {
119 return h8300hms_script_option_r;
120 }
121
122 return h8300hms_script;
123}
124struct ld_emulation_xfer_struct ld_h8300hms_emulation =
125{
126 h8300hms_before_parse,
127 h8300hms_syslib,
128 h8300hms_hll,
129 h8300hms_after_parse,
130 h8300hms_after_allocation,
131 h8300hms_set_output_arch,
132 h8300hms_choose_target,
133 h8300hms_before_allocation,
134 h8300hms_get_script,
135};
This page took 0.028853 seconds and 4 git commands to generate.