⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfdint.texi

📁 这个是LINUX下的GDB调度工具的源码
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@table @samp@item bfd_target_unknown_flavourUndefined or unknown.@item bfd_target_aout_flavoura.out.@item bfd_target_coff_flavourCOFF.@item bfd_target_ecoff_flavourECOFF.@item bfd_target_elf_flavourELF.@item bfd_target_ieee_flavourIEEE-695.@item bfd_target_nlm_flavourNLM.@item bfd_target_oasys_flavourOASYS.@item bfd_target_tekhex_flavourTektronix hex format.@item bfd_target_srec_flavourMotorola S-record format.@item bfd_target_ihex_flavourIntel hex format.@item bfd_target_som_flavourSOM (used on HP/UX).@item bfd_target_os9k_flavouros9000.@item bfd_target_versados_flavourVERSAdos.@item bfd_target_msdos_flavourMS-DOS.@item bfd_target_evax_flavouropenVMS.@item bfd_target_mmo_flavourDonald Knuth's MMIXware object format.@end table@item byteorderThe byte order of data in the object file.  One of@samp{BFD_ENDIAN_BIG}, @samp{BFD_ENDIAN_LITTLE}, or@samp{BFD_ENDIAN_UNKNOWN}.  The latter would be used for a format suchas S-records which do not record the architecture of the data.@item header_byteorderThe byte order of header information in the object file.  Normally thesame as the @samp{byteorder} field, but there are certain cases where itmay be different.@item object_flagsFlags which may appear in the @samp{flags} field of a BFD with thisformat.@item section_flagsFlags which may appear in the @samp{flags} field of a section within aBFD with this format.@item symbol_leading_charA character which the C compiler normally puts before a symbol.  Forexample, an a.out compiler will typically generate the symbol@samp{_foo} for a function named @samp{foo} in the C source, in whichcase this field would be @samp{_}.  If there is no such character, thisfield will be @samp{0}.@item ar_pad_charThe padding character to use at the end of an archive name.  Normally@samp{/}.@item ar_max_namelenThe maximum length of a short name in an archive.  Normally @samp{14}.@item backend_dataA pointer to constant backend data.  This is used by backends to storewhatever additional information they need to distinguish similar targetvectors which use the same sets of functions.@end table@node BFD target vector swap@subsection Swapping functionsEvery target vector has function pointers used for swapping informationin and out of the target representation.  There are two sets offunctions: one for data information, and one for header information.Each set has three sizes: 64-bit, 32-bit, and 16-bit.  Each size hasthree actual functions: put, get unsigned, and get signed.These 18 functions are used to convert data between the host and targetrepresentations.@node BFD target vector format@subsection Format type dependent functionsEvery target vector has three arrays of function pointers which areindexed by the BFD format type.  The BFD format types are as follows:@table @samp@item bfd_unknownUnknown format.  Not used for anything useful.@item bfd_objectObject file.@item bfd_archiveArchive file.@item bfd_coreCore file.@end tableThe three arrays of function pointers are as follows:@table @samp@item bfd_check_formatCheck whether the BFD is of a particular format (object file, archivefile, or core file) corresponding to this target vector.  This is calledby the @samp{bfd_check_format} function when examining an existing BFD.If the BFD matches the desired format, this function will initialize anyformat specific information such as the @samp{tdata} field of the BFD.This function must be called before any other BFD target vector functionon a file opened for reading.@item bfd_set_formatSet the format of a BFD which was created for output.  This is called bythe @samp{bfd_set_format} function after creating the BFD with afunction such as @samp{bfd_openw}.  This function will initialize formatspecific information required to write out an object file or whatever ofthe given format.  This function must be called before any other BFDtarget vector function on a file opened for writing.@item bfd_write_contentsWrite out the contents of the BFD in the given format.  This is calledby @samp{bfd_close} function for a BFD opened for writing.  This reallyshould not be an array selected by format type, as the@samp{bfd_set_format} function provides all the required information.In fact, BFD will fail if a different format is used when callingthrough the @samp{bfd_set_format} and the @samp{bfd_write_contents}arrays; fortunately, since @samp{bfd_close} gets it right, this is adifficult error to make.@end table@node BFD_JUMP_TABLE macros@subsection @samp{BFD_JUMP_TABLE} macros@cindex @samp{BFD_JUMP_TABLE}Most target vectors are defined using @samp{BFD_JUMP_TABLE} macros.These macros take a single argument, which is a prefix applied to a setof functions.  The macros are then used to initialize the fields in thetarget vector.For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines threefunctions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc},and @samp{_bfd_reloc_type_lookup}.  A reference like@samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functionsprefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc.  The@samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those threefunctions initialize the appropriate fields in the BFD target vector.This is done because it turns out that many different target vectors canshare certain classes of functions.  For example, archives are similaron most platforms, so most target vectors can use the same archivefunctions.  Those target vectors all use @samp{BFD_JUMP_TABLE_ARCHIVE}with the same argument, calling a set of functions which is defined in@file{archive.c}.Each of the @samp{BFD_JUMP_TABLE} macros is mentioned below along withthe description of the function pointers which it defines.  The functionpointers will be described using the name without the prefix which the@samp{BFD_JUMP_TABLE} macro defines.  This name is normally the same asthe name of the field in the target vector structure.  Any differenceswill be noted.@node BFD target vector generic@subsection Generic functions@cindex @samp{BFD_JUMP_TABLE_GENERIC}The @samp{BFD_JUMP_TABLE_GENERIC} macro is used for some catch allfunctions which don't easily fit into other categories.@table @samp@item _close_and_cleanupFree any target specific information associated with the BFD.  This iscalled when any BFD is closed (the @samp{bfd_write_contents} functionmentioned earlier is only called for a BFD opened for writing).  Mosttargets use @samp{bfd_alloc} to allocate all target specificinformation, and therefore don't have to do anything in this function.This function pointer is typically set to@samp{_bfd_generic_close_and_cleanup}, which simply returns true.@item _bfd_free_cached_infoFree any cached information associated with the BFD which can berecreated later if necessary.  This is used to reduce the memoryconsumption required by programs using BFD.  This is normally called viathe @samp{bfd_free_cached_info} macro.  It is used by the defaultarchive routines when computing the archive map.  Most targets do notdo anything special for this entry point, and just set it to@samp{_bfd_generic_free_cached_info}, which simply returns true.@item _new_section_hookThis is called from @samp{bfd_make_section_anyway} whenever a newsection is created.  Most targets use it to initialize section specificinformation.  This function is called whether or not the sectioncorresponds to an actual section in an actual BFD.@item _get_section_contentsGet the contents of a section.  This is called from@samp{bfd_get_section_contents}.  Most targets set this to@samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek}based on the section's @samp{filepos} field and a @samp{bfd_bread}.  Thecorresponding field in the target vector is named@samp{_bfd_get_section_contents}.@item _get_section_contents_in_windowSet a @samp{bfd_window} to hold the contents of a section.  This iscalled from @samp{bfd_get_section_contents_in_window}.  The@samp{bfd_window} idea never really caught on, and I don't think this isever called.  Pretty much all targets implement this as@samp{bfd_generic_get_section_contents_in_window}, which uses@samp{bfd_get_section_contents} to do the right thing.  Thecorresponding field in the target vector is named@samp{_bfd_get_section_contents_in_window}.@end table@node BFD target vector copy@subsection Copy functions@cindex @samp{BFD_JUMP_TABLE_COPY}The @samp{BFD_JUMP_TABLE_COPY} macro is used for functions which arecalled when copying BFDs, and for a couple of functions which deal withinternal BFD information.@table @samp@item _bfd_copy_private_bfd_dataThis is called when copying a BFD, via @samp{bfd_copy_private_bfd_data}.If the input and output BFDs have the same format, this will copy anyprivate information over.  This is called after all the section contentshave been written to the output file.  Only a few targets do anything inthis function.@item _bfd_merge_private_bfd_dataThis is called when linking, via @samp{bfd_merge_private_bfd_data}.  Itgives the backend linker code a chance to set any special flags in theoutput file based on the contents of the input file.  Only a few targetsdo anything in this function.@item _bfd_copy_private_section_dataThis is similar to @samp{_bfd_copy_private_bfd_data}, but it is calledfor each section, via @samp{bfd_copy_private_section_data}.  Thisfunction is called before any section contents have been written.  Onlya few targets do anything in this function.@item _bfd_copy_private_symbol_dataThis is called via @samp{bfd_copy_private_symbol_data}, but I don'tthink anything actually calls it.  If it were defined, it could be usedto copy private symbol data from one BFD to another.  However, most BFDsstore extra symbol information by allocating space which is larger thanthe @samp{asymbol} structure and storing private information in theextra space.  Since @samp{objcopy} and other programs copy symbolinformation by copying pointers to @samp{asymbol} structures, theprivate symbol information is automatically copied as well.  Mosttargets do not do anything in this function.@item _bfd_set_private_flagsThis is called via @samp{bfd_set_private_flags}.  It is basically a hookfor the assembler to set magic information.  For example, the PowerPCELF assembler uses it to set flags which appear in the e_flags field ofthe ELF header.  Most targets do not do anything in this function.@item _bfd_print_private_bfd_dataThis is called by @samp{objdump} when the @samp{-p} option is used.  Itis called via @samp{bfd_print_private_data}.  It prints any interestinginformation about the BFD which can not be otherwise represented by BFDand thus can not be printed by @samp{objdump}.  Most targets do not doanything in this function.@end table@node BFD target vector core@subsection Core file support functions@cindex @samp{BFD_JUMP_TABLE_CORE}The @samp{BFD_JUMP_TABLE_CORE} macro is used for functions which dealwith core files.  Obviously, these functions only do somethinginteresting for targets which have core file support.@table @samp@item _core_file_failing_commandGiven a core file, this returns the command which was run to produce thecore file.@item _core_file_failing_signalGiven a core file, this returns the signal number which produced thecore file.@item _core_file_matches_executable_pGiven a core file and a BFD for an executable, this returns whether thecore file was generated by the executable.@end table@node BFD target vector archive@subsection Archive functions@cindex @samp{BFD_JUMP_TABLE_ARCHIVE}The @samp{BFD_JUMP_TABLE_ARCHIVE} macro is used for functions which dealwith archive files.  Most targets use COFF style archive files(including ELF targets), and these use @samp{_bfd_archive_coff} as theargument to @samp{BFD_JUMP_TABLE_ARCHIVE}.  Some targets use BSD/a.outstyle archives, and these use @samp{_bfd_archive_bsd}.  (The maindifference between BSD and COFF archives is the format of the archivesymbol table).  Targets with no archive support use

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -