📄 bfdint.texi
字号:
@samp{_bfd_noarchive}. Finally, a few targets have unusual archivehandling.@table @samp@item _slurp_armapRead in the archive symbol table, storing it in private BFD data. Thisis normally called from the archive @samp{check_format} routine. Thecorresponding field in the target vector is named@samp{_bfd_slurp_armap}.@item _slurp_extended_name_tableRead in the extended name table from the archive, if there is one,storing it in private BFD data. This is normally called from thearchive @samp{check_format} routine. The corresponding field in thetarget vector is named @samp{_bfd_slurp_extended_name_table}.@item construct_extended_name_tableBuild and return an extended name table if one is needed to write outthe archive. This also adjusts the archive headers to refer to theextended name table appropriately. This is normally called from thearchive @samp{write_contents} routine. The corresponding field in thetarget vector is named @samp{_bfd_construct_extended_name_table}.@item _truncate_arnameThis copies a file name into an archive header, truncating it asrequired. It is normally called from the archive @samp{write_contents}routine. This function is more interesting in targets which do notsupport extended name tables, but I think the GNU @samp{ar} programalways uses extended name tables anyhow. The corresponding field in thetarget vector is named @samp{_bfd_truncate_arname}.@item _write_armapWrite out the archive symbol table using calls to @samp{bfd_bwrite}.This is normally called from the archive @samp{write_contents} routine.The corresponding field in the target vector is named @samp{write_armap}(no leading underscore).@item _read_ar_hdrRead and parse an archive header. This handles expanding the archiveheader name into the real file name using the extended name table. Thisis called by routines which read the archive symbol table or the archiveitself. The corresponding field in the target vector is named@samp{_bfd_read_ar_hdr_fn}.@item _openr_next_archived_fileGiven an archive and a BFD representing a file stored within thearchive, return a BFD for the next file in the archive. This is calledvia @samp{bfd_openr_next_archived_file}. The corresponding field in thetarget vector is named @samp{openr_next_archived_file} (no leadingunderscore).@item _get_elt_at_indexGiven an archive and an index, return a BFD for the file in the archivecorresponding to that entry in the archive symbol table. This is calledvia @samp{bfd_get_elt_at_index}. The corresponding field in the targetvector is named @samp{_bfd_get_elt_at_index}.@item _generic_stat_arch_eltDo a stat on an element of an archive, returning information read fromthe archive header (modification time, uid, gid, file mode, size). Thisis called via @samp{bfd_stat_arch_elt}. The corresponding field in thetarget vector is named @samp{_bfd_stat_arch_elt}.@item _update_armap_timestampAfter the entire contents of an archive have been written out, updatethe timestamp of the archive symbol table to be newer than that of thefile. This is required for a.out style archives. This is normallycalled by the archive @samp{write_contents} routine. The correspondingfield in the target vector is named @samp{_bfd_update_armap_timestamp}.@end table@node BFD target vector symbols@subsection Symbol table functions@cindex @samp{BFD_JUMP_TABLE_SYMBOLS}The @samp{BFD_JUMP_TABLE_SYMBOLS} macro is used for functions which dealwith symbols.@table @samp@item _get_symtab_upper_boundReturn a sensible upper bound on the amount of memory which will berequired to read the symbol table. In practice most targets return theamount of memory required to hold @samp{asymbol} pointers for all thesymbols plus a trailing @samp{NULL} entry, and store the actual symbolinformation in BFD private data. This is called via@samp{bfd_get_symtab_upper_bound}. The corresponding field in thetarget vector is named @samp{_bfd_get_symtab_upper_bound}.@item _canonicalize_symtabRead in the symbol table. This is called via@samp{bfd_canonicalize_symtab}. The corresponding field in the targetvector is named @samp{_bfd_canonicalize_symtab}.@item _make_empty_symbolCreate an empty symbol for the BFD. This is needed because most targetsstore extra information with each symbol by allocating a structurelarger than an @samp{asymbol} and storing the extra information at theend. This function will allocate the right amount of memory, and returnwhat looks like a pointer to an empty @samp{asymbol}. This is calledvia @samp{bfd_make_empty_symbol}. The corresponding field in the targetvector is named @samp{_bfd_make_empty_symbol}.@item _print_symbolPrint information about the symbol. This is called via@samp{bfd_print_symbol}. One of the arguments indicates what sort ofinformation should be printed:@table @samp@item bfd_print_symbol_nameJust print the symbol name.@item bfd_print_symbol_morePrint the symbol name and some interesting flags. I don't thinkanything actually uses this.@item bfd_print_symbol_allPrint all information about the symbol. This is used by @samp{objdump}when run with the @samp{-t} option.@end tableThe corresponding field in the target vector is named@samp{_bfd_print_symbol}.@item _get_symbol_infoReturn a standard set of information about the symbol. This is calledvia @samp{bfd_symbol_info}. The corresponding field in the targetvector is named @samp{_bfd_get_symbol_info}.@item _bfd_is_local_label_nameReturn whether the given string would normally represent the name of alocal label. This is called via @samp{bfd_is_local_label} and@samp{bfd_is_local_label_name}. Local labels are normally discarded bythe assembler. In the linker, this defines the difference between the@samp{-x} and @samp{-X} options.@item _get_linenoReturn line number information for a symbol. This is only meaningfulfor a COFF target. This is called when writing out COFF line numbers.@item _find_nearest_lineGiven an address within a section, use the debugging information to findthe matching file name, function name, and line number, if any. This iscalled via @samp{bfd_find_nearest_line}. The corresponding field in thetarget vector is named @samp{_bfd_find_nearest_line}.@item _bfd_make_debug_symbolMake a debugging symbol. This is only meaningful for a COFF target,where it simply returns a symbol which will be placed in the@samp{N_DEBUG} section when it is written out. This is called via@samp{bfd_make_debug_symbol}.@item _read_minisymbolsMinisymbols are used to reduce the memory requirements of programs like@samp{nm}. A minisymbol is a cookie pointing to internal symbolinformation which the caller can use to extract complete symbolinformation. This permits BFD to not convert all the symbols intogeneric form, but to instead convert them one at a time. This is calledvia @samp{bfd_read_minisymbols}. Most targets do not implement this,and just use generic support which is based on using standard@samp{asymbol} structures.@item _minisymbol_to_symbolConvert a minisymbol to a standard @samp{asymbol}. This is called via@samp{bfd_minisymbol_to_symbol}.@end table@node BFD target vector relocs@subsection Relocation support@cindex @samp{BFD_JUMP_TABLE_RELOCS}The @samp{BFD_JUMP_TABLE_RELOCS} macro is used for functions which dealwith relocations.@table @samp@item _get_reloc_upper_boundReturn a sensible upper bound on the amount of memory which will berequired to read the relocations for a section. In practice mosttargets return the amount of memory required to hold @samp{arelent}pointers for all the relocations plus a trailing @samp{NULL} entry, andstore the actual relocation information in BFD private data. This iscalled via @samp{bfd_get_reloc_upper_bound}.@item _canonicalize_relocReturn the relocation information for a section. This is called via@samp{bfd_canonicalize_reloc}. The corresponding field in the targetvector is named @samp{_bfd_canonicalize_reloc}.@item _bfd_reloc_type_lookupGiven a relocation code, return the corresponding howto structure(@pxref{BFD relocation codes}). This is called via@samp{bfd_reloc_type_lookup}. The corresponding field in the targetvector is named @samp{reloc_type_lookup}.@end table@node BFD target vector write@subsection Output functions@cindex @samp{BFD_JUMP_TABLE_WRITE}The @samp{BFD_JUMP_TABLE_WRITE} macro is used for functions which dealwith writing out a BFD.@table @samp@item _set_arch_machSet the architecture and machine number for a BFD. This is called via@samp{bfd_set_arch_mach}. Most targets implement this by calling@samp{bfd_default_set_arch_mach}. The corresponding field in the targetvector is named @samp{_bfd_set_arch_mach}.@item _set_section_contentsWrite out the contents of a section. This is called via@samp{bfd_set_section_contents}. The corresponding field in the targetvector is named @samp{_bfd_set_section_contents}.@end table@node BFD target vector link@subsection Linker functions@cindex @samp{BFD_JUMP_TABLE_LINK}The @samp{BFD_JUMP_TABLE_LINK} macro is used for functions called by thelinker.@table @samp@item _sizeof_headersReturn the size of the header information required for a BFD. This isused to implement the @samp{SIZEOF_HEADERS} linker script function. Itis normally used to align the first section at an efficient position onthe page. This is called via @samp{bfd_sizeof_headers}. Thecorresponding field in the target vector is named@samp{_bfd_sizeof_headers}.@item _bfd_get_relocated_section_contentsRead the contents of a section and apply the relocation information.This handles both a final link and a relocatable link; in the lattercase, it adjust the relocation information as well. This is called via@samp{bfd_get_relocated_section_contents}. Most targets implement it bycalling @samp{bfd_generic_get_relocated_section_contents}.@item _bfd_relax_sectionTry to use relaxation to shrink the size of a section. This is calledby the linker when the @samp{-relax} option is used. This is called via@samp{bfd_relax_section}. Most targets do not support any sort ofrelaxation.@item _bfd_link_hash_table_createCreate the symbol hash table to use for the linker. This linker hookpermits the backend to control the size and information of the elementsin the linker symbol hash table. This is called via@samp{bfd_link_hash_table_create}.@item _bfd_link_add_symbolsGiven an object file or an archive, add all symbols into the linkersymbol hash table. Use callbacks to the linker to include archiveelements in the link. This is called via @samp{bfd_link_add_symbols}.@item _bfd_final_linkFinish the linking process. The linker calls this hook after all of theinput files have been read, when it is ready to finish the link andgenerate the output file. This is called via @samp{bfd_final_link}.@item _bfd_link_split_sectionI don't know what this is for. Nothing seems to call it. The onlynon-trivial definition is in @file{som.c}.@end table@node BFD target vector dynamic@subsection Dynamic linking information functions@cindex @samp{BFD_JUMP_TABLE_DYNAMIC}The @samp{BFD_JUMP_TABLE_DYNAMIC} macro is used for functions which readdynamic linking information.@table @samp@item _get_dynamic_symtab_upper_boundReturn a sensible upper bound on the amount of memory which will berequired to read the dynamic symbol table. In practice most targetsreturn the amount of memory required to hold @samp{asymbol} pointers forall the symbols plus a trailing @samp{NULL} entry, and store the actualsymbol information in BFD private data. This is called via@samp{bfd_get_dynamic_symtab_upper_bound}. The corresponding field inthe target vector is named @samp{_bfd_get_dynamic_symtab_upper_bound}.@item _canonicalize_dynamic_symtabRead the dynamic symbol table. This is called via@samp{bfd_canonicalize_dynamic_symtab}. The corresponding field in thetarget vector is named @samp{_bfd_canonicalize_dynamic_symtab}.@item _get_dynamic_reloc_upper_boundReturn a sensible upper bound on the amount of memory which will berequired to read the dynamic relocations. In practice most targetsreturn the amount of memory required to hold @samp{arelent} pointers forall the relocations plus a trailing @samp{NULL} entry, and store theactual relocation information in BFD private data. This is called via@samp{bfd_get_dynamic_reloc_upper_bound}. The corresponding field inthe target vector is named @samp{_bfd_get_dynamic_reloc_upper_bound}.@item _canonicalize_dynamic_relocRead the dynamic relocations. This is called via@samp{bfd_canonicalize_dynamic_reloc}. The corresponding field in thetarget vector is named @samp{_bfd_canonicalize_dynamic_reloc}.@end table@node BFD generated files@section BFD generated files@cindex generated files in bfd@cindex bfd generated filesBFD contains several automatically generated files. This section
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -