libaout.h
来自「基于4个mips核的noc设计」· C头文件 代码 · 共 627 行 · 第 1/2 页
H
627 行
asection *bsssec; /* We remember these offsets so that after check_file_format, we have no dependencies on the particular format of the exec_hdr. */ file_ptr sym_filepos; file_ptr str_filepos; /* Size of a relocation entry in external form */ unsigned reloc_entry_size; /* Size of a symbol table entry in external form */ unsigned symbol_entry_size; /* Page size - needed for alignment of demand paged files. */ unsigned long page_size; /* Segment size - needed for alignment of demand paged files. */ unsigned long segment_size; /* Zmagic disk block size - need to align the start of the text section in ZMAGIC binaries. Normally the same as page_size. */ unsigned long zmagic_disk_block_size; unsigned exec_bytes_size; unsigned vma_adjusted : 1; /* used when a bfd supports several highly similar formats */ enum { default_format = 0, /* Used on HP 9000/300 running HP/UX. See hp300hpux.c. */ gnu_encap_format, /* Used on Linux, 386BSD, etc. See include/aout/aout64.h. */ q_magic_format } subformat; enum { undecided_magic = 0, z_magic, o_magic, n_magic } magic; /* A buffer for find_nearest_line. */ char *line_buf; /* The external symbol information. */ struct external_nlist *external_syms; bfd_size_type external_sym_count; bfd_window sym_window; char *external_strings; bfd_size_type external_string_size; bfd_window string_window; struct aout_link_hash_entry **sym_hashes; /* A pointer for shared library information. */ PTR dynamic_info; /* A mapping from local symbols to offsets into the global offset table, used when linking on SunOS. This is indexed by the symbol index. */ bfd_vma *local_got_offsets;};struct aout_data_struct { struct aoutdata a; struct internal_exec e;};#define adata(bfd) ((bfd)->tdata.aout_data->a)#define exec_hdr(bfd) (adata(bfd).hdr)#define obj_aout_symbols(bfd) (adata(bfd).symbols)#define obj_textsec(bfd) (adata(bfd).textsec)#define obj_datasec(bfd) (adata(bfd).datasec)#define obj_bsssec(bfd) (adata(bfd).bsssec)#define obj_sym_filepos(bfd) (adata(bfd).sym_filepos)#define obj_str_filepos(bfd) (adata(bfd).str_filepos)#define obj_reloc_entry_size(bfd) (adata(bfd).reloc_entry_size)#define obj_symbol_entry_size(bfd) (adata(bfd).symbol_entry_size)#define obj_aout_subformat(bfd) (adata(bfd).subformat)#define obj_aout_external_syms(bfd) (adata(bfd).external_syms)#define obj_aout_external_sym_count(bfd) (adata(bfd).external_sym_count)#define obj_aout_sym_window(bfd) (adata(bfd).sym_window)#define obj_aout_external_strings(bfd) (adata(bfd).external_strings)#define obj_aout_external_string_size(bfd) (adata(bfd).external_string_size)#define obj_aout_string_window(bfd) (adata(bfd).string_window)#define obj_aout_sym_hashes(bfd) (adata(bfd).sym_hashes)#define obj_aout_dynamic_info(bfd) (adata(bfd).dynamic_info)/* We take the address of the first element of an asymbol to ensure that the macro is only ever applied to an asymbol */#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))/* Information we keep for each a.out section. This is currently only used by the a.out backend linker. */struct aout_section_data_struct{ /* The unswapped relocation entries for this section. */ PTR relocs;};#define aout_section_data(s) \ ((struct aout_section_data_struct *) (s)->used_by_bfd)#define set_aout_section_data(s,v) \ ((s)->used_by_bfd = (PTR)&(v)->relocs)/* Prototype declarations for functions defined in aoutx.h */booleanNAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section));booleanNAME(aout,make_sections) PARAMS ((bfd *));const bfd_target *NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd, struct internal_exec *execp, const bfd_target *(*callback)(bfd *)));booleanNAME(aout,mkobject) PARAMS ((bfd *abfd));enum machine_typeNAME(aout,machine_type) PARAMS ((enum bfd_architecture arch, unsigned long machine, boolean *unknown));booleanNAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch, unsigned long machine));booleanNAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect));booleanNAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section, PTR location, file_ptr offset, bfd_size_type count));asymbol *NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd));booleanNAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type, char *, bfd_size_type, boolean dynamic));booleanNAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd));booleanNAME(aout,write_syms) PARAMS ((bfd *abfd));voidNAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd));longNAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd));longNAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location));voidNAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *, arelent *, asymbol **, bfd_size_type));voidNAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *, arelent *, asymbol **, bfd_size_type));reloc_howto_type *NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));booleanNAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect, asymbol **symbols));longNAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section, arelent **relptr, asymbol **symbols));longNAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect));voidNAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore));alent *NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol));voidNAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file, asymbol *symbol, bfd_print_symbol_type how));voidNAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd, asymbol *symbol, symbol_info *ret));booleanNAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section, asymbol **symbols, bfd_vma offset, CONST char **filename_ptr, CONST char **functionname_ptr, unsigned int *line_ptr));longNAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *));asymbol *NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *));intNAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec));booleanNAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd, bfd_size_type *text_size, file_ptr *text_end));voidNAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd, struct external_exec *raw_bytes, struct internal_exec *execp));voidNAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd, struct internal_exec *execp, struct external_exec *raw_bytes));struct bfd_hash_entry *NAME(aout,link_hash_newfunc) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));booleanNAME(aout,link_hash_table_init) PARAMS ((struct aout_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)));struct bfd_link_hash_table *NAME(aout,link_hash_table_create) PARAMS ((bfd *));booleanNAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));booleanNAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *, void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *)));booleanNAME(aout,bfd_free_cached_info) PARAMS ((bfd *));/* A.out uses the generic versions of these routines... */#define aout_32_get_section_contents _bfd_generic_get_section_contents#define aout_64_get_section_contents _bfd_generic_get_section_contents#ifndef NO_WRITE_HEADER_KLUDGE#define NO_WRITE_HEADER_KLUDGE 0#endif#ifndef aout_32_bfd_is_local_label_name#define aout_32_bfd_is_local_label_name bfd_generic_is_local_label_name#endif#ifndef WRITE_HEADERS#define WRITE_HEADERS(abfd, execp) \ { \ bfd_size_type text_size; /* dummy vars */ \ file_ptr text_end; \ if (adata(abfd).magic == undecided_magic) \ NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end); \ \ execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \ execp->a_entry = bfd_get_start_address (abfd); \ \ execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * \ obj_reloc_entry_size (abfd)); \ execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * \ obj_reloc_entry_size (abfd)); \ NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes); \ \ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false; \ if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd) \ != EXEC_BYTES_SIZE) \ return false; \ /* Now write out reloc info, followed by syms and strings */ \ \ if (bfd_get_outsymbols (abfd) != (asymbol **) NULL \ && bfd_get_symcount (abfd) != 0) \ { \ if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET) != 0) \ return false; \ \ if (! NAME(aout,write_syms)(abfd)) return false; \ } \ \ if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET) != 0) \ return false; \ if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \ return false; \ \ if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) != 0) \ return false; \ if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) \ return false; \ } #endif#endif /* ! defined (LIBAOUT_H) */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?