📄 bfd.h
字号:
/* The caching routines use these to maintain a least-recently-used list of BFDs */ struct _bfd *lru_prev, *lru_next; /* When a file is closed by the caching routines, BFD retains state information on the file here: */ file_ptr where; /* and here:*/ boolean opened_once; /* Set if we have a locally maintained mtime value, rather than getting it from the file each time: */ boolean mtime_set; /* File modified time, if mtime_set is true: */ long mtime; /* Reserved for an unimplemented file locking extension.*/ int ifd; /* The format which belongs to the BFD.*/ bfd_format format; /* The direction the BFD was opened with*/ enum bfd_direction {no_direction = 0, read_direction = 1, write_direction = 2, both_direction = 3} direction; /* Format_specific flags*/ flagword flags; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ file_ptr origin; /* Remember when output has begun, to stop strange things happening. */ boolean output_has_begun; /* Pointer to linked list of sections*/ struct sec *sections; /* The number of sections */ unsigned int section_count; /* Stuff only useful for object files: The start address. */ bfd_vma start_address; /* Used for input and output*/ unsigned int symcount; /* Symbol table for output BFD*/ struct symbol_cache_entry **outsymbols; /* Pointer to structure which contains architecture information*/ struct bfd_arch_info *arch_info; /* Stuff only useful for archives:*/ PTR arelt_data; struct _bfd *my_archive; struct _bfd *next; struct _bfd *archive_head; boolean has_armap; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; struct _oasys_data *oasys_obj_data; struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct ieee_data_struct *ieee_data; struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct srec_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; struct bout_data_struct *bout_data; struct sun_core_struct *sun_core_data; struct bsd_core_struct *bsd_core_data; struct trad_core_struct *trad_core_data; struct hppa_data_struct *hppa_data; PTR any; } tdata; /* Used by the application to hold private data*/ PTR usrdata; /* Where all the allocated stuff under this BFD goes */ struct obstack memory; /* Is this really needed in addition to usrdata? */ asymbol **ld_symbols;};unsigned int EXFUN(bfd_get_reloc_upper_bound, (bfd *abfd, asection *sect));unsigned int EXFUN(bfd_canonicalize_reloc , (bfd *abfd, asection *sec, arelent **loc, asymbol **syms));boolean EXFUN(bfd_set_file_flags, (bfd *abfd, flagword flags));void EXFUN(bfd_set_reloc , (bfd *abfd, asection *sec, arelent **rel, unsigned int count) );boolean EXFUN(bfd_set_start_address, (bfd *, bfd_vma));long EXFUN(bfd_get_mtime, (bfd *));#define bfd_sizeof_headers(abfd, reloc) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) /* Do these three do anything useful at all, for any back end? */#define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd))#define bfd_debug_info_end(abfd) \ BFD_SEND (abfd, _bfd_debug_info_end, (abfd))#define bfd_debug_info_accumulate(abfd, section) \ BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))#define bfd_stat_arch_elt(abfd, stat) \ BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))#define bfd_coff_swap_aux_in(a,e,t,c,i) \ BFD_SEND (a, _bfd_coff_swap_aux_in, (a,e,t,c,i))#define bfd_coff_swap_sym_in(a,e,i) \ BFD_SEND (a, _bfd_coff_swap_sym_in, (a,e,i))#define bfd_coff_swap_lineno_in(a,e,i) \ BFD_SEND ( a, _bfd_coff_swap_lineno_in, (a,e,i))#define bfd_set_arch_mach(abfd, arch, mach)\ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))#define bfd_coff_swap_reloc_out(abfd, i, o) \ BFD_SEND (abfd, _bfd_coff_swap_reloc_out, (abfd, i, o))#define bfd_coff_swap_lineno_out(abfd, i, o) \ BFD_SEND (abfd, _bfd_coff_swap_lineno_out, (abfd, i, o))#define bfd_coff_swap_aux_out(abfd, i, t,c,o) \ BFD_SEND (abfd, _bfd_coff_swap_aux_out, (abfd, i,t,c, o))#define bfd_coff_swap_sym_out(abfd, i,o) \ BFD_SEND (abfd, _bfd_coff_swap_sym_out, (abfd, i, o))#define bfd_coff_swap_scnhdr_out(abfd, i,o) \ BFD_SEND (abfd, _bfd_coff_swap_scnhdr_out, (abfd, i, o))#define bfd_coff_swap_filehdr_out(abfd, i,o) \ BFD_SEND (abfd, _bfd_coff_swap_filehdr_out, (abfd, i, o))#define bfd_coff_swap_aouthdr_out(abfd, i,o) \ BFD_SEND (abfd, _bfd_coff_swap_aouthdr_out, (abfd, i, o))#define bfd_get_relocated_section_contents(abfd, seclet, data) \ BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data)) #define bfd_relax_section(abfd, section, symbols) \ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))symindex EXFUN(bfd_get_next_mapent, (bfd *, symindex previous, carsym ** sym));boolean EXFUN(bfd_set_archive_head, (bfd *output, bfd *new_head));bfd *EXFUN(bfd_get_elt_at_index, (bfd * archive, int index));bfd* EXFUN(bfd_openr_next_archived_file, (bfd *archive, bfd *previous));CONST char *EXFUN(bfd_core_file_failing_command, (bfd *));int EXFUN(bfd_core_file_failing_signal, (bfd *));boolean EXFUN(core_file_matches_executable_p , (bfd *core_bfd, bfd *exec_bfd));#define SDEF(ret, name, arglist) \ PROTO(ret,(*name),arglist)#define SDEF_FMT(ret, name, arglist) \ PROTO(ret,(*name[bfd_type_end]),arglist)#define BFD_SEND(bfd, message, arglist) \ ((*((bfd)->xvec->message)) arglist)#define BFD_SEND_FMT(bfd, message, arglist) \ (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)typedef struct bfd_target{ char *name; enum target_flavour { bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_elf_flavour, bfd_target_ieee_flavour, bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_hppa_flavour} flavour; boolean byteorder_big_p; boolean header_byteorder_big_p; flagword object_flags; flagword section_flags; char symbol_leading_char; char ar_pad_char; unsigned short ar_max_namelen; unsigned int align_power_min; SDEF (bfd_vma, bfd_getx64, (bfd_byte *)); SDEF (void, bfd_putx64, (bfd_vma, bfd_byte *)); SDEF (bfd_vma, bfd_getx32, (bfd_byte *)); SDEF (void, bfd_putx32, (bfd_vma, bfd_byte *)); SDEF (bfd_vma, bfd_getx16, (bfd_byte *)); SDEF (void, bfd_putx16, (bfd_vma, bfd_byte *)); SDEF (bfd_vma, bfd_h_getx64, (bfd_byte *)); SDEF (void, bfd_h_putx64, (bfd_vma, bfd_byte *)); SDEF (bfd_vma, bfd_h_getx32, (bfd_byte *)); SDEF (void, bfd_h_putx32, (bfd_vma, bfd_byte *)); SDEF (bfd_vma, bfd_h_getx16, (bfd_byte *)); SDEF (void, bfd_h_putx16, (bfd_vma, bfd_byte *)); SDEF_FMT (struct bfd_target *, _bfd_check_format, (bfd *)); SDEF_FMT (boolean, _bfd_set_format, (bfd *)); SDEF_FMT (boolean, _bfd_write_contents, (bfd *)); SDEF (char *, _core_file_failing_command, (bfd *)); SDEF (int, _core_file_failing_signal, (bfd *)); SDEF (boolean, _core_file_matches_executable_p, (bfd *, bfd *)); SDEF (boolean, _bfd_slurp_armap, (bfd *)); SDEF (boolean, _bfd_slurp_extended_name_table, (bfd *)); SDEF (void, _bfd_truncate_arname, (bfd *, CONST char *, char *)); SDEF (boolean, write_armap, (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, int stridx)); SDEF (boolean, _close_and_cleanup, (bfd *)); SDEF (boolean, _bfd_set_section_contents, (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); SDEF (boolean, _bfd_get_section_contents, (bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); SDEF (boolean, _new_section_hook, (bfd *, sec_ptr)); SDEF (unsigned int, _get_symtab_upper_bound, (bfd *)); SDEF (unsigned int, _bfd_canonicalize_symtab, (bfd *, struct symbol_cache_entry **)); SDEF (unsigned int, _get_reloc_upper_bound, (bfd *, sec_ptr)); SDEF (unsigned int, _bfd_canonicalize_reloc, (bfd *, sec_ptr, arelent **, struct symbol_cache_entry**)); SDEF (struct symbol_cache_entry *, _bfd_make_empty_symbol, (bfd *)); SDEF (void, _bfd_print_symbol, (bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type));#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) SDEF (alent *, _get_lineno, (bfd *, struct symbol_cache_entry *)); SDEF (boolean, _bfd_set_arch_mach, (bfd *, enum bfd_architecture, unsigned long)); SDEF (bfd *, openr_next_archived_file, (bfd *arch, bfd *prev)); SDEF (boolean, _bfd_find_nearest_line, (bfd *abfd, struct sec *section, struct symbol_cache_entry **symbols,bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); SDEF (int, _bfd_stat_arch_elt, (bfd *, struct stat *)); SDEF (int, _bfd_sizeof_headers, (bfd *, boolean)); SDEF (void, _bfd_debug_info_start, (bfd *)); SDEF (void, _bfd_debug_info_end, (bfd *)); SDEF (void, _bfd_debug_info_accumulate, (bfd *, struct sec *)); SDEF (bfd_byte *, _bfd_get_relocated_section_contents, (bfd*,struct bfd_seclet_struct *, bfd_byte *data)); SDEF (boolean,_bfd_relax_section,(bfd *, struct sec *, struct symbol_cache_entry **)); SDEF(void, _bfd_coff_swap_aux_in,( bfd *abfd , PTR ext, int type, int class , PTR in)); SDEF(void, _bfd_coff_swap_sym_in,( bfd *abfd , PTR ext, PTR in)); SDEF(void, _bfd_coff_swap_lineno_in, ( bfd *abfd, PTR ext, PTR in)); SDEF(unsigned int, _bfd_coff_swap_aux_out,( bfd *abfd, PTR in, int type, int class, PTR ext)); SDEF(unsigned int, _bfd_coff_swap_sym_out,( bfd *abfd, PTR in, PTR ext)); SDEF(unsigned int, _bfd_coff_swap_lineno_out,( bfd *abfd, PTR in, PTR ext)); SDEF(unsigned int, _bfd_coff_swap_reloc_out,( bfd *abfd, PTR src, PTR dst)); SDEF(unsigned int, _bfd_coff_swap_filehdr_out,( bfd *abfd, PTR in, PTR out)); SDEF(unsigned int, _bfd_coff_swap_aouthdr_out,( bfd *abfd, PTR in, PTR out)); SDEF(unsigned int, _bfd_coff_swap_scnhdr_out,( bfd *abfd, PTR in, PTR out)); /* See documentation on reloc types. */ SDEF (CONST struct reloc_howto_struct *, reloc_type_lookup, (bfd *abfd, bfd_reloc_code_real_type code)); /* Complete and utter crock, currently used for the assembler when creating COFF files. */ SDEF (asymbol *, _bfd_make_debug_symbol, ( bfd *abfd, void *ptr, unsigned long size)); PTR backend_data;} bfd_target;bfd_target *EXFUN(bfd_find_target, (CONST char *, bfd *));CONST char **EXFUN(bfd_target_list, (void));boolean EXFUN(bfd_check_format, (bfd *abfd, bfd_format format));boolean EXFUN(bfd_set_format, (bfd *, bfd_format));CONST char *EXFUN(bfd_format_string, (bfd_format));#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -