recording file death
[deliverable/binutils-gdb.git] / include / bfd.h
1 /* Main header file for the bfd library -- portable access to object files.
2 ==> The bfd.h file is generated from bfd-in.h and various .c files; if you
3 ==> change it, your changes will probably be lost.
4 Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
5 Contributed by Cygnus Support.
6
7 This file is part of BFD, the Binary File Descriptor library.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22
23 /* bfd.h -- The only header file required by users of the bfd library
24
25 The bfd.h file is generated from bfd-in.h and various .c files; if you
26 change it, your changes will probably be lost.
27
28 All the prototypes and definitions following the comment "THE FOLLOWING
29 IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
30 BFD. If you change it, someone oneday will extract it from the source
31 again, and your changes will be lost. To save yourself from this bind,
32 change the definitions in the source in the bfd directory. Type "make
33 docs" and then "make headers" in that directory, and magically this file
34 will change to reflect your changes.
35
36 If you don't have the tools to perform the extraction, then you are
37 safe from someone on your system trampling over your header files.
38 You should still maintain the equivalence between the source and this
39 file though; every change you make to the .c file should be reflected
40 here. */
41
42 #ifndef __BFD_H_SEEN__
43 #define __BFD_H_SEEN__
44
45 #include "ansidecl.h"
46 #include "obstack.h"
47
48 #define BFD_VERSION "2.0"
49
50 /* forward declaration */
51 typedef struct _bfd bfd;
52
53 /* General rules: functions which are boolean return true on success
54 and false on failure (unless they're a predicate). -- bfd.doc */
55 /* I'm sure this is going to break something and someone is going to
56 force me to change it. */
57 /* typedef enum boolean {false, true} boolean; */
58 /* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
59 typedef enum bfd_boolean {false, true} boolean;
60
61 /* A pointer to a position in a file. */
62 /* FIXME: This should be using off_t from <sys/types.h>.
63 For now, try to avoid breaking stuff by not including <sys/types.h> here.
64 This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
65 Probably the best long-term answer is to avoid using file_ptr AND off_t
66 in this header file, and to handle this in the BFD implementation
67 rather than in its interface. */
68 /* typedef off_t file_ptr; */
69 typedef long int file_ptr;
70
71 /* Support for different sizes of target format ints and addresses */
72
73 #ifdef HOST_64_BIT
74 typedef HOST_64_BIT rawdata_offset;
75 typedef HOST_64_BIT bfd_vma;
76 typedef HOST_64_BIT bfd_word;
77 typedef HOST_64_BIT bfd_offset;
78 typedef HOST_64_BIT bfd_size_type;
79 typedef HOST_64_BIT symvalue;
80 typedef HOST_64_BIT bfd_64_type;
81 #define fprintf_vma(s,x) \
82 fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
83 #else
84 typedef struct {int a,b;} bfd_64_type;
85 typedef unsigned long rawdata_offset;
86 typedef unsigned long bfd_vma;
87 typedef unsigned long bfd_offset;
88 typedef unsigned long bfd_word;
89 typedef unsigned long bfd_size;
90 typedef unsigned long symvalue;
91 typedef unsigned long bfd_size_type;
92 #define fprintf_vma(s,x) fprintf(s, "%08lx", x)
93 #endif
94 #define printf_vma(x) fprintf_vma(stdout,x)
95
96 typedef unsigned int flagword; /* 32 bits of flags */
97 \f
98 /** File formats */
99
100 typedef enum bfd_format {
101 bfd_unknown = 0, /* file format is unknown */
102 bfd_object, /* linker/assember/compiler output */
103 bfd_archive, /* object archive file */
104 bfd_core, /* core dump */
105 bfd_type_end} /* marks the end; don't use it! */
106 bfd_format;
107
108 /* Object file flag values */
109 #define NO_FLAGS 0x00
110 #define HAS_RELOC 0x01
111 #define EXEC_P 0x02
112 #define HAS_LINENO 0x04
113 #define HAS_DEBUG 0x08
114 #define HAS_SYMS 0x10
115 #define HAS_LOCALS 0x20
116 #define DYNAMIC 0x40
117 #define WP_TEXT 0x80
118 #define D_PAGED 0x100
119 #define BFD_IS_RELAXABLE 0x200
120 \f
121 /* symbols and relocation */
122
123 typedef unsigned long symindex;
124
125 #define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
126
127 typedef enum bfd_symclass {
128 bfd_symclass_unknown = 0,
129 bfd_symclass_fcommon, /* fortran common symbols */
130 bfd_symclass_global, /* global symbol, what a surprise */
131 bfd_symclass_debugger, /* some debugger symbol */
132 bfd_symclass_undefined /* none known */
133 } symclass;
134
135
136 typedef int symtype; /* Who knows, yet? */
137
138
139 /* general purpose part of a symbol;
140 target specific parts will be found in libcoff.h, liba.out.h etc */
141
142
143 #define bfd_get_section(x) ((x)->section)
144 #define bfd_get_output_section(x) ((x)->section->output_section)
145 #define bfd_set_section(x,y) ((x)->section) = (y)
146 #define bfd_asymbol_base(x) ((x)->section?((x)->section->vma):0)
147 #define bfd_asymbol_value(x) (bfd_asymbol_base(x) + x->value)
148 #define bfd_asymbol_name(x) ((x)->name)
149
150 /* This is a type pun with struct ranlib on purpose! */
151 typedef struct carsym {
152 char *name;
153 file_ptr file_offset; /* look here to find the file */
154 } carsym; /* to make these you call a carsymogen */
155
156
157 /* Used in generating armaps. Perhaps just a forward definition would do? */
158 struct orl { /* output ranlib */
159 char **name; /* symbol name */
160 file_ptr pos; /* bfd* or file position */
161 int namidx; /* index into string table */
162 };
163
164 \f
165
166 /* Linenumber stuff */
167 typedef struct lineno_cache_entry {
168 unsigned int line_number; /* Linenumber from start of function*/
169 union {
170 struct symbol_cache_entry *sym; /* Function name */
171 unsigned long offset; /* Offset into section */
172 } u;
173 } alent;
174 \f
175 /* object and core file sections */
176
177
178 #define align_power(addr, align) \
179 ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
180
181 typedef struct sec *sec_ptr;
182
183 #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
184 #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
185 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
186 #define bfd_section_name(bfd, ptr) ((ptr)->name)
187 #define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
188 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
189 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
190 #define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
191 #define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
192
193 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (val)), ((ptr)->user_set_vma = true), true)
194 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
195 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
196
197 typedef struct stat stat_type;
198 \f
199 /** Error handling */
200
201 typedef enum bfd_error {
202 no_error = 0, system_call_error, invalid_target,
203 wrong_format, invalid_operation, no_memory,
204 no_symbols, no_relocation_info,
205 no_more_archived_files, malformed_archive,
206 symbol_not_found, file_not_recognized,
207 file_ambiguously_recognized, no_contents,
208 bfd_error_nonrepresentable_section,
209 no_debug_section, bad_value,
210 invalid_error_code} bfd_ec;
211
212 extern bfd_ec bfd_error;
213 struct reloc_cache_entry;
214 struct bfd_seclet;
215
216
217 typedef struct bfd_error_vector {
218 void (* nonrepresentable_section ) PARAMS ((CONST bfd *CONST abfd,
219 CONST char *CONST name));
220 void (* undefined_symbol) PARAMS ((CONST struct reloc_cache_entry *rel,
221 CONST struct bfd_seclet *sec));
222 void (* reloc_value_truncated) PARAMS ((CONST struct
223 reloc_cache_entry *rel,
224 struct bfd_seclet *sec));
225
226 void (* reloc_dangerous) PARAMS ((CONST struct reloc_cache_entry *rel,
227 CONST struct bfd_seclet *sec));
228
229 } bfd_error_vector_type;
230
231 CONST char *bfd_errmsg PARAMS ((bfd_ec error_tag));
232 void bfd_perror PARAMS ((CONST char *message));
233 \f
234
235 typedef enum bfd_print_symbol
236 {
237 bfd_print_symbol_name,
238 bfd_print_symbol_more,
239 bfd_print_symbol_all,
240 bfd_print_symbol_nm /* Pretty format suitable for nm program. */
241 } bfd_print_symbol_type;
242
243 \f
244 \f
245 /* The code that implements targets can initialize a jump table with this
246 macro. It must name all its routines the same way (a prefix plus
247 the standard routine suffix), or it must #define the routines that
248 are not so named, before calling JUMP_TABLE in the initializer. */
249
250 /* Semi-portable string concatenation in cpp */
251 #ifndef CAT
252 #ifdef __STDC__
253 #define CAT(a,b) a##b
254 #else
255 #define CAT(a,b) a/**/b
256 #endif
257 #endif
258
259 #define JUMP_TABLE(NAME)\
260 CAT(NAME,_core_file_failing_command),\
261 CAT(NAME,_core_file_failing_signal),\
262 CAT(NAME,_core_file_matches_executable_p),\
263 CAT(NAME,_slurp_armap),\
264 CAT(NAME,_slurp_extended_name_table),\
265 CAT(NAME,_truncate_arname),\
266 CAT(NAME,_write_armap),\
267 CAT(NAME,_close_and_cleanup), \
268 CAT(NAME,_set_section_contents),\
269 CAT(NAME,_get_section_contents),\
270 CAT(NAME,_new_section_hook),\
271 CAT(NAME,_get_symtab_upper_bound),\
272 CAT(NAME,_get_symtab),\
273 CAT(NAME,_get_reloc_upper_bound),\
274 CAT(NAME,_canonicalize_reloc),\
275 CAT(NAME,_make_empty_symbol),\
276 CAT(NAME,_print_symbol),\
277 CAT(NAME,_get_lineno),\
278 CAT(NAME,_set_arch_mach),\
279 CAT(NAME,_openr_next_archived_file),\
280 CAT(NAME,_find_nearest_line),\
281 CAT(NAME,_generic_stat_arch_elt),\
282 CAT(NAME,_sizeof_headers),\
283 CAT(NAME,_bfd_debug_info_start),\
284 CAT(NAME,_bfd_debug_info_end),\
285 CAT(NAME,_bfd_debug_info_accumulate),\
286 CAT(NAME,_bfd_get_relocated_section_contents),\
287 CAT(NAME,_bfd_relax_section)
288
289 #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
290
291 \f
292 /* User program access to BFD facilities */
293
294 extern CONST short _bfd_host_big_endian;
295 #define HOST_BYTE_ORDER_BIG_P (*(char *)&_bfd_host_big_endian)
296
297 /* The bfd itself */
298
299 /* Cast from const char * to char * so that caller can assign to
300 a char * without a warning. */
301 #define bfd_get_filename(abfd) ((char *) (abfd)->filename)
302 #define bfd_get_format(abfd) ((abfd)->format)
303 #define bfd_get_target(abfd) ((abfd)->xvec->name)
304 #define bfd_get_file_flags(abfd) ((abfd)->flags)
305 #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
306 #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
307 #define bfd_my_archive(abfd) ((abfd)->my_archive)
308 #define bfd_has_map(abfd) ((abfd)->has_armap)
309 #define bfd_header_twiddle_required(abfd) \
310 ((((abfd)->xvec->header_byteorder_big_p) \
311 != (boolean)HOST_BYTE_ORDER_BIG_P) ? true:false)
312
313 #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
314 #define bfd_usrdata(abfd) ((abfd)->usrdata)
315
316 #define bfd_get_start_address(abfd) ((abfd)->start_address)
317 #define bfd_get_symcount(abfd) ((abfd)->symcount)
318 #define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
319 #define bfd_count_sections(abfd) ((abfd)->section_count)
320 #define bfd_get_architecture(abfd) ((abfd)->obj_arch)
321 #define bfd_get_machine(abfd) ((abfd)->obj_machine)
322
323 #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
324
325 #define BYTE_SIZE 1
326 #define SHORT_SIZE 2
327 #define LONG_SIZE 4
328
329 /* And more from the source. */
330 void
331 bfd_init PARAMS ((void));
332
333 bfd *
334 bfd_openr PARAMS ((CONST char *filename, CONST char*target));
335
336 bfd *
337 bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
338
339 bfd *
340 bfd_openw PARAMS ((CONST char *filename, CONST char *target));
341
342 boolean
343 bfd_close PARAMS ((bfd *));
344
345 boolean
346 bfd_close_all_done PARAMS ((bfd *));
347
348 bfd_size_type
349 bfd_alloc_size PARAMS ((bfd *abfd));
350
351 bfd *
352 bfd_create PARAMS ((CONST char *filename, bfd *template));
353
354 #define bfd_put_8(abfd, val, ptr) \
355 (*((char *)ptr) = (char)val)
356 #define bfd_get_8(abfd, ptr) \
357 (*((char *)ptr))
358 #define bfd_put_16(abfd, val, ptr) \
359 BFD_SEND(abfd, bfd_putx16, (val,ptr))
360 #define bfd_get_16(abfd, ptr) \
361 BFD_SEND(abfd, bfd_getx16, (ptr))
362 #define bfd_put_32(abfd, val, ptr) \
363 BFD_SEND(abfd, bfd_putx32, (val,ptr))
364 #define bfd_get_32(abfd, ptr) \
365 BFD_SEND(abfd, bfd_getx32, (ptr))
366 #define bfd_put_64(abfd, val, ptr) \
367 BFD_SEND(abfd, bfd_putx64, (val, ptr))
368 #define bfd_get_64(abfd, ptr) \
369 BFD_SEND(abfd, bfd_getx64, (ptr))
370 #define bfd_h_put_8(abfd, val, ptr) \
371 (*((char *)ptr) = (char)val)
372 #define bfd_h_get_8(abfd, ptr) \
373 (*((char *)ptr))
374 #define bfd_h_put_16(abfd, val, ptr) \
375 BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
376 #define bfd_h_get_16(abfd, ptr) \
377 BFD_SEND(abfd, bfd_h_getx16,(ptr))
378 #define bfd_h_put_32(abfd, val, ptr) \
379 BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
380 #define bfd_h_get_32(abfd, ptr) \
381 BFD_SEND(abfd, bfd_h_getx32,(ptr))
382 #define bfd_h_put_64(abfd, val, ptr) \
383 BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
384 #define bfd_h_get_64(abfd, ptr) \
385 BFD_SEND(abfd, bfd_h_getx64,(ptr))
386 typedef struct sec
387 {
388 /* The name of the section, the name isn't a copy, the pointer is
389 the same as that passed to bfd_make_section. */
390
391 CONST char *name;
392
393
394 /* Which section is it 0.nth */
395
396 int index;
397
398 /* The next section in the list belonging to the BFD, or NULL. */
399
400 struct sec *next;
401
402 /* The field flags contains attributes of the section. Some of
403 flags are read in from the object file, and some are
404 synthesized from other information. */
405
406 flagword flags;
407
408 #define SEC_NO_FLAGS 0x000
409
410 /* Tells the OS to allocate space for this section when loaded.
411 This would clear for a section containing debug information
412 only. */
413
414
415 #define SEC_ALLOC 0x001
416 /* Tells the OS to load the section from the file when loading.
417 This would be clear for a .bss section */
418
419 #define SEC_LOAD 0x002
420 /* The section contains data still to be relocated, so there will
421 be some relocation information too. */
422
423 #define SEC_RELOC 0x004
424
425 /* Obsolete ? */
426
427 #define SEC_BALIGN 0x008
428
429 /* A signal to the OS that the section contains read only
430 data. */
431 #define SEC_READONLY 0x010
432
433 /* The section contains code only. */
434
435 #define SEC_CODE 0x020
436
437 /* The section contains data only. */
438
439 #define SEC_DATA 0x040
440
441 /* The section will reside in ROM. */
442
443 #define SEC_ROM 0x080
444
445 /* The section contains constructor information. This section
446 type is used by the linker to create lists of constructors and
447 destructors used by <<g++>>. When a back end sees a symbol
448 which should be used in a constructor list, it creates a new
449 section for the type of name (eg <<__CTOR_LIST__>>), attaches
450 the symbol to it and builds a relocation. To build the lists
451 of constructors, all the linker has to to is catenate all the
452 sections called <<__CTOR_LIST__>> and relocte the data
453 contained within - exactly the operations it would peform on
454 standard data. */
455
456 #define SEC_CONSTRUCTOR 0x100
457
458 /* The section is a constuctor, and should be placed at the
459 end of the . */
460
461
462 #define SEC_CONSTRUCTOR_TEXT 0x1100
463
464 #define SEC_CONSTRUCTOR_DATA 0x2100
465
466 #define SEC_CONSTRUCTOR_BSS 0x3100
467
468
469 /* The section has contents - a bss section could be
470 <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>, a debug section could be
471 <<SEC_HAS_CONTENTS>> */
472
473 #define SEC_HAS_CONTENTS 0x200
474
475 /* An instruction to the linker not to output sections
476 containing this flag even if they have information which
477 would normally be written. */
478
479 #define SEC_NEVER_LOAD 0x400
480
481 /* The section is a shared library section. The linker must leave
482 these completely alone, as the vma and size are used when
483 the executable is loaded. */
484
485 #define SEC_SHARED_LIBRARY 0x800
486
487
488 bfd_vma vma;
489 boolean user_set_vma;
490
491 /* The size of the section in bytes, as it will be output.
492 contains a value even if the section has no contents (eg, the
493 size of <<.bss>>). This will be filled in after relocation */
494
495 bfd_size_type _cooked_size;
496
497 /* The size on disk of the section in bytes originally. Normally this
498 value is the same as the size, but if some relaxing has
499 been done, then this value will be bigger. */
500
501 bfd_size_type _raw_size;
502
503 /* If this section is going to be output, then this value is the
504 offset into the output section of the first byte in the input
505 section. Eg, if this was going to start at the 100th byte in
506 the output section, this value would be 100. */
507
508 bfd_vma output_offset;
509
510 /* The output section through which to map on output. */
511
512 struct sec *output_section;
513
514 /* The alignment requirement of the section, as an exponent - eg
515 3 aligns to 2^3 (or 8) */
516
517 unsigned int alignment_power;
518
519 /* If an input section, a pointer to a vector of relocation
520 records for the data in this section. */
521
522 struct reloc_cache_entry *relocation;
523
524 /* If an output section, a pointer to a vector of pointers to
525 relocation records for the data in this section. */
526
527 struct reloc_cache_entry **orelocation;
528
529 /* The number of relocation records in one of the above */
530
531 unsigned reloc_count;
532
533 /* Information below is back end specific - and not always used
534 or updated
535
536 File position of section data */
537
538 file_ptr filepos;
539
540 /* File position of relocation info */
541
542 file_ptr rel_filepos;
543
544 /* File position of line data */
545
546 file_ptr line_filepos;
547
548 /* Pointer to data for applications */
549
550 PTR userdata;
551
552 struct lang_output_section *otheruserdata;
553
554 /* Attached line number information */
555
556 alent *lineno;
557
558 /* Number of line number records */
559
560 unsigned int lineno_count;
561
562 /* When a section is being output, this value changes as more
563 linenumbers are written out */
564
565 file_ptr moving_line_filepos;
566
567 /* what the section number is in the target world */
568
569 int target_index;
570
571 PTR used_by_bfd;
572
573 /* If this is a constructor section then here is a list of the
574 relocations created to relocate items within it. */
575
576 struct relent_chain *constructor_chain;
577
578 /* The BFD which owns the section. */
579
580 bfd *owner;
581
582 boolean reloc_done;
583 /* A symbol which points at this section only */
584 struct symbol_cache_entry *symbol;
585 struct symbol_cache_entry **symbol_ptr_ptr;
586 struct bfd_seclet *seclets_head;
587 struct bfd_seclet *seclets_tail;
588 } asection ;
589
590
591 #define BFD_ABS_SECTION_NAME "*ABS*"
592 #define BFD_UND_SECTION_NAME "*UND*"
593 #define BFD_COM_SECTION_NAME "*COM*"
594
595 /* the absolute section */
596 extern asection bfd_abs_section;
597 /* Pointer to the undefined section */
598 extern asection bfd_und_section;
599 /* Pointer to the common section */
600 extern asection bfd_com_section;
601
602 extern struct symbol_cache_entry *bfd_abs_symbol;
603 extern struct symbol_cache_entry *bfd_com_symbol;
604 extern struct symbol_cache_entry *bfd_und_symbol;
605 #define bfd_get_section_size_before_reloc(section) \
606 (section->reloc_done ? (abort(),1): (section)->_raw_size)
607 #define bfd_get_section_size_after_reloc(section) \
608 ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
609 asection *
610 bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name));
611
612 asection *
613 bfd_make_section_old_way PARAMS ((bfd *, CONST char *name));
614
615 asection *
616 bfd_make_section PARAMS ((bfd *, CONST char *name));
617
618 boolean
619 bfd_set_section_flags PARAMS ((bfd *, asection *, flagword));
620
621 void
622 bfd_map_over_sections PARAMS ((bfd *abfd,
623 void (*func)(bfd *abfd,
624 asection *sect,
625 PTR obj),
626 PTR obj));
627
628 boolean
629 bfd_set_section_size PARAMS ((bfd *, asection *, bfd_size_type val));
630
631 boolean
632 bfd_set_section_contents
633 PARAMS ((bfd *abfd,
634 asection *section,
635 PTR data,
636 file_ptr offset,
637 bfd_size_type count));
638
639 boolean
640 bfd_get_section_contents
641 PARAMS ((bfd *abfd, asection *section, PTR location,
642 file_ptr offset, bfd_size_type count));
643
644 enum bfd_architecture
645 {
646 bfd_arch_unknown, /* File arch not known */
647 bfd_arch_obscure, /* Arch known, not one of these */
648 bfd_arch_m68k, /* Motorola 68xxx */
649 bfd_arch_vax, /* DEC Vax */
650 bfd_arch_i960, /* Intel 960 */
651 /* The order of the following is important.
652 lower number indicates a machine type that
653 only accepts a subset of the instructions
654 available to machines with higher numbers.
655 The exception is the "ca", which is
656 incompatible with all other machines except
657 "core". */
658
659 #define bfd_mach_i960_core 1
660 #define bfd_mach_i960_ka_sa 2
661 #define bfd_mach_i960_kb_sb 3
662 #define bfd_mach_i960_mc 4
663 #define bfd_mach_i960_xa 5
664 #define bfd_mach_i960_ca 6
665
666 bfd_arch_a29k, /* AMD 29000 */
667 bfd_arch_sparc, /* SPARC */
668 bfd_arch_mips, /* MIPS Rxxxx */
669 bfd_arch_i386, /* Intel 386 */
670 bfd_arch_we32k, /* AT&T WE32xxx */
671 bfd_arch_tahoe, /* CCI/Harris Tahoe */
672 bfd_arch_i860, /* Intel 860 */
673 bfd_arch_romp, /* IBM ROMP PC/RT */
674 bfd_arch_alliant, /* Alliant */
675 bfd_arch_convex, /* Convex */
676 bfd_arch_m88k, /* Motorola 88xxx */
677 bfd_arch_pyramid, /* Pyramid Technology */
678 bfd_arch_h8300, /* Hitachi H8/300 */
679 bfd_arch_rs6000, /* IBM RS/6000 */
680 bfd_arch_hppa, /* HP PA RISC */
681 bfd_arch_z8k, /* Zilog Z8000 */
682 #define bfd_mach_z8001 1
683 #define bfd_mach_z8002 2
684 bfd_arch_last
685 };
686
687 typedef struct bfd_arch_info
688 {
689 int bits_per_word;
690 int bits_per_address;
691 int bits_per_byte;
692 enum bfd_architecture arch;
693 long mach;
694 char *arch_name;
695 CONST char *printable_name;
696 unsigned int section_align_power;
697 /* true if this is the default machine for the architecture */
698 boolean the_default;
699 CONST struct bfd_arch_info * (*compatible)
700 PARAMS ((CONST struct bfd_arch_info *a,
701 CONST struct bfd_arch_info *b));
702
703 boolean (*scan) PARAMS ((CONST struct bfd_arch_info *, CONST char *));
704 /* How to disassemble an instruction, producing a printable
705 representation on a specified stdio stream. This isn't
706 defined for most processors at present, because of the size
707 of the additional tables it would drag in, and because gdb
708 wants to use a different interface. */
709 unsigned int (*disassemble) PARAMS ((bfd_vma addr, CONST char *data,
710 PTR stream));
711
712 struct bfd_arch_info *next;
713 } bfd_arch_info_type;
714 CONST char *
715 bfd_printable_name PARAMS ((bfd *abfd));
716
717 bfd_arch_info_type *
718 bfd_scan_arch PARAMS ((CONST char *));
719
720 CONST bfd_arch_info_type *
721 bfd_arch_get_compatible PARAMS ((
722 CONST bfd *abfd,
723 CONST bfd *bbfd));
724
725 void
726 bfd_set_arch_info PARAMS ((bfd *, bfd_arch_info_type *));
727
728 enum bfd_architecture
729 bfd_get_arch PARAMS ((bfd *abfd));
730
731 unsigned long
732 bfd_get_mach PARAMS ((bfd *abfd));
733
734 unsigned int
735 bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
736
737 unsigned int
738 bfd_arch_bits_per_address PARAMS ((bfd *abfd));
739
740 bfd_arch_info_type *
741 bfd_get_arch_info PARAMS ((bfd *));
742
743 bfd_arch_info_type *
744 bfd_lookup_arch
745 PARAMS ((enum bfd_architecture
746 arch,
747 long machine));
748
749 CONST char *
750 bfd_printable_arch_mach
751 PARAMS ((enum bfd_architecture arch, unsigned long machine));
752
753 typedef enum bfd_reloc_status
754 {
755 /* No errors detected */
756 bfd_reloc_ok,
757
758 /* The relocation was performed, but there was an overflow. */
759 bfd_reloc_overflow,
760
761 /* The address to relocate was not within the section supplied*/
762 bfd_reloc_outofrange,
763
764 /* Used by special functions */
765 bfd_reloc_continue,
766
767 /* Unused */
768 bfd_reloc_notsupported,
769
770 /* Unsupported relocation size requested. */
771 bfd_reloc_other,
772
773 /* The symbol to relocate against was undefined.*/
774 bfd_reloc_undefined,
775
776 /* The relocation was performed, but may not be ok - presently
777 generated only when linking i960 coff files with i960 b.out
778 symbols. */
779 bfd_reloc_dangerous
780 }
781 bfd_reloc_status_type;
782
783
784 typedef struct reloc_cache_entry
785 {
786 /* A pointer into the canonical table of pointers */
787 struct symbol_cache_entry **sym_ptr_ptr;
788
789 /* offset in section */
790 rawdata_offset address;
791
792 /* addend for relocation value */
793 bfd_vma addend;
794
795 /* Pointer to how to perform the required relocation */
796 CONST struct reloc_howto_struct *howto;
797
798 } arelent;
799
800 typedef CONST struct reloc_howto_struct
801 {
802 /* The type field has mainly a documetary use - the back end can
803 to what it wants with it, though the normally the back end's
804 external idea of what a reloc number would be would be stored
805 in this field. For example, the a PC relative word relocation
806 in a coff environment would have the type 023 - because that's
807 what the outside world calls a R_PCRWORD reloc. */
808 unsigned int type;
809
810 /* The value the final relocation is shifted right by. This drops
811 unwanted data from the relocation. */
812 unsigned int rightshift;
813
814 /* The size of the item to be relocated - 0, is one byte, 1 is 2
815 bytes, 3 is four bytes. A -ve value indicates that the
816 result is to be subtracted from the data*/
817 int size;
818
819 /* Now obsolete. But m68k-coff still uses it. */
820 unsigned int bitsize;
821
822 /* Notes that the relocation is relative to the location in the
823 data section of the addend. The relocation function will
824 subtract from the relocation value the address of the location
825 being relocated. */
826 boolean pc_relative;
827
828 /* Now obsolete. Still used by bfd_perform_relocation though. */
829 unsigned int bitpos;
830
831 #if 1
832 /* Now obsolete */
833 boolean absolute;
834 #endif
835
836 /* Causes the relocation routine to return an error if overflow
837 is detected when relocating. */
838 boolean complain_on_overflow;
839
840 /* If this field is non null, then the supplied function is
841 called rather than the normal function. This allows really
842 strange relocation methods to be accomodated (eg, i960 callj
843 instructions). */
844 bfd_reloc_status_type (*special_function)
845 PARAMS ((bfd *abfd,
846 arelent *reloc_entry,
847 struct symbol_cache_entry *symbol,
848 PTR data,
849 asection *input_section,
850 bfd *output_bfd));
851
852 /* The textual name of the relocation type. */
853 char *name;
854
855 /* When performing a partial link, some formats must modify the
856 relocations rather than the data - this flag signals this.*/
857 boolean partial_inplace;
858
859 /* The src_mask is used to select what parts of the read in data
860 are to be used in the relocation sum. Eg, if this was an 8 bit
861 bit of data which we read and relocated, this would be
862 0x000000ff. When we have relocs which have an addend, such as
863 sun4 extended relocs, the value in the offset part of a
864 relocating field is garbage so we never use it. In this case
865 the mask would be 0x00000000. */
866 bfd_word src_mask;
867
868 /* The dst_mask is what parts of the instruction are replaced
869 into the instruction. In most cases src_mask == dst_mask,
870 except in the above special case, where dst_mask would be
871 0x000000ff, and src_mask would be 0x00000000. */
872 bfd_word dst_mask;
873
874 /* When some formats create PC relative instructions, they leave
875 the value of the pc of the place being relocated in the offset
876 slot of the instruction, so that a PC relative relocation can
877 be made just by adding in an ordinary offset (eg sun3 a.out).
878 Some formats leave the displacement part of an instruction
879 empty (eg m88k bcs), this flag signals the fact.*/
880 boolean pcrel_offset;
881
882 } reloc_howto_type;
883 #define HOWTO(C, R,S,B, P, BI, ABS, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
884 {(unsigned)C,R,S,B, P, BI, ABS,O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
885 #define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,false,false,FUNCTION, NAME,false,0,0,IN)
886
887 #define HOWTO_PREPARE(relocation, symbol) \
888 { \
889 if (symbol != (asymbol *)NULL) { \
890 if (symbol->section == &bfd_com_section) { \
891 relocation = 0; \
892 } \
893 else { \
894 relocation = symbol->value; \
895 } \
896 } \
897 }
898 typedef unsigned char bfd_byte;
899
900 typedef struct relent_chain {
901 arelent relent;
902 struct relent_chain *next;
903 } arelent_chain;
904 bfd_reloc_status_type
905
906 bfd_perform_relocation
907 PARAMS ((bfd * abfd,
908 arelent *reloc_entry,
909 PTR data,
910 asection *input_section,
911 bfd *output_bfd));
912
913 typedef enum bfd_reloc_code_real
914
915 {
916 /* 16 bits wide, simple reloc */
917 BFD_RELOC_16,
918
919 /* 8 bits wide, but used to form an address like 0xffnn */
920 BFD_RELOC_8_FFnn,
921
922 /* 8 bits wide, simple */
923 BFD_RELOC_8,
924
925 /* 8 bits wide, pc relative */
926 BFD_RELOC_8_PCREL,
927
928 /* The type of reloc used to build a contructor table - at the
929 moment probably a 32 bit wide abs address, but the cpu can
930 choose. */
931
932 BFD_RELOC_CTOR,
933
934 /* 32 bits wide, simple reloc */
935 BFD_RELOC_32,
936 /* 32 bits, PC-relative */
937 BFD_RELOC_32_PCREL,
938
939 /* High 22 bits of 32-bit value; simple reloc. */
940 BFD_RELOC_HI22,
941 /* Low 10 bits. */
942 BFD_RELOC_LO10,
943
944 /* Reloc types used for i960/b.out. */
945 BFD_RELOC_24_PCREL,
946 BFD_RELOC_I960_CALLJ,
947
948 BFD_RELOC_16_PCREL,
949 /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
950 word displacement, e.g. for SPARC) */
951 BFD_RELOC_32_PCREL_S2,
952
953 /* now for the sparc/elf codes */
954 BFD_RELOC_NONE, /* actually used */
955 BFD_RELOC_SPARC_WDISP22,
956 BFD_RELOC_SPARC22,
957 BFD_RELOC_SPARC13,
958 BFD_RELOC_SPARC_BASE13,
959 BFD_RELOC_SPARC_GOT10,
960 BFD_RELOC_SPARC_GOT13,
961 BFD_RELOC_SPARC_GOT22,
962 BFD_RELOC_SPARC_PC10,
963 BFD_RELOC_SPARC_PC22,
964 BFD_RELOC_SPARC_WPLT30,
965 BFD_RELOC_SPARC_COPY,
966 BFD_RELOC_SPARC_GLOB_DAT,
967 BFD_RELOC_SPARC_JMP_SLOT,
968 BFD_RELOC_SPARC_RELATIVE,
969 BFD_RELOC_SPARC_UA32,
970
971 /* this one is a.out specific? */
972 BFD_RELOC_SPARC_BASE22,
973
974 /* this must be the highest numeric value */
975 BFD_RELOC_UNUSED
976 } bfd_reloc_code_real_type;
977 CONST struct reloc_howto_struct *
978
979 bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
980
981 typedef struct symbol_cache_entry
982 {
983 /* A pointer to the BFD which owns the symbol. This information
984 is necessary so that a back end can work out what additional
985 information (invisible to the application writer) is carried
986 with the symbol. */
987
988 struct _bfd *the_bfd;
989
990 /* The text of the symbol. The name is left alone, and not copied - the
991 application may not alter it. */
992 CONST char *name;
993
994 /* The value of the symbol.*/
995 symvalue value;
996
997 /* Attributes of a symbol: */
998
999 #define BSF_NO_FLAGS 0x00
1000
1001 /* The symbol has local scope; <<static>> in <<C>>. The value
1002 is the offset into the section of the data. */
1003 #define BSF_LOCAL 0x01
1004
1005 /* The symbol has global scope; initialized data in <<C>>. The
1006 value is the offset into the section of the data. */
1007 #define BSF_GLOBAL 0x02
1008
1009 /* Obsolete; should be deleted? */
1010 #define BSF_IMPORT 0x04
1011
1012 /* The symbol has global scope, and is exported. The value is
1013 the offset into the section of the data. */
1014 #define BSF_EXPORT 0x08
1015
1016 /* The symbol is undefined. <<extern>> in <<C>>. The value has
1017 no meaning. Obsolete; should be deleted? */
1018 #define BSF_UNDEFINED_OBS 0x10
1019
1020 /* The symbol is common, initialized to zero; default in
1021 <<C>>. The value is the size of the object in bytes. */
1022 #define BSF_FORT_COMM_OBS 0x20
1023
1024 /* A normal C symbol would be one of:
1025 <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
1026 <<BSF_EXPORT|BSD_GLOBAL>> */
1027
1028 /* The symbol is a debugging record. The value has an arbitary
1029 meaning. */
1030 #define BSF_DEBUGGING 0x40
1031
1032 /* Used by the linker. Should be part of app_data now. */
1033 #define BSF_KEEP 0x10000
1034 #define BSF_KEEP_G 0x80000
1035
1036 /* Unused; should be deleted? */
1037 #define BSF_WEAK 0x100000
1038 #define BSF_CTOR 0x200000
1039
1040 /* This symbol was created to point to a section, e.g. ELF's
1041 STT_SECTION symbols. */
1042 #define BSF_SECTION_SYM 0x400000
1043
1044 /* The symbol used to be a common symbol, but now it is
1045 allocated. */
1046 #define BSF_OLD_COMMON 0x800000
1047
1048 /* The default value for common data. */
1049 #define BFD_FORT_COMM_DEFAULT_VALUE 0
1050
1051 /* In some files the type of a symbol sometimes alters its
1052 location in an output file - ie in coff a <<ISFCN>> symbol
1053 which is also <<C_EXT>> symbol appears where it was
1054 declared and not at the end of a section. This bit is set
1055 by the target BFD part to convey this information. */
1056
1057 #define BSF_NOT_AT_END 0x40000
1058
1059 /* Signal that the symbol is the label of constructor section. */
1060 #define BSF_CONSTRUCTOR 0x1000000
1061
1062 /* Signal that the symbol is a warning symbol. If the symbol
1063 is a warning symbol, then the value field (I know this is
1064 tacky) will point to the asymbol which when referenced will
1065 cause the warning. */
1066 #define BSF_WARNING 0x2000000
1067
1068 /* Signal that the symbol is indirect. The value of the symbol
1069 is a pointer to an undefined asymbol which contains the
1070 name to use instead. */
1071 #define BSF_INDIRECT 0x4000000
1072
1073 /* BSF_FILE marks symbols that contain a file name. This is used
1074 for ELF STT_FILE symbols. */
1075 #define BSF_FILE 0x08000000
1076
1077 flagword flags;
1078
1079 /* A pointer to the section to which this symbol is
1080 relative. This will always be non NULL, there are special
1081 sections for undefined and absolute symbols */
1082 struct sec *section;
1083
1084 /* Back end special data. This is being phased out in favour
1085 of making this a union. */
1086 PTR udata;
1087
1088 /* Application data. */
1089 union { unsigned long aflags; PTR aptr; } app_data;
1090
1091 } asymbol;
1092 #define get_symtab_upper_bound(abfd) \
1093 BFD_SEND (abfd, _get_symtab_upper_bound, (abfd))
1094 #define bfd_canonicalize_symtab(abfd, location) \
1095 BFD_SEND (abfd, _bfd_canonicalize_symtab,\
1096 (abfd, location))
1097 boolean
1098 bfd_set_symtab PARAMS ((bfd *, asymbol **, unsigned int ));
1099
1100 void
1101 bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
1102
1103 #define bfd_make_empty_symbol(abfd) \
1104 BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
1105 #define bfd_make_debug_symbol(abfd,ptr,size) \
1106 BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
1107 int
1108 bfd_decode_symclass PARAMS ((asymbol *symbol));
1109
1110 struct _bfd
1111 {
1112 /* The filename the application opened the BFD with. */
1113 CONST char *filename;
1114
1115 /* A pointer to the target jump table. */
1116 struct bfd_target *xvec;
1117
1118 /* To avoid dragging too many header files into every file that
1119 includes `<<bfd.h>>', IOSTREAM has been declared as a "char
1120 *", and MTIME as a "long". Their correct types, to which they
1121 are cast when used, are "FILE *" and "time_t". The iostream
1122 is the result of an fopen on the filename. */
1123 char *iostream;
1124
1125 /* Is the file being cached */
1126
1127 boolean cacheable;
1128
1129 /* Marks whether there was a default target specified when the
1130 BFD was opened. This is used to select what matching algorithm
1131 to use to chose the back end. */
1132
1133 boolean target_defaulted;
1134
1135 /* The caching routines use these to maintain a
1136 least-recently-used list of BFDs */
1137
1138 struct _bfd *lru_prev, *lru_next;
1139
1140 /* When a file is closed by the caching routines, BFD retains
1141 state information on the file here:
1142 */
1143
1144 file_ptr where;
1145
1146 /* and here:*/
1147
1148 boolean opened_once;
1149
1150 /* Set if we have a locally maintained mtime value, rather than
1151 getting it from the file each time: */
1152
1153 boolean mtime_set;
1154
1155 /* File modified time, if mtime_set is true: */
1156
1157 long mtime;
1158
1159 /* Reserved for an unimplemented file locking extension.*/
1160
1161 int ifd;
1162
1163 /* The format which belongs to the BFD.*/
1164
1165 bfd_format format;
1166
1167 /* The direction the BFD was opened with*/
1168
1169 enum bfd_direction {no_direction = 0,
1170 read_direction = 1,
1171 write_direction = 2,
1172 both_direction = 3} direction;
1173
1174 /* Format_specific flags*/
1175
1176 flagword flags;
1177
1178 /* Currently my_archive is tested before adding origin to
1179 anything. I believe that this can become always an add of
1180 origin, with origin set to 0 for non archive files. */
1181
1182 file_ptr origin;
1183
1184 /* Remember when output has begun, to stop strange things
1185 happening. */
1186 boolean output_has_begun;
1187
1188 /* Pointer to linked list of sections*/
1189 struct sec *sections;
1190
1191 /* The number of sections */
1192 unsigned int section_count;
1193
1194 /* Stuff only useful for object files:
1195 The start address. */
1196 bfd_vma start_address;
1197
1198 /* Used for input and output*/
1199 unsigned int symcount;
1200
1201 /* Symbol table for output BFD*/
1202 struct symbol_cache_entry **outsymbols;
1203
1204 /* Pointer to structure which contains architecture information*/
1205 struct bfd_arch_info *arch_info;
1206
1207 /* Stuff only useful for archives:*/
1208 PTR arelt_data;
1209 struct _bfd *my_archive;
1210 struct _bfd *next;
1211 struct _bfd *archive_head;
1212 boolean has_armap;
1213
1214 /* Used by the back end to hold private data. */
1215
1216 union
1217 {
1218 struct aout_data_struct *aout_data;
1219 struct artdata *aout_ar_data;
1220 struct _oasys_data *oasys_obj_data;
1221 struct _oasys_ar_data *oasys_ar_data;
1222 struct coff_tdata *coff_obj_data;
1223 struct ieee_data_struct *ieee_data;
1224 struct ieee_ar_data_struct *ieee_ar_data;
1225 struct srec_data_struct *srec_data;
1226 struct srec_data_struct *tekhex_data;
1227 struct elf_obj_tdata *elf_obj_data;
1228 struct bout_data_struct *bout_data;
1229 struct sun_core_struct *sun_core_data;
1230 struct trad_core_struct *trad_core_data;
1231 struct hppa_data_struct *hppa_data;
1232 PTR any;
1233 } tdata;
1234
1235 /* Used by the application to hold private data*/
1236 PTR usrdata;
1237
1238 /* Where all the allocated stuff under this BFD goes */
1239 struct obstack memory;
1240
1241 /* Is this really needed in addition to usrdata? */
1242 asymbol **ld_symbols;
1243 };
1244
1245 unsigned int
1246 bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
1247
1248 unsigned int
1249 bfd_canonicalize_reloc
1250 PARAMS ((bfd *abfd,
1251 asection *sec,
1252 arelent **loc,
1253 asymbol **syms));
1254
1255 boolean
1256 bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
1257
1258 void
1259 bfd_set_reloc
1260 PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)
1261
1262 );
1263
1264 boolean
1265 bfd_set_start_address PARAMS ((bfd *, bfd_vma));
1266
1267 long
1268 bfd_get_mtime PARAMS ((bfd *));
1269
1270 #define bfd_sizeof_headers(abfd, reloc) \
1271 BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
1272
1273 #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
1274 BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
1275
1276 /* Do these three do anything useful at all, for any back end? */
1277 #define bfd_debug_info_start(abfd) \
1278 BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
1279
1280 #define bfd_debug_info_end(abfd) \
1281 BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
1282
1283 #define bfd_debug_info_accumulate(abfd, section) \
1284 BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
1285
1286
1287 #define bfd_stat_arch_elt(abfd, stat) \
1288 BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
1289
1290 #define bfd_set_arch_mach(abfd, arch, mach)\
1291 BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
1292
1293 #define bfd_get_relocated_section_contents(abfd, seclet, data) \
1294 BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data))
1295
1296 #define bfd_relax_section(abfd, section, symbols) \
1297 BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))
1298 symindex
1299 bfd_get_next_mapent PARAMS ((bfd *, symindex previous, carsym ** sym));
1300
1301 boolean
1302 bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
1303
1304 bfd *
1305 bfd_get_elt_at_index PARAMS ((bfd * archive, int index));
1306
1307 bfd*
1308 bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
1309
1310 CONST char *
1311 bfd_core_file_failing_command PARAMS ((bfd *));
1312
1313 int
1314 bfd_core_file_failing_signal PARAMS ((bfd *));
1315
1316 boolean
1317 core_file_matches_executable_p
1318 PARAMS ((bfd *core_bfd, bfd *exec_bfd));
1319
1320 #define BFD_SEND(bfd, message, arglist) \
1321 ((*((bfd)->xvec->message)) arglist)
1322 #define BFD_SEND_FMT(bfd, message, arglist) \
1323 (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
1324 typedef struct bfd_target
1325 {
1326 char *name;
1327 enum target_flavour {
1328 bfd_target_unknown_flavour,
1329 bfd_target_aout_flavour,
1330 bfd_target_coff_flavour,
1331 bfd_target_elf_flavour,
1332 bfd_target_ieee_flavour,
1333 bfd_target_oasys_flavour,
1334 bfd_target_tekhex_flavour,
1335 bfd_target_srec_flavour,
1336 bfd_target_hppa_flavour} flavour;
1337 boolean byteorder_big_p;
1338 boolean header_byteorder_big_p;
1339 flagword object_flags;
1340 flagword section_flags;
1341 char symbol_leading_char;
1342 char ar_pad_char;
1343 unsigned short ar_max_namelen;
1344 unsigned int align_power_min;
1345 bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
1346 void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
1347 bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
1348 void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
1349 bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
1350 void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
1351 bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
1352 void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
1353 bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
1354 void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
1355 bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
1356 void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
1357 struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
1358 boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
1359 boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
1360 char * (*_core_file_failing_command) PARAMS ((bfd *));
1361 int (*_core_file_failing_signal) PARAMS ((bfd *));
1362 boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
1363 boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
1364 boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
1365 void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
1366 boolean (*write_armap) PARAMS ((bfd *arch,
1367 unsigned int elength,
1368 struct orl *map,
1369 unsigned int orl_count,
1370 int stridx));
1371 boolean (*_close_and_cleanup) PARAMS ((bfd *));
1372 boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
1373 file_ptr, bfd_size_type));
1374 boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
1375 file_ptr, bfd_size_type));
1376 boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
1377 unsigned int (*_get_symtab_upper_bound) PARAMS ((bfd *));
1378 unsigned int (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
1379 struct symbol_cache_entry **));
1380 unsigned int (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
1381 unsigned int (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
1382 struct symbol_cache_entry **));
1383 struct symbol_cache_entry *
1384 (*_bfd_make_empty_symbol) PARAMS ((bfd *));
1385 void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
1386 struct symbol_cache_entry *,
1387 bfd_print_symbol_type));
1388 #define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
1389 alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
1390
1391 boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
1392 unsigned long));
1393
1394 bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
1395
1396 boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
1397 struct sec *section, struct symbol_cache_entry **symbols,
1398 bfd_vma offset, CONST char **file, CONST char **func,
1399 unsigned int *line));
1400
1401 int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
1402
1403 int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
1404
1405 void (*_bfd_debug_info_start) PARAMS ((bfd *));
1406 void (*_bfd_debug_info_end) PARAMS ((bfd *));
1407 void (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
1408
1409 bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
1410 struct bfd_seclet *, bfd_byte *data));
1411
1412 boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
1413 struct symbol_cache_entry **));
1414 /* See documentation on reloc types. */
1415 CONST struct reloc_howto_struct *
1416 (*reloc_type_lookup) PARAMS ((bfd *abfd,
1417 bfd_reloc_code_real_type code));
1418
1419 /* Back-door to allow format-aware applications to create debug symbols
1420 while using BFD for everything else. Currently used by the assembler
1421 when creating COFF files. */
1422 asymbol * (*_bfd_make_debug_symbol) PARAMS ((
1423 bfd *abfd,
1424 void *ptr,
1425 unsigned long size));
1426 PTR backend_data;
1427 } bfd_target;
1428 bfd_target *
1429 bfd_find_target PARAMS ((CONST char *, bfd *));
1430
1431 CONST char **
1432 bfd_target_list PARAMS ((void));
1433
1434 boolean
1435 bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
1436
1437 boolean
1438 bfd_set_format PARAMS ((bfd *, bfd_format));
1439
1440 CONST char *
1441 bfd_format_string PARAMS ((bfd_format));
1442
1443 #endif
This page took 0.072174 seconds and 4 git commands to generate.