Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/**********************************************************************
32
$Author: release $
33
$Date: 1998/03/17 16:54:15 $
34
$Revision: 1.4 $
35
$Log: dw2_config.c,v $
36
 * Revision 1.4  1998/03/17  16:54:15  release
37
 * Couple of minor fixes.
38
 *
39
 * Revision 1.3  1998/03/11  11:03:13  pwe
40
 * DWARF optimisation info
41
 *
42
 * Revision 1.2  1998/01/21  10:30:02  pwe
43
 * labdiff change
44
 *
45
 * Revision 1.1.1.1  1998/01/17  15:55:52  release
46
 * First version to be checked into rolling release.
47
 *
48
 * Revision 1.6  1998/01/09  14:47:55  pwe
49
 * prep restructure
50
 *
51
 * Revision 1.5  1997/12/04  20:01:30  pwe
52
 * ANDF-DE V1.9
53
 *
54
 * Revision 1.4  1997/10/23  09:37:29  pwe
55
 * extra_diags
56
 *
57
 * Revision 1.3  1997/10/10  18:26:02  pwe
58
 * prep ANDF-DE revision
59
 *
60
 * Revision 1.2  1997/03/24  11:15:46  pwe
61
 * dwarf2 option/default
62
 *
63
 * Revision 1.1  1997/03/20  16:24:39  pwe
64
 * dwarf2
65
 *
66
**********************************************************************/
67
 
68
#include "dw2_config.h"
69
#include "flags.h"
70
#include "machine.h"
71
#include "basicread.h"
72
#include "target_v.h"
73
 
74
long dwarf_lab_num = 0;
75
 
76
void out_string
77
    PROTO_N ( (s) )
78
    PROTO_T ( char * s )
79
{
80
  outs (".string \"");
81
  outs (s);
82
  outs ("\"");
83
  d_outnl ();
84
  return;
85
}
86
 
87
void start_string
88
    PROTO_N ( (s) )
89
    PROTO_T ( char * s )
90
{
91
  outs (".string \"");
92
  outs (s);
93
  return;
94
}
95
 
96
void end_string
97
    PROTO_Z ()
98
{
99
  outs ("\"");
100
  d_outnl ();
101
  return;
102
}
103
 
104
void enter_section
105
    PROTO_N ( (s) )
106
    PROTO_T ( char * s )
107
{
108
  outs (".section .");
109
  outs (s);
110
  d_outnl ();
111
  return;
112
}
113
 
114
void exit_section
115
    PROTO_Z ()
116
{
117
  outs (".previous");
118
  d_outnl ();
119
  return;
120
}
121
 
122
void outnl_comment
123
    PROTO_N ( (s) )
124
    PROTO_T ( char * s )
125
{
126
  outs ("\t/");
127
  outs (s);
128
  d_outnl ();
129
  return;
130
}
131
 
132
void outnl_comment_i
133
    PROTO_N ( (s, i) )
134
    PROTO_T ( char * s X long i )
135
{
136
  outs ("\t/");
137
  outs (s);
138
  outs (" ");
139
  outn (i);
140
  d_outnl ();
141
  return;
142
}
143
 
144
void out_dwf_label
145
    PROTO_N ( (l, set) )
146
    PROTO_T ( long l X int set )
147
{
148
  if (!l)
149
    failer ("unknown label");
150
  outs (".Ldw");
151
  outn (l);
152
  if (set) {
153
    outs (":");
154
    d_outnl ();
155
  }
156
  return;
157
}
158
 
159
void out_code_label
160
    PROTO_N ( (l) )
161
    PROTO_T ( long l )
162
{
163
  outs (local_prefix);
164
  outn (l);
165
  return;
166
}
167
 
168
void out_dwf_dist_to_label
169
    PROTO_N ( (l) )
170
    PROTO_T ( long l )
171
{
172
  out_dwf_label (l, 0);
173
  outs (" - . - 4");
174
  return;
175
}
176
 
177
void out_dwf_labdiff
178
    PROTO_N ( (lo, hi) )
179
    PROTO_T ( long lo X long hi )
180
{
181
  if (hi == lo)
182
    outn ((long)0);
183
  else {
184
    out_dwf_label (hi, 0);
185
    outs (" - ");
186
    out_dwf_label (lo, 0);
187
  }
188
  return;
189
}
190
 
191
void out_ext_label
192
    PROTO_N ( (s) )
193
    PROTO_T ( char * s )
194
{
195
  outs (".globl ");
196
  outs (s);
197
  d_outnl ();
198
  outs (s);
199
  outs(":");
200
  d_outnl ();
201
  return;
202
}
203
 
204
void out_producer
205
    PROTO_N ( (s) )
206
    PROTO_T ( char * s )
207
{
208
  outs (".string \"");
209
  outs (s);
210
  outs ("   with TenDRA 80x86/Solaris installer ");
211
  outn ((long)target_version) ;
212
  outs (".") ;
213
  outn ((long)target_revision) ;
214
  outs ("\"");
215
  d_outnl ();
216
  return;
217
}
218
 
219
 
220
static char * first_data = NULL;
221
static char * first_ro = NULL;
222
 
223
void note_data
224
    PROTO_N ( (s) )
225
    PROTO_T ( char * s )
226
{
227
  if (!first_data)
228
    first_data = s;
229
  return;
230
}
231
 
232
void note_ro
233
    PROTO_N ( (s) )
234
    PROTO_T ( char * s )
235
{
236
  if (!first_ro)
237
    first_ro = s;
238
  return;
239
}
240
 
241
void dw2_data_aranges
242
    PROTO_Z ()
243
{
244
  long lab_data = 0, lab_ro = 0;
245
  if (first_data) {
246
    lab_data = next_dwarf_label ();
247
    if (do_prom) {
248
      outs (".bss ");
249
      out_dwf_label (lab_data, 0);
250
      outs (", 0");
251
      d_outnl();
252
    }
253
    else {
254
      outs(".data");
255
      d_outnl();
256
      out_dwf_label (lab_data, 1);
257
    }
258
  }
259
  if (first_ro) {
260
    lab_ro = next_dwarf_label ();
261
    out_readonly_section();
262
    d_outnl();
263
    out_dwf_label (lab_ro, 1);
264
  }
265
  outs(".text");
266
  d_outnl();
267
  enter_section ("debug_aranges");
268
  if (first_data) {
269
    out32 (); outs (first_data); d_outnl ();
270
    out32 (); out_dwf_label (lab_data, 0); outs (" - ");
271
	outs (first_data); d_outnl ();
272
  }
273
  if (first_ro) {
274
    out32 (); outs (first_ro); d_outnl ();
275
    out32 (); out_dwf_label (lab_ro, 0); outs (" - ");
276
	outs (first_ro); d_outnl ();
277
  }
278
  exit_section ();
279
  return;
280
}