libcoff.h
来自「基于4个mips核的noc设计」· C头文件 代码 · 共 974 行 · 第 1/3 页
H
974 行
symbol_info *ret));extern boolean _bfd_coff_is_local_label_name PARAMS ((bfd *, const char *));extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, unsigned long));extern boolean coff_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma offset, CONST char **filename_ptr, CONST char **functionname_ptr, unsigned int *line_ptr));extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc));extern boolean bfd_coff_reloc16_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean relocateable, asymbol **));extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, struct bfd_link_info *, asection *));extern void bfd_perform_slip PARAMS ((bfd *abfd, unsigned int slip, asection *input_section, bfd_vma val));/* Functions and types in cofflink.c. */#define STRING_SIZE_SIZE (4)/* We use a hash table to merge identical enum, struct, and union definitions in the linker. *//* Information we keep for a single element (an enum value, a structure or union field) in the debug merge hash table. */struct coff_debug_merge_element{ /* Next element. */ struct coff_debug_merge_element *next; /* Name. */ const char *name; /* Type. */ unsigned int type; /* Symbol index for complex type. */ long tagndx;};/* A linked list of debug merge entries for a given name. */struct coff_debug_merge_type{ /* Next type with the same name. */ struct coff_debug_merge_type *next; /* Class of type. */ int class; /* Symbol index where this type is defined. */ long indx; /* List of elements. */ struct coff_debug_merge_element *elements;};/* Information we store in the debug merge hash table. */struct coff_debug_merge_hash_entry{ struct bfd_hash_entry root; /* A list of types with this name. */ struct coff_debug_merge_type *types;};/* The debug merge hash table. */struct coff_debug_merge_hash_table{ struct bfd_hash_table root;};/* Initialize a COFF debug merge hash table. */#define coff_debug_merge_hash_table_init(table) \ (bfd_hash_table_init (&(table)->root, _bfd_coff_debug_merge_hash_newfunc))/* Free a COFF debug merge hash table. */#define coff_debug_merge_hash_table_free(table) \ (bfd_hash_table_free (&(table)->root))/* Look up an entry in a COFF debug merge hash table. */#define coff_debug_merge_hash_lookup(table, string, create, copy) \ ((struct coff_debug_merge_hash_entry *) \ bfd_hash_lookup (&(table)->root, (string), (create), (copy)))/* Information we keep for each section in the output file when doing a relocateable link. */struct coff_link_section_info{ /* The relocs to be output. */ struct internal_reloc *relocs; /* For each reloc against a global symbol whose index was not known when the reloc was handled, the global hash table entry. */ struct coff_link_hash_entry **rel_hashes;};/* Information that we pass around while doing the final link step. */struct coff_final_link_info{ /* General link information. */ struct bfd_link_info *info; /* Output BFD. */ bfd *output_bfd; /* Used to indicate failure in traversal routine. */ boolean failed; /* If doing "task linking" set only during the time when we want the global symbol writer to convert the storage class of defined global symbols from global to static. */ boolean global_to_static; /* Hash table for long symbol names. */ struct bfd_strtab_hash *strtab; /* When doing a relocateable link, an array of information kept for each output section, indexed by the target_index field. */ struct coff_link_section_info *section_info; /* Symbol index of last C_FILE symbol (-1 if none). */ long last_file_index; /* Contents of last C_FILE symbol. */ struct internal_syment last_file; /* Symbol index of first aux entry of last .bf symbol with an empty endndx field (-1 if none). */ long last_bf_index; /* Contents of last_bf_index aux entry. */ union internal_auxent last_bf; /* Hash table used to merge debug information. */ struct coff_debug_merge_hash_table debug_merge; /* Buffer large enough to hold swapped symbols of any input file. */ struct internal_syment *internal_syms; /* Buffer large enough to hold sections of symbols of any input file. */ asection **sec_ptrs; /* Buffer large enough to hold output indices of symbols of any input file. */ long *sym_indices; /* Buffer large enough to hold output symbols for any input file. */ bfd_byte *outsyms; /* Buffer large enough to hold external line numbers for any input section. */ bfd_byte *linenos; /* Buffer large enough to hold any input section. */ bfd_byte *contents; /* Buffer large enough to hold external relocs of any input section. */ bfd_byte *external_relocs; /* Buffer large enough to hold swapped relocs of any input section. */ struct internal_reloc *internal_relocs;};/* Most COFF variants have no way to record the alignment of a section. This struct is used to set a specific alignment based on the name of the section. */struct coff_section_alignment_entry{ /* The section name. */ const char *name; /* This is either (unsigned int) -1, indicating that the section name must match exactly, or it is the number of letters which must match at the start of the name. */ unsigned int comparison_length; /* These macros may be used to fill in the first two fields in a structure initialization. */#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1) /* Only use this entry if the default section alignment for this target is at least that much (as a power of two). If this field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */ unsigned int default_alignment_min; /* Only use this entry if the default section alignment for this target is no greater than this (as a power of two). If this field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */ unsigned int default_alignment_max;#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1) /* The desired alignment for this section (as a power of two). */ unsigned int alignment_power;};extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));extern boolean _bfd_coff_link_hash_table_init PARAMS ((struct coff_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)));extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create PARAMS ((bfd *));extern const char *_bfd_coff_internal_syment_name PARAMS ((bfd *, const struct internal_syment *, char *));extern boolean _bfd_coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));extern boolean _bfd_coff_final_link PARAMS ((bfd *, struct bfd_link_info *));extern struct internal_reloc *_bfd_coff_read_internal_relocs PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean, struct internal_reloc *));extern boolean _bfd_coff_generic_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **));extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));extern boolean _bfd_coff_write_global_sym PARAMS ((struct coff_link_hash_entry *, PTR));extern boolean _bfd_coff_write_task_globals PARAMS ((struct coff_link_hash_entry *, PTR));extern boolean _bfd_coff_link_input_bfd PARAMS ((struct coff_final_link_info *, bfd *));extern boolean _bfd_coff_reloc_link_order PARAMS ((bfd *, struct coff_final_link_info *, asection *, struct bfd_link_order *));#define coff_get_section_contents_in_window \ _bfd_generic_get_section_contents_in_window/* Functions in xcofflink.c. */extern long _bfd_xcoff_get_dynamic_symtab_upper_bound PARAMS ((bfd *));extern long _bfd_xcoff_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **));extern long _bfd_xcoff_get_dynamic_reloc_upper_bound PARAMS ((bfd *));extern long _bfd_xcoff_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **));extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create PARAMS ((bfd *));extern boolean _bfd_xcoff_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));extern boolean _bfd_xcoff_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));extern boolean _bfd_ppc_xcoff_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **));/* Functions in coff-ppc.c. FIXME: These are called be pe.em in the linker, and so should start with bfd and be declared in bfd.h. */extern boolean ppc_allocate_toc_section PARAMS ((struct bfd_link_info *));extern boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *));/* And more taken from the source .. */typedef struct coff_ptr_struct{ /* Remembers the offset from the first symbol in the file for this symbol. Generated by coff_renumber_symbols. */unsigned int offset; /* Should the value of this symbol be renumbered. Used for XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */unsigned int fix_value : 1; /* Should the tag field of this symbol be renumbered. Created by coff_pointerize_aux. */unsigned int fix_tag : 1; /* Should the endidx field of this symbol be renumbered. Created by coff_pointerize_aux. */unsigned int fix_end : 1; /* Should the x_csect.x_scnlen field be renumbered. Created by coff_pointerize_aux. */unsigned int fix_scnlen : 1; /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the index into the line number entries. Set by coff_slurp_symbol_table. */unsigned int fix_line : 1; /* The container for the symbol structure as read and translated from the file. */union { union internal_auxent auxent; struct internal_syment syment; } u;} combined_entry_type;/* Each canonical asymbol really looks like this: */typedef struct coff_symbol_struct{ /* The actual symbol which the rest of BFD works with */asymbol symbol; /* A pointer to the hidden information for this symbol */combined_entry_type *native; /* A pointer to the linenumber information for this symbol */struct lineno_cache_entry *lineno; /* Have the line numbers been relocated yet ? */boolean done_lineno;} coff_symbol_type;/* COFF symbol classifications. */enum coff_symbol_classification{ /* Global symbol. */ COFF_SYMBOL_GLOBAL, /* Common symbol. */ COFF_SYMBOL_COMMON, /* Undefined symbol. */ COFF_SYMBOL_UNDEFINED,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?