Lines Matching refs:samp

121 programs like @samp{gdb}, @samp{nm}, @samp{objdump}, and @samp{objcopy}.
126 programs like @samp{gas} and @samp{objcopy}. These programs use BFD to
132 are used by @samp{objcopy} to avoid information loss.
135 linker, @samp{ld}. Originally, @samp{ld} was an object file reader and
160 BFD describes a file as a pointer to the @samp{bfd} type. A @samp{bfd}
162 displayed using the @samp{objdump} program with various options.
176 BFD represents a section as a pointer to the @samp{asection} type. Each
183 BFD represents a relocation as a pointer to the @samp{arelent} type. A
189 BFD represents a symbol as a pointer to the @samp{asymbol} type. A
195 @samp{bfd}s. BFD also provides access to the archive symbol map, as a
196 list of symbol names. BFD provides a function to return the @samp{bfd}
256 and they should be explicitly marked with @samp{const}. Instead of global
261 @samp{bfd_}. All such functions should be declared in some header file,
269 @samp{_bfd_}. Although external names beginning with @samp{_} are
274 Always remember that people can compile using @samp{--enable-targets} to
279 BFD code should compile with few or no warnings using @samp{gcc -Wall}.
318 @table @samp
322 use BFD, such as the @samp{--oformat} linker option.
328 @table @samp
363 @samp{BFD_ENDIAN_BIG}, @samp{BFD_ENDIAN_LITTLE}, or
364 @samp{BFD_ENDIAN_UNKNOWN}. The latter would be used for a format such
369 same as the @samp{byteorder} field, but there are certain cases where it
373 Flags which may appear in the @samp{flags} field of a BFD with this
377 Flags which may appear in the @samp{flags} field of a section within a
383 @samp{_foo} for a function named @samp{foo} in the C source, in which
384 case this field would be @samp{_}. If there is no such character, this
385 field will be @samp{0}.
389 @samp{/}.
392 The maximum length of a short name in an archive. Normally @samp{14}.
418 @table @samp
431 @table @samp
435 by the @samp{bfd_check_format} function when examining an existing BFD.
437 format specific information such as the @samp{tdata} field of the BFD.
443 the @samp{bfd_set_format} function after creating the BFD with a
444 function such as @samp{bfd_openw}. This function will initialize format
451 by @samp{bfd_close} function for a BFD opened for writing. This really
453 @samp{bfd_set_format} function provides all the required information.
455 through the @samp{bfd_set_format} and the @samp{bfd_write_contents}
456 arrays; fortunately, since @samp{bfd_close} gets it right, this is a
461 @subsection @samp{BFD_JUMP_TABLE} macros
462 @cindex @samp{BFD_JUMP_TABLE}
464 Most target vectors are defined using @samp{BFD_JUMP_TABLE} macros.
469 For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines three
470 functions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc},
471 and @samp{_bfd_reloc_type_lookup}. A reference like
472 @samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functions
473 prefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc. The
474 @samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those three
480 functions. Those target vectors all use @samp{BFD_JUMP_TABLE_ARCHIVE}
484 Each of the @samp{BFD_JUMP_TABLE} macros is mentioned below along with
487 @samp{BFD_JUMP_TABLE} macro defines. This name is normally the same as
493 @cindex @samp{BFD_JUMP_TABLE_GENERIC}
495 The @samp{BFD_JUMP_TABLE_GENERIC} macro is used for some catch all
498 @table @samp
501 called when any BFD is closed (the @samp{bfd_write_contents} function
503 targets use @samp{bfd_alloc} to allocate all target specific
506 @samp{_bfd_generic_close_and_cleanup}, which simply returns true.
512 the @samp{bfd_free_cached_info} macro. It is used by the default
515 @samp{_bfd_generic_free_cached_info}, which simply returns true.
518 This is called from @samp{bfd_make_section_anyway} whenever a new
525 @samp{bfd_get_section_contents}. Most targets set this to
526 @samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek}
527 based on the section's @samp{filepos} field and a @samp{bfd_bread}. The
529 @samp{_bfd_get_section_contents}.
532 Set a @samp{bfd_window} to hold the contents of a section. This is
533 called from @samp{bfd_get_section_contents_in_window}. The
534 @samp{bfd_window} idea never really caught on, and I don't think this is
536 @samp{bfd_generic_get_section_contents_in_window}, which uses
537 @samp{bfd_get_section_contents} to do the right thing. The
539 @samp{_bfd_get_section_contents_in_window}.
544 @cindex @samp{BFD_JUMP_TABLE_COPY}
546 The @samp{BFD_JUMP_TABLE_COPY} macro is used for functions which are
550 @table @samp
552 This is called when copying a BFD, via @samp{bfd_copy_private_bfd_data}.
559 This is called when linking, via @samp{bfd_merge_private_bfd_data}. It
565 This is similar to @samp{_bfd_copy_private_bfd_data}, but it is called
566 for each section, via @samp{bfd_copy_private_section_data}. This
571 This is called via @samp{bfd_copy_private_symbol_data}, but I don't
575 the @samp{asymbol} structure and storing private information in the
576 extra space. Since @samp{objcopy} and other programs copy symbol
577 information by copying pointers to @samp{asymbol} structures, the
582 This is called via @samp{bfd_set_private_flags}. It is basically a hook
588 This is called by @samp{objdump} when the @samp{-p} option is used. It
589 is called via @samp{bfd_print_private_data}. It prints any interesting
591 and thus can not be printed by @samp{objdump}. Most targets do not do
597 @cindex @samp{BFD_JUMP_TABLE_CORE}
599 The @samp{BFD_JUMP_TABLE_CORE} macro is used for functions which deal
603 @table @samp
619 @cindex @samp{BFD_JUMP_TABLE_ARCHIVE}
621 The @samp{BFD_JUMP_TABLE_ARCHIVE} macro is used for functions which deal
623 (including ELF targets), and these use @samp{_bfd_archive_coff} as the
624 argument to @samp{BFD_JUMP_TABLE_ARCHIVE}. Some targets use BSD/a.out
625 style archives, and these use @samp{_bfd_archive_bsd}. (The main
628 @samp{_bfd_noarchive}. Finally, a few targets have unusual archive
631 @table @samp
634 is normally called from the archive @samp{check_format} routine. The
636 @samp{_bfd_slurp_armap}.
641 archive @samp{check_format} routine. The corresponding field in the
642 target vector is named @samp{_bfd_slurp_extended_name_table}.
648 archive @samp{write_contents} routine. The corresponding field in the
649 target vector is named @samp{_bfd_construct_extended_name_table}.
653 required. It is normally called from the archive @samp{write_contents}
655 support extended name tables, but I think the GNU @samp{ar} program
657 target vector is named @samp{_bfd_truncate_arname}.
660 Write out the archive symbol table using calls to @samp{bfd_bwrite}.
661 This is normally called from the archive @samp{write_contents} routine.
662 The corresponding field in the target vector is named @samp{write_armap}
670 @samp{_bfd_read_ar_hdr_fn}.
675 via @samp{bfd_openr_next_archived_file}. The corresponding field in the
676 target vector is named @samp{openr_next_archived_file} (no leading
682 via @samp{bfd_get_elt_at_index}. The corresponding field in the target
683 vector is named @samp{_bfd_get_elt_at_index}.
688 is called via @samp{bfd_stat_arch_elt}. The corresponding field in the
689 target vector is named @samp{_bfd_stat_arch_elt}.
695 called by the archive @samp{write_contents} routine. The corresponding
696 field in the target vector is named @samp{_bfd_update_armap_timestamp}.
701 @cindex @samp{BFD_JUMP_TABLE_SYMBOLS}
703 The @samp{BFD_JUMP_TABLE_SYMBOLS} macro is used for functions which deal
706 @table @samp
710 amount of memory required to hold @samp{asymbol} pointers for all the
711 symbols plus a trailing @samp{NULL} entry, and store the actual symbol
713 @samp{bfd_get_symtab_upper_bound}. The corresponding field in the
714 target vector is named @samp{_bfd_get_symtab_upper_bound}.
718 @samp{bfd_canonicalize_symtab}. The corresponding field in the target
719 vector is named @samp{_bfd_canonicalize_symtab}.
724 larger than an @samp{asymbol} and storing the extra information at the
726 what looks like a pointer to an empty @samp{asymbol}. This is called
727 via @samp{bfd_make_empty_symbol}. The corresponding field in the target
728 vector is named @samp{_bfd_make_empty_symbol}.
732 @samp{bfd_print_symbol}. One of the arguments indicates what sort of
735 @table @samp
742 Print all information about the symbol. This is used by @samp{objdump}
743 when run with the @samp{-t} option.
746 @samp{_bfd_print_symbol}.
750 via @samp{bfd_symbol_info}. The corresponding field in the target
751 vector is named @samp{_bfd_get_symbol_info}.
755 local label. This is called via @samp{bfd_is_local_label} and
756 @samp{bfd_is_local_label_name}. Local labels are normally discarded by
758 @samp{-x} and @samp{-X} options.
767 called via @samp{bfd_find_nearest_line}. The corresponding field in the
768 target vector is named @samp{_bfd_find_nearest_line}.
773 @samp{N_DEBUG} section when it is written out. This is called via
774 @samp{bfd_make_debug_symbol}.
778 @samp{nm}. A minisymbol is a cookie pointing to internal symbol
782 via @samp{bfd_read_minisymbols}. Most targets do not implement this,
784 @samp{asymbol} structures.
787 Convert a minisymbol to a standard @samp{asymbol}. This is called via
788 @samp{bfd_minisymbol_to_symbol}.
793 @cindex @samp{BFD_JUMP_TABLE_RELOCS}
795 The @samp{BFD_JUMP_TABLE_RELOCS} macro is used for functions which deal
798 @table @samp
802 targets return the amount of memory required to hold @samp{arelent}
803 pointers for all the relocations plus a trailing @samp{NULL} entry, and
805 called via @samp{bfd_get_reloc_upper_bound}.
809 @samp{bfd_canonicalize_reloc}. The corresponding field in the target
810 vector is named @samp{_bfd_canonicalize_reloc}.
815 @samp{bfd_reloc_type_lookup}. The corresponding field in the target
816 vector is named @samp{reloc_type_lookup}.
821 @cindex @samp{BFD_JUMP_TABLE_WRITE}
823 The @samp{BFD_JUMP_TABLE_WRITE} macro is used for functions which deal
826 @table @samp
829 @samp{bfd_set_arch_mach}. Most targets implement this by calling
830 @samp{bfd_default_set_arch_mach}. The corresponding field in the target
831 vector is named @samp{_bfd_set_arch_mach}.
835 @samp{bfd_set_section_contents}. The corresponding field in the target
836 vector is named @samp{_bfd_set_section_contents}.
841 @cindex @samp{BFD_JUMP_TABLE_LINK}
843 The @samp{BFD_JUMP_TABLE_LINK} macro is used for functions called by the
846 @table @samp
849 used to implement the @samp{SIZEOF_HEADERS} linker script function. It
851 the page. This is called via @samp{bfd_sizeof_headers}. The
853 @samp{_bfd_sizeof_headers}.
859 @samp{bfd_get_relocated_section_contents}. Most targets implement it by
860 calling @samp{bfd_generic_get_relocated_section_contents}.
864 by the linker when the @samp{-relax} option is used. This is called via
865 @samp{bfd_relax_section}. Most targets do not support any sort of
872 @samp{bfd_link_hash_table_create}.
877 elements in the link. This is called via @samp{bfd_link_add_symbols}.
882 generate the output file. This is called via @samp{bfd_final_link}.
891 @cindex @samp{BFD_JUMP_TABLE_DYNAMIC}
893 The @samp{BFD_JUMP_TABLE_DYNAMIC} macro is used for functions which read
896 @table @samp
900 return the amount of memory required to hold @samp{asymbol} pointers for
901 all the symbols plus a trailing @samp{NULL} entry, and store the actual
903 @samp{bfd_get_dynamic_symtab_upper_bound}. The corresponding field in
904 the target vector is named @samp{_bfd_get_dynamic_symtab_upper_bound}.
908 @samp{bfd_canonicalize_dynamic_symtab}. The corresponding field in the
909 target vector is named @samp{_bfd_canonicalize_dynamic_symtab}.
914 return the amount of memory required to hold @samp{arelent} pointers for
915 all the relocations plus a trailing @samp{NULL} entry, and store the
917 @samp{bfd_get_dynamic_reloc_upper_bound}. The corresponding field in
918 the target vector is named @samp{_bfd_get_dynamic_reloc_upper_bound}.
922 @samp{bfd_canonicalize_dynamic_reloc}. The corresponding field in the
923 target vector is named @samp{_bfd_canonicalize_dynamic_reloc}.
935 you configure with the @samp{--enable-maintainer-mode} option. Some
952 To see them, search for @samp{@@} in @file{bfd-in2.h}. They mainly
959 @samp{--enable-maintainer-mode} option, @file{bfd-in2.h} is rebuilt
974 @samp{--enable-maintainer-mode} option, @file{libbfd.h} is rebuilt
981 @samp{--enable-maintainer-mode} option, @file{libcoff.h} is rebuilt
1033 @samp{N_TXTADDR} and similar a.out macros.
1038 a.out targets based on the preprocessor macro @samp{ARCH_SIZE}, but
1048 intention was that this file would only be included by @samp{aout32.c}
1049 and @samp{aout64.c}, and that other a.out targets would simply refer to
1078 only two). The control is the preprocessor macro @samp{ECOFF_32} or
1079 @samp{ECOFF_64}.
1085 It is controlled by the @samp{ARCH_SIZE} macro which is defined to be
1086 @samp{32} or @samp{64} before including it. The @samp{NAME} macro is
1141 @samp{p} and @samp{i} are global variables. A relocation for the symbol
1142 @samp{i} would be generated such that the linker would initialize the
1143 area of memory which holds the value of @samp{p} to the value of the
1144 symbol @samp{i}.
1168 In BFD, each section has an array of @samp{arelent} structures. Each
1170 addend, and a pointer to a @samp{reloc_howto_struct} structure. The
1175 Originally, the function @samp{bfd_perform_relocation} was supposed to
1178 that weren't, the howto structure included a @samp{special_function}
1181 While this seems plausible, a look at @samp{bfd_perform_relocation}
1183 fields in the howto structure, such as @samp{pcrel_offset}, were not
1186 The linker uses @samp{bfd_perform_relocation} to do all relocations when
1190 @samp{bfd_get_relocated_section_contents}, which for most targets turns
1191 into a call to @samp{bfd_generic_get_relocated_section_contents}, which
1192 calls @samp{bfd_perform_relocation}. So @samp{bfd_perform_relocation}
1196 The assembler used @samp{bfd_perform_relocation} for a while. This
1198 @samp{bfd_perform_relocation} was written to handle relocations on an
1201 @samp{bfd_install_relocation} instead, and @samp{bfd_install_relocation}
1202 was created as a copy of @samp{bfd_perform_relocation}.
1205 @samp{bfd_install_relocation} remains a simple copy of
1206 @samp{bfd_perform_relocation}, with all the odd special cases and
1212 @samp{arelent} structures, so it can not use
1213 @samp{bfd_perform_relocation} at all. Instead, users of the new linker
1214 are expected to write a @samp{relocate_section} function which will
1218 @samp{_bfd_final_link_relocate} and @samp{_bfd_relocate_contents}.
1220 @samp{special_function} field. Since the functions are normally called
1221 from target specific code, the @samp{special_function} field adds
1244 call @samp{bfd_install_relocation}, so your howto structure has to be
1245 able to handle that. You may need to set the @samp{special_function}
1248 relocatable link. For example, see @samp{bfd_elf_generic_reloc}.
1260 cases this will just involve a call to @samp{_bfd_final_link_relocate}
1261 or @samp{_bfd_relocate_contents}, depending upon the definition of the
1276 to work correctly, @samp{bfd_perform_relocation} has to do the right
1278 @samp{special_function} field to handle this correctly. Test this by
1297 structures described above: the enum @samp{bfd_reloc_code_real_type}.
1302 used. For example, the single value @samp{BFD_RELOC_32} is used for all
1306 mechanism to create @samp{arelent} structures. In order for the
1307 assembler to create an @samp{arelent} structure, it has to be able to
1308 obtain a howto structure. The function @samp{bfd_reloc_type_lookup},
1310 @samp{reloc_type_lookup}, takes a relocation code and returns a howto
1313 The function @samp{bfd_get_reloc_code_name} returns the name of a
1345 One or more generic functions similar to @samp{bfd_perform_relocation}
1356 @samp{bfd_generic_get_relocated_section_contents} function which is
1402 segments (type @samp{PT_LOAD}) are directly loaded into memory. Other
1425 @samp{0x40080} and the page size is @samp{0x1000}, then the position of
1426 the segment contents within the file must equal @samp{0x80} modulo
1427 @samp{0x1000}.
1439 @samp{copy_private} entry points. They will be printed by the
1440 @samp{print_private} entry point. Otherwise, the program segments are
1446 the function @samp{assign_file_positions_for_segments} in @file{elf.c}.
1451 segments when creating an executable: the @samp{bfd_record_phdr}
1455 implement the @samp{PHDRS} linker script command.
1463 internal structures are defined in terms of @samp{bfd_vma}, and so may
1468 @file{elf32.c} with @samp{ARCH_SIZE} defined as @samp{32}, and once via
1469 @file{elf64.c} with @samp{ARCH_SIZE} defined as @samp{64}.
1475 @samp{elf_backend_relocate_section}, which is required to relocate the
1477 is used, and relocations are handled via @samp{bfd_perform_relocation}.
1493 @samp{bfd_reloc_type_lookup} entry point is always processor specific.
1516 Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or
1520 @samp{TARGET_BIG_SYM} for a big-endian processor,
1521 @samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both
1524 Define either @samp{TARGET_BIG_NAME} or @samp{TARGET_LITTLE_NAME}, or
1530 Define @samp{ELF_ARCH} to the BFD architecture (an element of the
1531 @samp{bfd_architecture} enum, typically @samp{bfd_arch_@var{cpu}}).
1533 Define @samp{ELF_MACHINE_CODE} to the magic number which should appear
1534 in the @samp{e_machine} field of the ELF header. As of this writing,
1539 @samp{EM_}.
1541 Define @samp{ELF_MAXPAGESIZE} to the maximum size of a virtual page in
1545 can simply be @samp{1}.
1547 If the format should use @samp{Rel} rather than @samp{Rela} relocations,
1548 define @samp{USE_REL}. This is normally defined in chapter 4 of the
1551 In the absence of a supplement, it's easier to work with @samp{Rela}
1552 relocations. @samp{Rela} relocations will require more space in object
1555 using @samp{Rela} relocations. With @samp{Rel} relocations, the addend
1559 For example, consider C code like @code{i = a[1000];} where @samp{a} is
1560 a global array. The instructions which load the value of @samp{a[1000]}
1562 representing @samp{a}, with an addend that gives the offset from the
1563 start of @samp{a} to element @samp{1000}. When using @samp{Rel}
1572 It is possible, though somewhat awkward, to support both @samp{Rel} and
1573 @samp{Rela} relocations for a single target; @file{elf64-mips.c} does it
1578 Define a @samp{bfd_reloc_type_lookup} routine. This must be named
1579 @samp{bfd_elf@var{nn}_bfd_reloc_type_lookup}, and may be either a
1583 If using @samp{Rel} relocations, define @samp{elf_info_to_howto_rel}.
1584 If using @samp{Rela} relocations, define @samp{elf_info_to_howto}.
1586 takes an @samp{arelent} and a @samp{Rel} or @samp{Rela} structure, and
1587 sets the @samp{howto} field of the @samp{arelent} based on the
1588 @samp{Rel} or @samp{Rela} structure. This is normally uses
1589 @samp{ELF@var{nn}_R_TYPE} to get the ELF relocation type and uses it as
1594 @samp{prep_headers} function in @file{elf.c}.
1599 it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER},
1600 @samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS}
1605 program @samp{readelf} parse your ELF objects. For this, you need to add
1616 relocations into BFD @samp{asymbol} and @samp{arelent} structures. In
1618 @samp{bfd_perform_relocation}, which will use the howto structures you
1622 S-records, @samp{bfd_perform_relocation} must work correctly with your
1629 @samp{elf_backend_relocate_section} as the name of a function which will
1634 @samp{_bfd_final_link_relocate}. The function must check for a
1657 @samp{elf_backend_data} structure defined in @file{elf-bfd.h}. In
1659 @samp{elf_backend_@var{name}}.
1662 These are again found in the @samp{elf_backend_data} structure.
1668 via a hook function. For example, the special @samp{SHN_MIPS_SCOMMON}
1670 @samp{section_from_bfd_section}, @samp{symbol_processing},
1671 @samp{add_symbol_hook}, and @samp{output_symbol_hook}.
1685 have names, BFD will invent names like @samp{segment@var{n}} where
1690 @samp{p_filesz} field. The total size of the segment is given by the
1691 @samp{p_memsz} field. If @samp{p_memsz} is larger than @samp{p_filesz},
1696 The first, named @samp{segment@var{n}a}, will represent the initialized
1697 part of the program segment. The second, named @samp{segment@var{n}b},
1701 program segments with the type @samp{PT_NOTE}. BFD will attempt to
1709 implement this would be to write @samp{bfd_set_format} and
1710 @samp{bfd_write_contents} routines for the @samp{bfd_core} type; see
1724 the @samp{reloc_type_lookup} and @samp{info_to_howto} functions are
1728 relocate section function (@samp{_bfd_coff_generic_relocate_section}),
1733 @samp{prep_headers} in @file{elf.c} is somewhat bogus. It should be
1753 A collection of object files produced and manipulated by the @samp{ar}
1762 opened by the BFD library has the type @samp{bfd *}, and is sometimes
1841 format. The @samp{bfd_target} structure.