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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [bfd/] [doc/] [bfdt.texi] - Blame information for rev 394

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
@section @code{typedef bfd}
2
A BFD has type @code{bfd}; objects of this type are the
3
cornerstone of any application using BFD. Using BFD
4
consists of making references though the BFD and to data in the BFD.
5
 
6
Here is the structure that defines the type @code{bfd}.  It
7
contains the major data about the file and pointers
8
to the rest of the data.
9
 
10
 
11
@example
12
 
13
enum bfd_direction
14
  @{
15
    no_direction = 0,
16
    read_direction = 1,
17
    write_direction = 2,
18
    both_direction = 3
19
  @};
20
 
21
struct bfd
22
@{
23
  /* A unique identifier of the BFD  */
24
  unsigned int id;
25
 
26
  /* The filename the application opened the BFD with.  */
27
  const char *filename;
28
 
29
  /* A pointer to the target jump table.  */
30
  const struct bfd_target *xvec;
31
 
32
  /* The IOSTREAM, and corresponding IO vector that provide access
33
     to the file backing the BFD.  */
34
  void *iostream;
35
  const struct bfd_iovec *iovec;
36
 
37
  /* The caching routines use these to maintain a
38
     least-recently-used list of BFDs.  */
39
  struct bfd *lru_prev, *lru_next;
40
 
41
  /* When a file is closed by the caching routines, BFD retains
42
     state information on the file here...  */
43
  ufile_ptr where;
44
 
45
  /* File modified time, if mtime_set is TRUE.  */
46
  long mtime;
47
 
48
  /* Reserved for an unimplemented file locking extension.  */
49
  int ifd;
50
 
51
  /* The format which belongs to the BFD. (object, core, etc.)  */
52
  bfd_format format;
53
 
54
  /* The direction with which the BFD was opened.  */
55
  enum bfd_direction direction;
56
 
57
  /* Format_specific flags.  */
58
  flagword flags;
59
 
60
  /* Values that may appear in the flags field of a BFD.  These also
61
     appear in the object_flags field of the bfd_target structure, where
62
     they indicate the set of flags used by that backend (not all flags
63
     are meaningful for all object file formats) (FIXME: at the moment,
64
     the object_flags values have mostly just been copied from backend
65
     to another, and are not necessarily correct).  */
66
 
67
#define BFD_NO_FLAGS   0x00
68
 
69
  /* BFD contains relocation entries.  */
70
#define HAS_RELOC      0x01
71
 
72
  /* BFD is directly executable.  */
73
#define EXEC_P         0x02
74
 
75
  /* BFD has line number information (basically used for F_LNNO in a
76
     COFF header).  */
77
#define HAS_LINENO     0x04
78
 
79
  /* BFD has debugging information.  */
80
#define HAS_DEBUG      0x08
81
 
82
  /* BFD has symbols.  */
83
#define HAS_SYMS       0x10
84
 
85
  /* BFD has local symbols (basically used for F_LSYMS in a COFF
86
     header).  */
87
#define HAS_LOCALS     0x20
88
 
89
  /* BFD is a dynamic object.  */
90
#define DYNAMIC        0x40
91
 
92
  /* Text section is write protected (if D_PAGED is not set, this is
93
     like an a.out NMAGIC file) (the linker sets this by default, but
94
     clears it for -r or -N).  */
95
#define WP_TEXT        0x80
96
 
97
  /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
98
     linker sets this by default, but clears it for -r or -n or -N).  */
99
#define D_PAGED        0x100
100
 
101
  /* BFD is relaxable (this means that bfd_relax_section may be able to
102
     do something) (sometimes bfd_relax_section can do something even if
103
     this is not set).  */
104
#define BFD_IS_RELAXABLE 0x200
105
 
106
  /* This may be set before writing out a BFD to request using a
107
     traditional format.  For example, this is used to request that when
108
     writing out an a.out object the symbols not be hashed to eliminate
109
     duplicates.  */
110
#define BFD_TRADITIONAL_FORMAT 0x400
111
 
112
  /* This flag indicates that the BFD contents are actually cached
113
     in memory.  If this is set, iostream points to a bfd_in_memory
114
     struct.  */
115
#define BFD_IN_MEMORY 0x800
116
 
117
  /* The sections in this BFD specify a memory page.  */
118
#define HAS_LOAD_PAGE 0x1000
119
 
120
  /* This BFD has been created by the linker and doesn't correspond
121
     to any input file.  */
122
#define BFD_LINKER_CREATED 0x2000
123
 
124
  /* This may be set before writing out a BFD to request that it
125
     be written using values for UIDs, GIDs, timestamps, etc. that
126
     will be consistent from run to run.  */
127
#define BFD_DETERMINISTIC_OUTPUT 0x4000
128
 
129
  /* Currently my_archive is tested before adding origin to
130
     anything. I believe that this can become always an add of
131
     origin, with origin set to 0 for non archive files.  */
132
  ufile_ptr origin;
133
 
134
  /* The origin in the archive of the proxy entry.  This will
135
     normally be the same as origin, except for thin archives,
136
     when it will contain the current offset of the proxy in the
137
     thin archive rather than the offset of the bfd in its actual
138
     container.  */
139
  ufile_ptr proxy_origin;
140
 
141
  /* A hash table for section names.  */
142
  struct bfd_hash_table section_htab;
143
 
144
  /* Pointer to linked list of sections.  */
145
  struct bfd_section *sections;
146
 
147
  /* The last section on the section list.  */
148
  struct bfd_section *section_last;
149
 
150
  /* The number of sections.  */
151
  unsigned int section_count;
152
 
153
  /* Stuff only useful for object files:
154
     The start address.  */
155
  bfd_vma start_address;
156
 
157
  /* Used for input and output.  */
158
  unsigned int symcount;
159
 
160
  /* Symbol table for output BFD (with symcount entries).
161
     Also used by the linker to cache input BFD symbols.  */
162
  struct bfd_symbol  **outsymbols;
163
 
164
  /* Used for slurped dynamic symbol tables.  */
165
  unsigned int dynsymcount;
166
 
167
  /* Pointer to structure which contains architecture information.  */
168
  const struct bfd_arch_info *arch_info;
169
 
170
  /* Stuff only useful for archives.  */
171
  void *arelt_data;
172
  struct bfd *my_archive;      /* The containing archive BFD.  */
173
  struct bfd *archive_next;    /* The next BFD in the archive.  */
174
  struct bfd *archive_head;    /* The first BFD in the archive.  */
175
  struct bfd *nested_archives; /* List of nested archive in a flattened
176
                                  thin archive.  */
177
 
178
  /* A chain of BFD structures involved in a link.  */
179
  struct bfd *link_next;
180
 
181
  /* A field used by _bfd_generic_link_add_archive_symbols.  This will
182
     be used only for archive elements.  */
183
  int archive_pass;
184
 
185
  /* Used by the back end to hold private data.  */
186
  union
187
    @{
188
      struct aout_data_struct *aout_data;
189
      struct artdata *aout_ar_data;
190
      struct _oasys_data *oasys_obj_data;
191
      struct _oasys_ar_data *oasys_ar_data;
192
      struct coff_tdata *coff_obj_data;
193
      struct pe_tdata *pe_obj_data;
194
      struct xcoff_tdata *xcoff_obj_data;
195
      struct ecoff_tdata *ecoff_obj_data;
196
      struct ieee_data_struct *ieee_data;
197
      struct ieee_ar_data_struct *ieee_ar_data;
198
      struct srec_data_struct *srec_data;
199
      struct verilog_data_struct *verilog_data;
200
      struct ihex_data_struct *ihex_data;
201
      struct tekhex_data_struct *tekhex_data;
202
      struct elf_obj_tdata *elf_obj_data;
203
      struct nlm_obj_tdata *nlm_obj_data;
204
      struct bout_data_struct *bout_data;
205
      struct mmo_data_struct *mmo_data;
206
      struct sun_core_struct *sun_core_data;
207
      struct sco5_core_struct *sco5_core_data;
208
      struct trad_core_struct *trad_core_data;
209
      struct som_data_struct *som_data;
210
      struct hpux_core_struct *hpux_core_data;
211
      struct hppabsd_core_struct *hppabsd_core_data;
212
      struct sgi_core_struct *sgi_core_data;
213
      struct lynx_core_struct *lynx_core_data;
214
      struct osf_core_struct *osf_core_data;
215
      struct cisco_core_struct *cisco_core_data;
216
      struct versados_data_struct *versados_data;
217
      struct netbsd_core_struct *netbsd_core_data;
218
      struct mach_o_data_struct *mach_o_data;
219
      struct mach_o_fat_data_struct *mach_o_fat_data;
220
      struct plugin_data_struct *plugin_data;
221
      struct bfd_pef_data_struct *pef_data;
222
      struct bfd_pef_xlib_data_struct *pef_xlib_data;
223
      struct bfd_sym_data_struct *sym_data;
224
      void *any;
225
    @}
226
  tdata;
227
 
228
  /* Used by the application to hold private data.  */
229
  void *usrdata;
230
 
231
  /* Where all the allocated stuff under this BFD goes.  This is a
232
     struct objalloc *, but we use void * to avoid requiring the inclusion
233
     of objalloc.h.  */
234
  void *memory;
235
 
236
  /* Is the file descriptor being cached?  That is, can it be closed as
237
     needed, and re-opened when accessed later?  */
238
  unsigned int cacheable : 1;
239
 
240
  /* Marks whether there was a default target specified when the
241
     BFD was opened. This is used to select which matching algorithm
242
     to use to choose the back end.  */
243
  unsigned int target_defaulted : 1;
244
 
245
  /* ... and here: (``once'' means at least once).  */
246
  unsigned int opened_once : 1;
247
 
248
  /* Set if we have a locally maintained mtime value, rather than
249
     getting it from the file each time.  */
250
  unsigned int mtime_set : 1;
251
 
252
  /* Flag set if symbols from this BFD should not be exported.  */
253
  unsigned int no_export : 1;
254
 
255
  /* Remember when output has begun, to stop strange things
256
     from happening.  */
257
  unsigned int output_has_begun : 1;
258
 
259
  /* Have archive map.  */
260
  unsigned int has_armap : 1;
261
 
262
  /* Set if this is a thin archive.  */
263
  unsigned int is_thin_archive : 1;
264
 
265
  /* Set if only required symbols should be added in the link hash table for
266
     this object.  Used by VMS linkers.  */
267
  unsigned int selective_search : 1;
268
@};
269
 
270
@end example
271
@section Error reporting
272
Most BFD functions return nonzero on success (check their
273
individual documentation for precise semantics).  On an error,
274
they call @code{bfd_set_error} to set an error condition that callers
275
can check by calling @code{bfd_get_error}.
276
If that returns @code{bfd_error_system_call}, then check
277
@code{errno}.
278
 
279
The easiest way to report a BFD error to the user is to
280
use @code{bfd_perror}.
281
 
282
@subsection Type @code{bfd_error_type}
283
The values returned by @code{bfd_get_error} are defined by the
284
enumerated type @code{bfd_error_type}.
285
 
286
 
287
@example
288
 
289
typedef enum bfd_error
290
@{
291
  bfd_error_no_error = 0,
292
  bfd_error_system_call,
293
  bfd_error_invalid_target,
294
  bfd_error_wrong_format,
295
  bfd_error_wrong_object_format,
296
  bfd_error_invalid_operation,
297
  bfd_error_no_memory,
298
  bfd_error_no_symbols,
299
  bfd_error_no_armap,
300
  bfd_error_no_more_archived_files,
301
  bfd_error_malformed_archive,
302
  bfd_error_file_not_recognized,
303
  bfd_error_file_ambiguously_recognized,
304
  bfd_error_no_contents,
305
  bfd_error_nonrepresentable_section,
306
  bfd_error_no_debug_section,
307
  bfd_error_bad_value,
308
  bfd_error_file_truncated,
309
  bfd_error_file_too_big,
310
  bfd_error_on_input,
311
  bfd_error_invalid_error_code
312
@}
313
bfd_error_type;
314
 
315
@end example
316
@findex bfd_get_error
317
@subsubsection @code{bfd_get_error}
318
@strong{Synopsis}
319
@example
320
bfd_error_type bfd_get_error (void);
321
@end example
322
@strong{Description}@*
323
Return the current BFD error condition.
324
 
325
@findex bfd_set_error
326
@subsubsection @code{bfd_set_error}
327
@strong{Synopsis}
328
@example
329
void bfd_set_error (bfd_error_type error_tag, ...);
330
@end example
331
@strong{Description}@*
332
Set the BFD error condition to be @var{error_tag}.
333
If @var{error_tag} is bfd_error_on_input, then this function
334
takes two more parameters, the input bfd where the error
335
occurred, and the bfd_error_type error.
336
 
337
@findex bfd_errmsg
338
@subsubsection @code{bfd_errmsg}
339
@strong{Synopsis}
340
@example
341
const char *bfd_errmsg (bfd_error_type error_tag);
342
@end example
343
@strong{Description}@*
344
Return a string describing the error @var{error_tag}, or
345
the system error if @var{error_tag} is @code{bfd_error_system_call}.
346
 
347
@findex bfd_perror
348
@subsubsection @code{bfd_perror}
349
@strong{Synopsis}
350
@example
351
void bfd_perror (const char *message);
352
@end example
353
@strong{Description}@*
354
Print to the standard error stream a string describing the
355
last BFD error that occurred, or the last system error if
356
the last BFD error was a system call failure.  If @var{message}
357
is non-NULL and non-empty, the error string printed is preceded
358
by @var{message}, a colon, and a space.  It is followed by a newline.
359
 
360
@subsection BFD error handler
361
Some BFD functions want to print messages describing the
362
problem.  They call a BFD error handler function.  This
363
function may be overridden by the program.
364
 
365
The BFD error handler acts like printf.
366
 
367
 
368
@example
369
 
370
typedef void (*bfd_error_handler_type) (const char *, ...);
371
 
372
@end example
373
@findex bfd_set_error_handler
374
@subsubsection @code{bfd_set_error_handler}
375
@strong{Synopsis}
376
@example
377
bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
378
@end example
379
@strong{Description}@*
380
Set the BFD error handler function.  Returns the previous
381
function.
382
 
383
@findex bfd_set_error_program_name
384
@subsubsection @code{bfd_set_error_program_name}
385
@strong{Synopsis}
386
@example
387
void bfd_set_error_program_name (const char *);
388
@end example
389
@strong{Description}@*
390
Set the program name to use when printing a BFD error.  This
391
is printed before the error message followed by a colon and
392
space.  The string must not be changed after it is passed to
393
this function.
394
 
395
@findex bfd_get_error_handler
396
@subsubsection @code{bfd_get_error_handler}
397
@strong{Synopsis}
398
@example
399
bfd_error_handler_type bfd_get_error_handler (void);
400
@end example
401
@strong{Description}@*
402
Return the BFD error handler function.
403
 
404
@section Miscellaneous
405
 
406
 
407
@subsection Miscellaneous functions
408
 
409
 
410
@findex bfd_get_reloc_upper_bound
411
@subsubsection @code{bfd_get_reloc_upper_bound}
412
@strong{Synopsis}
413
@example
414
long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
415
@end example
416
@strong{Description}@*
417
Return the number of bytes required to store the
418
relocation information associated with section @var{sect}
419
attached to bfd @var{abfd}.  If an error occurs, return -1.
420
 
421
@findex bfd_canonicalize_reloc
422
@subsubsection @code{bfd_canonicalize_reloc}
423
@strong{Synopsis}
424
@example
425
long bfd_canonicalize_reloc
426
   (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
427
@end example
428
@strong{Description}@*
429
Call the back end associated with the open BFD
430
@var{abfd} and translate the external form of the relocation
431
information attached to @var{sec} into the internal canonical
432
form.  Place the table into memory at @var{loc}, which has
433
been preallocated, usually by a call to
434
@code{bfd_get_reloc_upper_bound}.  Returns the number of relocs, or
435
-1 on error.
436
 
437
The @var{syms} table is also needed for horrible internal magic
438
reasons.
439
 
440
@findex bfd_set_reloc
441
@subsubsection @code{bfd_set_reloc}
442
@strong{Synopsis}
443
@example
444
void bfd_set_reloc
445
   (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
446
@end example
447
@strong{Description}@*
448
Set the relocation pointer and count within
449
section @var{sec} to the values @var{rel} and @var{count}.
450
The argument @var{abfd} is ignored.
451
 
452
@findex bfd_set_file_flags
453
@subsubsection @code{bfd_set_file_flags}
454
@strong{Synopsis}
455
@example
456
bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
457
@end example
458
@strong{Description}@*
459
Set the flag word in the BFD @var{abfd} to the value @var{flags}.
460
 
461
Possible errors are:
462
@itemize @bullet
463
 
464
@item
465
@code{bfd_error_wrong_format} - The target bfd was not of object format.
466
@item
467
@code{bfd_error_invalid_operation} - The target bfd was open for reading.
468
@item
469
@code{bfd_error_invalid_operation} -
470
The flag word contained a bit which was not applicable to the
471
type of file.  E.g., an attempt was made to set the @code{D_PAGED} bit
472
on a BFD format which does not support demand paging.
473
@end itemize
474
 
475
@findex bfd_get_arch_size
476
@subsubsection @code{bfd_get_arch_size}
477
@strong{Synopsis}
478
@example
479
int bfd_get_arch_size (bfd *abfd);
480
@end example
481
@strong{Description}@*
482
Returns the architecture address size, in bits, as determined
483
by the object file's format.  For ELF, this information is
484
included in the header.
485
 
486
@strong{Returns}@*
487
Returns the arch size in bits if known, @code{-1} otherwise.
488
 
489
@findex bfd_get_sign_extend_vma
490
@subsubsection @code{bfd_get_sign_extend_vma}
491
@strong{Synopsis}
492
@example
493
int bfd_get_sign_extend_vma (bfd *abfd);
494
@end example
495
@strong{Description}@*
496
Indicates if the target architecture "naturally" sign extends
497
an address.  Some architectures implicitly sign extend address
498
values when they are converted to types larger than the size
499
of an address.  For instance, bfd_get_start_address() will
500
return an address sign extended to fill a bfd_vma when this is
501
the case.
502
 
503
@strong{Returns}@*
504
Returns @code{1} if the target architecture is known to sign
505
extend addresses, @code{0} if the target architecture is known to
506
not sign extend addresses, and @code{-1} otherwise.
507
 
508
@findex bfd_set_start_address
509
@subsubsection @code{bfd_set_start_address}
510
@strong{Synopsis}
511
@example
512
bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
513
@end example
514
@strong{Description}@*
515
Make @var{vma} the entry point of output BFD @var{abfd}.
516
 
517
@strong{Returns}@*
518
Returns @code{TRUE} on success, @code{FALSE} otherwise.
519
 
520
@findex bfd_get_gp_size
521
@subsubsection @code{bfd_get_gp_size}
522
@strong{Synopsis}
523
@example
524
unsigned int bfd_get_gp_size (bfd *abfd);
525
@end example
526
@strong{Description}@*
527
Return the maximum size of objects to be optimized using the GP
528
register under MIPS ECOFF.  This is typically set by the @code{-G}
529
argument to the compiler, assembler or linker.
530
 
531
@findex bfd_set_gp_size
532
@subsubsection @code{bfd_set_gp_size}
533
@strong{Synopsis}
534
@example
535
void bfd_set_gp_size (bfd *abfd, unsigned int i);
536
@end example
537
@strong{Description}@*
538
Set the maximum size of objects to be optimized using the GP
539
register under ECOFF or MIPS ELF.  This is typically set by
540
the @code{-G} argument to the compiler, assembler or linker.
541
 
542
@findex bfd_scan_vma
543
@subsubsection @code{bfd_scan_vma}
544
@strong{Synopsis}
545
@example
546
bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
547
@end example
548
@strong{Description}@*
549
Convert, like @code{strtoul}, a numerical expression
550
@var{string} into a @code{bfd_vma} integer, and return that integer.
551
(Though without as many bells and whistles as @code{strtoul}.)
552
The expression is assumed to be unsigned (i.e., positive).
553
If given a @var{base}, it is used as the base for conversion.
554
A base of 0 causes the function to interpret the string
555
in hex if a leading "0x" or "0X" is found, otherwise
556
in octal if a leading zero is found, otherwise in decimal.
557
 
558
If the value would overflow, the maximum @code{bfd_vma} value is
559
returned.
560
 
561
@findex bfd_copy_private_header_data
562
@subsubsection @code{bfd_copy_private_header_data}
563
@strong{Synopsis}
564
@example
565
bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
566
@end example
567
@strong{Description}@*
568
Copy private BFD header information from the BFD @var{ibfd} to the
569
the BFD @var{obfd}.  This copies information that may require
570
sections to exist, but does not require symbol tables.  Return
571
@code{true} on success, @code{false} on error.
572
Possible error returns are:
573
 
574
@itemize @bullet
575
 
576
@item
577
@code{bfd_error_no_memory} -
578
Not enough memory exists to create private data for @var{obfd}.
579
@end itemize
580
@example
581
#define bfd_copy_private_header_data(ibfd, obfd) \
582
     BFD_SEND (obfd, _bfd_copy_private_header_data, \
583
               (ibfd, obfd))
584
@end example
585
 
586
@findex bfd_copy_private_bfd_data
587
@subsubsection @code{bfd_copy_private_bfd_data}
588
@strong{Synopsis}
589
@example
590
bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
591
@end example
592
@strong{Description}@*
593
Copy private BFD information from the BFD @var{ibfd} to the
594
the BFD @var{obfd}.  Return @code{TRUE} on success, @code{FALSE} on error.
595
Possible error returns are:
596
 
597
@itemize @bullet
598
 
599
@item
600
@code{bfd_error_no_memory} -
601
Not enough memory exists to create private data for @var{obfd}.
602
@end itemize
603
@example
604
#define bfd_copy_private_bfd_data(ibfd, obfd) \
605
     BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
606
               (ibfd, obfd))
607
@end example
608
 
609
@findex bfd_merge_private_bfd_data
610
@subsubsection @code{bfd_merge_private_bfd_data}
611
@strong{Synopsis}
612
@example
613
bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
614
@end example
615
@strong{Description}@*
616
Merge private BFD information from the BFD @var{ibfd} to the
617
the output file BFD @var{obfd} when linking.  Return @code{TRUE}
618
on success, @code{FALSE} on error.  Possible error returns are:
619
 
620
@itemize @bullet
621
 
622
@item
623
@code{bfd_error_no_memory} -
624
Not enough memory exists to create private data for @var{obfd}.
625
@end itemize
626
@example
627
#define bfd_merge_private_bfd_data(ibfd, obfd) \
628
     BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
629
               (ibfd, obfd))
630
@end example
631
 
632
@findex bfd_set_private_flags
633
@subsubsection @code{bfd_set_private_flags}
634
@strong{Synopsis}
635
@example
636
bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
637
@end example
638
@strong{Description}@*
639
Set private BFD flag information in the BFD @var{abfd}.
640
Return @code{TRUE} on success, @code{FALSE} on error.  Possible error
641
returns are:
642
 
643
@itemize @bullet
644
 
645
@item
646
@code{bfd_error_no_memory} -
647
Not enough memory exists to create private data for @var{obfd}.
648
@end itemize
649
@example
650
#define bfd_set_private_flags(abfd, flags) \
651
     BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
652
@end example
653
 
654
@findex Other functions
655
@subsubsection @code{Other functions}
656
@strong{Description}@*
657
The following functions exist but have not yet been documented.
658
@example
659
#define bfd_sizeof_headers(abfd, info) \
660
       BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
661
 
662
#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
663
       BFD_SEND (abfd, _bfd_find_nearest_line, \
664
                 (abfd, sec, syms, off, file, func, line))
665
 
666
#define bfd_find_line(abfd, syms, sym, file, line) \
667
       BFD_SEND (abfd, _bfd_find_line, \
668
                 (abfd, syms, sym, file, line))
669
 
670
#define bfd_find_inliner_info(abfd, file, func, line) \
671
       BFD_SEND (abfd, _bfd_find_inliner_info, \
672
                 (abfd, file, func, line))
673
 
674
#define bfd_debug_info_start(abfd) \
675
       BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
676
 
677
#define bfd_debug_info_end(abfd) \
678
       BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
679
 
680
#define bfd_debug_info_accumulate(abfd, section) \
681
       BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
682
 
683
#define bfd_stat_arch_elt(abfd, stat) \
684
       BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
685
 
686
#define bfd_update_armap_timestamp(abfd) \
687
       BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
688
 
689
#define bfd_set_arch_mach(abfd, arch, mach)\
690
       BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
691
 
692
#define bfd_relax_section(abfd, section, link_info, again) \
693
       BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
694
 
695
#define bfd_gc_sections(abfd, link_info) \
696
       BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
697
 
698
#define bfd_merge_sections(abfd, link_info) \
699
       BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
700
 
701
#define bfd_is_group_section(abfd, sec) \
702
       BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
703
 
704
#define bfd_discard_group(abfd, sec) \
705
       BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
706
 
707
#define bfd_link_hash_table_create(abfd) \
708
       BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
709
 
710
#define bfd_link_hash_table_free(abfd, hash) \
711
       BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
712
 
713
#define bfd_link_add_symbols(abfd, info) \
714
       BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
715
 
716
#define bfd_link_just_syms(abfd, sec, info) \
717
       BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
718
 
719
#define bfd_final_link(abfd, info) \
720
       BFD_SEND (abfd, _bfd_final_link, (abfd, info))
721
 
722
#define bfd_free_cached_info(abfd) \
723
       BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
724
 
725
#define bfd_get_dynamic_symtab_upper_bound(abfd) \
726
       BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
727
 
728
#define bfd_print_private_bfd_data(abfd, file)\
729
       BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
730
 
731
#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
732
       BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
733
 
734
#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
735
       BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
736
                                                   dyncount, dynsyms, ret))
737
 
738
#define bfd_get_dynamic_reloc_upper_bound(abfd) \
739
       BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
740
 
741
#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
742
       BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
743
 
744
extern bfd_byte *bfd_get_relocated_section_contents
745
  (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
746
   bfd_boolean, asymbol **);
747
 
748
@end example
749
 
750
@findex bfd_alt_mach_code
751
@subsubsection @code{bfd_alt_mach_code}
752
@strong{Synopsis}
753
@example
754
bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
755
@end example
756
@strong{Description}@*
757
When more than one machine code number is available for the
758
same machine type, this function can be used to switch between
759
the preferred one (alternative == 0) and any others.  Currently,
760
only ELF supports this feature, with up to two alternate
761
machine codes.
762
 
763
 
764
@example
765
struct bfd_preserve
766
@{
767
  void *marker;
768
  void *tdata;
769
  flagword flags;
770
  const struct bfd_arch_info *arch_info;
771
  struct bfd_section *sections;
772
  struct bfd_section *section_last;
773
  unsigned int section_count;
774
  struct bfd_hash_table section_htab;
775
@};
776
 
777
@end example
778
@findex bfd_preserve_save
779
@subsubsection @code{bfd_preserve_save}
780
@strong{Synopsis}
781
@example
782
bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
783
@end example
784
@strong{Description}@*
785
When testing an object for compatibility with a particular
786
target back-end, the back-end object_p function needs to set
787
up certain fields in the bfd on successfully recognizing the
788
object.  This typically happens in a piecemeal fashion, with
789
failures possible at many points.  On failure, the bfd is
790
supposed to be restored to its initial state, which is
791
virtually impossible.  However, restoring a subset of the bfd
792
state works in practice.  This function stores the subset and
793
reinitializes the bfd.
794
 
795
@findex bfd_preserve_restore
796
@subsubsection @code{bfd_preserve_restore}
797
@strong{Synopsis}
798
@example
799
void bfd_preserve_restore (bfd *, struct bfd_preserve *);
800
@end example
801
@strong{Description}@*
802
This function restores bfd state saved by bfd_preserve_save.
803
If MARKER is non-NULL in struct bfd_preserve then that block
804
and all subsequently bfd_alloc'd memory is freed.
805
 
806
@findex bfd_preserve_finish
807
@subsubsection @code{bfd_preserve_finish}
808
@strong{Synopsis}
809
@example
810
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
811
@end example
812
@strong{Description}@*
813
This function should be called when the bfd state saved by
814
bfd_preserve_save is no longer needed.  ie. when the back-end
815
object_p function returns with success.
816
 
817
@findex bfd_emul_get_maxpagesize
818
@subsubsection @code{bfd_emul_get_maxpagesize}
819
@strong{Synopsis}
820
@example
821
bfd_vma bfd_emul_get_maxpagesize (const char *);
822
@end example
823
@strong{Description}@*
824
Returns the maximum page size, in bytes, as determined by
825
emulation.
826
 
827
@strong{Returns}@*
828
Returns the maximum page size in bytes for ELF, 0 otherwise.
829
 
830
@findex bfd_emul_set_maxpagesize
831
@subsubsection @code{bfd_emul_set_maxpagesize}
832
@strong{Synopsis}
833
@example
834
void bfd_emul_set_maxpagesize (const char *, bfd_vma);
835
@end example
836
@strong{Description}@*
837
For ELF, set the maximum page size for the emulation.  It is
838
a no-op for other formats.
839
 
840
@findex bfd_emul_get_commonpagesize
841
@subsubsection @code{bfd_emul_get_commonpagesize}
842
@strong{Synopsis}
843
@example
844
bfd_vma bfd_emul_get_commonpagesize (const char *);
845
@end example
846
@strong{Description}@*
847
Returns the common page size, in bytes, as determined by
848
emulation.
849
 
850
@strong{Returns}@*
851
Returns the common page size in bytes for ELF, 0 otherwise.
852
 
853
@findex bfd_emul_set_commonpagesize
854
@subsubsection @code{bfd_emul_set_commonpagesize}
855
@strong{Synopsis}
856
@example
857
void bfd_emul_set_commonpagesize (const char *, bfd_vma);
858
@end example
859
@strong{Description}@*
860
For ELF, set the common page size for the emulation.  It is
861
a no-op for other formats.
862
 
863
@findex bfd_demangle
864
@subsubsection @code{bfd_demangle}
865
@strong{Synopsis}
866
@example
867
char *bfd_demangle (bfd *, const char *, int);
868
@end example
869
@strong{Description}@*
870
Wrapper around cplus_demangle.  Strips leading underscores and
871
other such chars that would otherwise confuse the demangler.
872
If passed a g++ v3 ABI mangled name, returns a buffer allocated
873
with malloc holding the demangled name.  Returns NULL otherwise
874
and on memory alloc failure.
875
 

powered by: WebSVN 2.1.0

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