OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [bfd/] [doc/] [archures.texi] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
@section Architectures
2
BFD keeps one atom in a BFD describing the
3
architecture of the data attached to the BFD: a pointer to a
4
@code{bfd_arch_info_type}.
5
 
6
Pointers to structures can be requested independently of a BFD
7
so that an architecture's information can be interrogated
8
without access to an open BFD.
9
 
10
The architecture information is provided by each architecture package.
11
The set of default architectures is selected by the macro
12
@code{SELECT_ARCHITECTURES}.  This is normally set up in the
13
@file{config/@var{target}.mt} file of your choice.  If the name is not
14
defined, then all the architectures supported are included.
15
 
16
When BFD starts up, all the architectures are called with an
17
initialize method.  It is up to the architecture back end to
18
insert as many items into the list of architectures as it wants to;
19
generally this would be one for each machine and one for the
20
default case (an item with a machine field of 0).
21
 
22
BFD's idea of an architecture is implemented in @file{archures.c}.
23
 
24
@subsection bfd_architecture
25
 
26
 
27
@strong{Description}@*
28
This enum gives the object file's CPU architecture, in a
29
global sense---i.e., what processor family does it belong to?
30
Another field indicates which processor within
31
the family is in use.  The machine gives a number which
32
distinguishes different versions of the architecture,
33
containing, for example, 2 and 3 for Intel i960 KA and i960 KB,
34
and 68020 and 68030 for Motorola 68020 and 68030.
35
@example
36
enum bfd_architecture
37
@{
38
  bfd_arch_unknown,   /* File arch not known */
39
  bfd_arch_obscure,   /* Arch known, not one of these */
40
  bfd_arch_m68k,      /* Motorola 68xxx */
41
#define bfd_mach_m68000 1
42
#define bfd_mach_m68008 2
43
#define bfd_mach_m68010 3
44
#define bfd_mach_m68020 4
45
#define bfd_mach_m68030 5
46
#define bfd_mach_m68040 6
47
#define bfd_mach_m68060 7
48
#define bfd_mach_cpu32  8
49
#define bfd_mach_mcf5200  9
50
#define bfd_mach_mcf5206e 10
51
#define bfd_mach_mcf5307  11
52
#define bfd_mach_mcf5407  12
53
  bfd_arch_vax,       /* DEC Vax */
54
  bfd_arch_i960,      /* Intel 960 */
55
    /* The order of the following is important.
56
       lower number indicates a machine type that
57
       only accepts a subset of the instructions
58
       available to machines with higher numbers.
59
       The exception is the "ca", which is
60
       incompatible with all other machines except
61
       "core". */
62
 
63
#define bfd_mach_i960_core      1
64
#define bfd_mach_i960_ka_sa     2
65
#define bfd_mach_i960_kb_sb     3
66
#define bfd_mach_i960_mc        4
67
#define bfd_mach_i960_xa        5
68
#define bfd_mach_i960_ca        6
69
#define bfd_mach_i960_jx        7
70
#define bfd_mach_i960_hx        8
71
 
72
  bfd_arch_a29k,      /* AMD 29000 */
73
  bfd_arch_sparc,     /* SPARC */
74
#define bfd_mach_sparc                 1
75
/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
76
#define bfd_mach_sparc_sparclet        2
77
#define bfd_mach_sparc_sparclite       3
78
#define bfd_mach_sparc_v8plus          4
79
#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns */
80
#define bfd_mach_sparc_sparclite_le    6
81
#define bfd_mach_sparc_v9              7
82
#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns */
83
#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns */
84
#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns */
85
/* Nonzero if MACH has the v9 instruction set.  */
86
#define bfd_mach_sparc_v9_p(mach) \
87
  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
88
   && (mach) != bfd_mach_sparc_sparclite_le)
89
  bfd_arch_mips,      /* MIPS Rxxxx */
90
#define bfd_mach_mips3000              3000
91
#define bfd_mach_mips3900              3900
92
#define bfd_mach_mips4000              4000
93
#define bfd_mach_mips4010              4010
94
#define bfd_mach_mips4100              4100
95
#define bfd_mach_mips4111              4111
96
#define bfd_mach_mips4300              4300
97
#define bfd_mach_mips4400              4400
98
#define bfd_mach_mips4600              4600
99
#define bfd_mach_mips4650              4650
100
#define bfd_mach_mips5000              5000
101
#define bfd_mach_mips6000              6000
102
#define bfd_mach_mips8000              8000
103
#define bfd_mach_mips10000             10000
104
#define bfd_mach_mips12000             12000
105
#define bfd_mach_mips16                16
106
#define bfd_mach_mips32                32
107
#define bfd_mach_mips32_4k             3204113 /* 32, 04, octal 'K' */
108
#define bfd_mach_mips5                 5
109
#define bfd_mach_mips64                64
110
#define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
111
  bfd_arch_i386,      /* Intel 386 */
112
#define bfd_mach_i386_i386 0
113
#define bfd_mach_i386_i8086 1
114
#define bfd_mach_i386_i386_intel_syntax 2
115
#define bfd_mach_x86_64 3
116
#define bfd_mach_x86_64_intel_syntax 4
117
  bfd_arch_we32k,     /* AT&T WE32xxx */
118
  bfd_arch_tahoe,     /* CCI/Harris Tahoe */
119
  bfd_arch_i860,      /* Intel 860 */
120
  bfd_arch_i370,      /* IBM 360/370 Mainframes */
121
  bfd_arch_romp,      /* IBM ROMP PC/RT */
122
  bfd_arch_alliant,   /* Alliant */
123
  bfd_arch_convex,    /* Convex */
124
  bfd_arch_m88k,      /* Motorola 88xxx */
125
  bfd_arch_pyramid,   /* Pyramid Technology */
126
  bfd_arch_h8300,     /* Hitachi H8/300 */
127
#define bfd_mach_h8300   1
128
#define bfd_mach_h8300h  2
129
#define bfd_mach_h8300s  3
130
  bfd_arch_pdp11,     /* DEC PDP-11 */
131
  bfd_arch_powerpc,   /* PowerPC */
132
#define bfd_mach_ppc           0
133
#define bfd_mach_ppc_403       403
134
#define bfd_mach_ppc_403gc     4030
135
#define bfd_mach_ppc_505       505
136
#define bfd_mach_ppc_601       601
137
#define bfd_mach_ppc_602       602
138
#define bfd_mach_ppc_603       603
139
#define bfd_mach_ppc_ec603e    6031
140
#define bfd_mach_ppc_604       604
141
#define bfd_mach_ppc_620       620
142
#define bfd_mach_ppc_630       630
143
#define bfd_mach_ppc_750       750
144
#define bfd_mach_ppc_860       860
145
#define bfd_mach_ppc_a35       35
146
#define bfd_mach_ppc_rs64ii    642
147
#define bfd_mach_ppc_rs64iii   643
148
#define bfd_mach_ppc_7400      7400
149
  bfd_arch_rs6000,    /* IBM RS/6000 */
150
#define bfd_mach_rs6k          0
151
#define bfd_mach_rs6k_rs1      6001
152
#define bfd_mach_rs6k_rsc      6003
153
#define bfd_mach_rs6k_rs2      6002
154
  bfd_arch_hppa,      /* HP PA RISC */
155
  bfd_arch_d10v,      /* Mitsubishi D10V */
156
#define bfd_mach_d10v          0
157
#define bfd_mach_d10v_ts2      2
158
#define bfd_mach_d10v_ts3      3
159
  bfd_arch_d30v,      /* Mitsubishi D30V */
160
  bfd_arch_m68hc11,   /* Motorola 68HC11 */
161
  bfd_arch_m68hc12,   /* Motorola 68HC12 */
162
  bfd_arch_z8k,       /* Zilog Z8000 */
163
#define bfd_mach_z8001         1
164
#define bfd_mach_z8002         2
165
  bfd_arch_h8500,     /* Hitachi H8/500 */
166
  bfd_arch_sh,        /* Hitachi SH */
167
#define bfd_mach_sh            0
168
#define bfd_mach_sh2        0x20
169
#define bfd_mach_sh_dsp     0x2d
170
#define bfd_mach_sh3        0x30
171
#define bfd_mach_sh3_dsp    0x3d
172
#define bfd_mach_sh3e       0x3e
173
#define bfd_mach_sh4        0x40
174
  bfd_arch_alpha,     /* Dec Alpha */
175
#define bfd_mach_alpha_ev4  0x10
176
#define bfd_mach_alpha_ev5  0x20
177
#define bfd_mach_alpha_ev6  0x30
178
  bfd_arch_arm,       /* Advanced Risc Machines ARM */
179
#define bfd_mach_arm_2         1
180
#define bfd_mach_arm_2a        2
181
#define bfd_mach_arm_3         3
182
#define bfd_mach_arm_3M        4
183
#define bfd_mach_arm_4         5
184
#define bfd_mach_arm_4T        6
185
#define bfd_mach_arm_5         7
186
#define bfd_mach_arm_5T        8
187
#define bfd_mach_arm_5TE       9
188
#define bfd_mach_arm_XScale    10
189
  bfd_arch_ns32k,     /* National Semiconductors ns32000 */
190
  bfd_arch_w65,       /* WDC 65816 */
191
  bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
192
  bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
193
  bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
194
  bfd_arch_v850,      /* NEC V850 */
195
#define bfd_mach_v850          0
196
#define bfd_mach_v850e         'E'
197
#define bfd_mach_v850ea        'A'
198
  bfd_arch_arc,       /* ARC Cores */
199
#define bfd_mach_arc_5         0
200
#define bfd_mach_arc_6         1
201
#define bfd_mach_arc_7         2
202
#define bfd_mach_arc_8         3
203
  bfd_arch_m32r,      /* Mitsubishi M32R/D */
204
#define bfd_mach_m32r          0 /* backwards compatibility */
205
#define bfd_mach_m32rx         'x'
206
  bfd_arch_mn10200,   /* Matsushita MN10200 */
207
  bfd_arch_mn10300,   /* Matsushita MN10300 */
208
#define bfd_mach_mn10300               300
209
#define bfd_mach_am33          330
210
  bfd_arch_fr30,
211
#define bfd_mach_fr30          0x46523330
212
  bfd_arch_mcore,
213
  bfd_arch_ia64,      /* HP/Intel ia64 */
214
#define bfd_mach_ia64_elf64    0
215
#define bfd_mach_ia64_elf32    1
216
  bfd_arch_pj,
217
  bfd_arch_avr,       /* Atmel AVR microcontrollers */
218
#define bfd_mach_avr1          1
219
#define bfd_mach_avr2          2
220
#define bfd_mach_avr3          3
221
#define bfd_mach_avr4          4
222
#define bfd_mach_avr5          5
223
  bfd_arch_cris,      /* Axis CRIS */
224
  bfd_arch_s390,      /* IBM s390 */
225
#define bfd_mach_s390_esa      0
226
#define bfd_mach_s390_esame    1
227
  bfd_arch_openrisc,  /* OpenRISC */
228
  bfd_arch_last
229
  @};
230
@end example
231
 
232
@subsection bfd_arch_info
233
 
234
 
235
@strong{Description}@*
236
This structure contains information on architectures for use
237
within BFD.
238
@example
239
 
240
typedef struct bfd_arch_info
241
@{
242
  int bits_per_word;
243
  int bits_per_address;
244
  int bits_per_byte;
245
  enum bfd_architecture arch;
246
  unsigned long mach;
247
  const char *arch_name;
248
  const char *printable_name;
249
  unsigned int section_align_power;
250
  /* True if this is the default machine for the architecture.  */
251
  boolean the_default;
252
  const struct bfd_arch_info * (*compatible)
253
       PARAMS ((const struct bfd_arch_info *a,
254
                const struct bfd_arch_info *b));
255
 
256
  boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
257
 
258
  const struct bfd_arch_info *next;
259
@} bfd_arch_info_type;
260
@end example
261
 
262
@findex bfd_printable_name
263
@subsubsection @code{bfd_printable_name}
264
@strong{Synopsis}
265
@example
266
const char *bfd_printable_name(bfd *abfd);
267
@end example
268
@strong{Description}@*
269
Return a printable string representing the architecture and machine
270
from the pointer to the architecture info structure.
271
 
272
@findex bfd_scan_arch
273
@subsubsection @code{bfd_scan_arch}
274
@strong{Synopsis}
275
@example
276
const bfd_arch_info_type *bfd_scan_arch(const char *string);
277
@end example
278
@strong{Description}@*
279
Figure out if BFD supports any cpu which could be described with
280
the name @var{string}.  Return a pointer to an @code{arch_info}
281
structure if a machine is found, otherwise NULL.
282
 
283
@findex bfd_arch_list
284
@subsubsection @code{bfd_arch_list}
285
@strong{Synopsis}
286
@example
287
const char **bfd_arch_list(void);
288
@end example
289
@strong{Description}@*
290
Return a freshly malloced NULL-terminated vector of the names
291
of all the valid BFD architectures.  Do not modify the names.
292
 
293
@findex bfd_arch_get_compatible
294
@subsubsection @code{bfd_arch_get_compatible}
295
@strong{Synopsis}
296
@example
297
const bfd_arch_info_type *bfd_arch_get_compatible(
298
    const bfd *abfd,
299
    const bfd *bbfd);
300
@end example
301
@strong{Description}@*
302
Determine whether two BFDs'
303
architectures and machine types are compatible.  Calculates
304
the lowest common denominator between the two architectures
305
and machine types implied by the BFDs and returns a pointer to
306
an @code{arch_info} structure describing the compatible machine.
307
 
308
@findex bfd_default_arch_struct
309
@subsubsection @code{bfd_default_arch_struct}
310
@strong{Description}@*
311
The @code{bfd_default_arch_struct} is an item of
312
@code{bfd_arch_info_type} which has been initialized to a fairly
313
generic state.  A BFD starts life by pointing to this
314
structure, until the correct back end has determined the real
315
architecture of the file.
316
@example
317
extern const bfd_arch_info_type bfd_default_arch_struct;
318
@end example
319
 
320
@findex bfd_set_arch_info
321
@subsubsection @code{bfd_set_arch_info}
322
@strong{Synopsis}
323
@example
324
void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg);
325
@end example
326
@strong{Description}@*
327
Set the architecture info of @var{abfd} to @var{arg}.
328
 
329
@findex bfd_default_set_arch_mach
330
@subsubsection @code{bfd_default_set_arch_mach}
331
@strong{Synopsis}
332
@example
333
boolean bfd_default_set_arch_mach(bfd *abfd,
334
    enum bfd_architecture arch,
335
    unsigned long mach);
336
@end example
337
@strong{Description}@*
338
Set the architecture and machine type in BFD @var{abfd}
339
to @var{arch} and @var{mach}.  Find the correct
340
pointer to a structure and insert it into the @code{arch_info}
341
pointer.
342
 
343
@findex bfd_get_arch
344
@subsubsection @code{bfd_get_arch}
345
@strong{Synopsis}
346
@example
347
enum bfd_architecture bfd_get_arch(bfd *abfd);
348
@end example
349
@strong{Description}@*
350
Return the enumerated type which describes the BFD @var{abfd}'s
351
architecture.
352
 
353
@findex bfd_get_mach
354
@subsubsection @code{bfd_get_mach}
355
@strong{Synopsis}
356
@example
357
unsigned long bfd_get_mach(bfd *abfd);
358
@end example
359
@strong{Description}@*
360
Return the long type which describes the BFD @var{abfd}'s
361
machine.
362
 
363
@findex bfd_arch_bits_per_byte
364
@subsubsection @code{bfd_arch_bits_per_byte}
365
@strong{Synopsis}
366
@example
367
unsigned int bfd_arch_bits_per_byte(bfd *abfd);
368
@end example
369
@strong{Description}@*
370
Return the number of bits in one of the BFD @var{abfd}'s
371
architecture's bytes.
372
 
373
@findex bfd_arch_bits_per_address
374
@subsubsection @code{bfd_arch_bits_per_address}
375
@strong{Synopsis}
376
@example
377
unsigned int bfd_arch_bits_per_address(bfd *abfd);
378
@end example
379
@strong{Description}@*
380
Return the number of bits in one of the BFD @var{abfd}'s
381
architecture's addresses.
382
 
383
@findex bfd_default_compatible
384
@subsubsection @code{bfd_default_compatible}
385
@strong{Synopsis}
386
@example
387
const bfd_arch_info_type *bfd_default_compatible
388
   (const bfd_arch_info_type *a,
389
    const bfd_arch_info_type *b);
390
@end example
391
@strong{Description}@*
392
The default function for testing for compatibility.
393
 
394
@findex bfd_default_scan
395
@subsubsection @code{bfd_default_scan}
396
@strong{Synopsis}
397
@example
398
boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);
399
@end example
400
@strong{Description}@*
401
The default function for working out whether this is an
402
architecture hit and a machine hit.
403
 
404
@findex bfd_get_arch_info
405
@subsubsection @code{bfd_get_arch_info}
406
@strong{Synopsis}
407
@example
408
const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd);
409
@end example
410
@strong{Description}@*
411
Return the architecture info struct in @var{abfd}.
412
 
413
@findex bfd_lookup_arch
414
@subsubsection @code{bfd_lookup_arch}
415
@strong{Synopsis}
416
@example
417
const bfd_arch_info_type *bfd_lookup_arch
418
   (enum bfd_architecture
419
    arch,
420
    unsigned long machine);
421
@end example
422
@strong{Description}@*
423
Look for the architecure info structure which matches the
424
arguments @var{arch} and @var{machine}. A machine of 0 matches the
425
machine/architecture structure which marks itself as the
426
default.
427
 
428
@findex bfd_printable_arch_mach
429
@subsubsection @code{bfd_printable_arch_mach}
430
@strong{Synopsis}
431
@example
432
const char *bfd_printable_arch_mach
433
   (enum bfd_architecture arch, unsigned long machine);
434
@end example
435
@strong{Description}@*
436
Return a printable string representing the architecture and
437
machine type.
438
 
439
This routine is depreciated.
440
 
441
@findex bfd_octets_per_byte
442
@subsubsection @code{bfd_octets_per_byte}
443
@strong{Synopsis}
444
@example
445
unsigned int bfd_octets_per_byte(bfd *abfd);
446
@end example
447
@strong{Description}@*
448
Return the number of octets (8-bit quantities) per target byte
449
(minimum addressable unit).  In most cases, this will be one, but some
450
DSP targets have 16, 32, or even 48 bits per byte.
451
 
452
@findex bfd_arch_mach_octets_per_byte
453
@subsubsection @code{bfd_arch_mach_octets_per_byte}
454
@strong{Synopsis}
455
@example
456
unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,
457
    unsigned long machine);
458
@end example
459
@strong{Description}@*
460
See bfd_octets_per_byte.
461
 
462
This routine is provided for those cases where a bfd * is not
463
available
464
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.