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
359 @samp{BFD_ENDIAN_BIG}, @samp{BFD_ENDIAN_LITTLE}, or
360 @samp{BFD_ENDIAN_UNKNOWN}. The latter would be used for a format such
365 same as the @samp{byteorder} field, but there are certain cases where it
369 Flags which may appear in the @samp{flags} field of a BFD with this
373 Flags which may appear in the @samp{flags} field of a section within a
379 @samp{_foo} for a function named @samp{foo} in the C source, in which
380 case this field would be @samp{_}. If there is no such character, this
381 field will be @samp{0}.
385 @samp{/}.
388 The maximum length of a short name in an archive. Normally @samp{14}.
414 @table @samp
427 @table @samp
431 by the @samp{bfd_check_format} function when examining an existing BFD.
433 format specific information such as the @samp{tdata} field of the BFD.
439 the @samp{bfd_set_format} function after creating the BFD with a
440 function such as @samp{bfd_openw}. This function will initialize format
447 by @samp{bfd_close} function for a BFD opened for writing. This really
449 @samp{bfd_set_format} function provides all the required information.
451 through the @samp{bfd_set_format} and the @samp{bfd_write_contents}
452 arrays; fortunately, since @samp{bfd_close} gets it right, this is a
457 @subsection @samp{BFD_JUMP_TABLE} macros
458 @cindex @samp{BFD_JUMP_TABLE}
460 Most target vectors are defined using @samp{BFD_JUMP_TABLE} macros.
465 For example, the @samp{BFD_JUMP_TABLE_RELOCS} macro defines three
466 functions: @samp{_get_reloc_upper_bound}, @samp{_canonicalize_reloc},
467 and @samp{_bfd_reloc_type_lookup}. A reference like
468 @samp{BFD_JUMP_TABLE_RELOCS (foo)} will expand into three functions
469 prefixed with @samp{foo}: @samp{foo_get_reloc_upper_bound}, etc. The
470 @samp{BFD_JUMP_TABLE_RELOCS} macro will be placed such that those three
476 functions. Those target vectors all use @samp{BFD_JUMP_TABLE_ARCHIVE}
480 Each of the @samp{BFD_JUMP_TABLE} macros is mentioned below along with
483 @samp{BFD_JUMP_TABLE} macro defines. This name is normally the same as
489 @cindex @samp{BFD_JUMP_TABLE_GENERIC}
491 The @samp{BFD_JUMP_TABLE_GENERIC} macro is used for some catch all
494 @table @samp
497 isn't freed by @samp{_bfd_free_cached_info}. This is called when any
498 BFD is closed (the @samp{bfd_write_contents} function mentioned
500 pointer is typically set to @samp{_bfd_generic_close_and_cleanup},
507 use @samp{bfd_alloc} to allocate target specific information and thus
509 it to @samp{_bfd_generic_free_cached_info} which throws away objalloc
514 @samp{_bfd_generic_free_cached_info}.
517 This is called from @samp{bfd_make_section_anyway} whenever a new
524 @samp{bfd_get_section_contents}. Most targets set this to
525 @samp{_bfd_generic_get_section_contents}, which does a @samp{bfd_seek}
526 based on the section's @samp{filepos} field and a @samp{bfd_read}. The
528 @samp{_bfd_get_section_contents}.
531 Set a @samp{bfd_window} to hold the contents of a section. This is
532 called from @samp{bfd_get_section_contents_in_window}. The
533 @samp{bfd_window} idea never really caught on, and I don't think this is
535 @samp{bfd_generic_get_section_contents_in_window}, which uses
536 @samp{bfd_get_section_contents} to do the right thing. The
538 @samp{_bfd_get_section_contents_in_window}.
543 @cindex @samp{BFD_JUMP_TABLE_COPY}
545 The @samp{BFD_JUMP_TABLE_COPY} macro is used for functions which are
549 @table @samp
551 This is called when copying a BFD, via @samp{bfd_copy_private_bfd_data}.
558 This is called when linking, via @samp{bfd_merge_private_bfd_data}. It
564 This is similar to @samp{_bfd_copy_private_bfd_data}, but it is called
565 for each section, via @samp{bfd_copy_private_section_data}. This
570 This is called via @samp{bfd_copy_private_symbol_data}, but I don't
574 the @samp{asymbol} structure and storing private information in the
575 extra space. Since @samp{objcopy} and other programs copy symbol
576 information by copying pointers to @samp{asymbol} structures, the
581 This is called via @samp{bfd_set_private_flags}. It is basically a hook
587 This is called by @samp{objdump} when the @samp{-p} option is used. It
588 is called via @samp{bfd_print_private_data}. It prints any interesting
590 and thus can not be printed by @samp{objdump}. Most targets do not do
596 @cindex @samp{BFD_JUMP_TABLE_CORE}
598 The @samp{BFD_JUMP_TABLE_CORE} macro is used for functions which deal
602 @table @samp
618 @cindex @samp{BFD_JUMP_TABLE_ARCHIVE}
620 The @samp{BFD_JUMP_TABLE_ARCHIVE} macro is used for functions which deal
622 (including ELF targets), and these use @samp{_bfd_archive_coff} as the
623 argument to @samp{BFD_JUMP_TABLE_ARCHIVE}. Some targets use BSD/a.out
624 style archives, and these use @samp{_bfd_archive_bsd}. (The main
627 @samp{_bfd_noarchive}. Finally, a few targets have unusual archive
630 @table @samp
633 is normally called from the archive @samp{check_format} routine. The
635 @samp{_bfd_slurp_armap}.
640 archive @samp{check_format} routine. The corresponding field in the
641 target vector is named @samp{_bfd_slurp_extended_name_table}.
647 archive @samp{write_contents} routine. The corresponding field in the
648 target vector is named @samp{_bfd_construct_extended_name_table}.
652 required. It is normally called from the archive @samp{write_contents}
654 support extended name tables, but I think the GNU @samp{ar} program
656 target vector is named @samp{_bfd_truncate_arname}.
659 Write out the archive symbol table using calls to @samp{bfd_write}.
660 This is normally called from the archive @samp{write_contents} routine.
661 The corresponding field in the target vector is named @samp{write_armap}
669 @samp{_bfd_read_ar_hdr_fn}.
674 via @samp{bfd_openr_next_archived_file}. The corresponding field in the
675 target vector is named @samp{openr_next_archived_file} (no leading
681 via @samp{bfd_get_elt_at_index}. The corresponding field in the target
682 vector is named @samp{_bfd_get_elt_at_index}.
687 is called via @samp{bfd_stat_arch_elt}. The corresponding field in the
688 target vector is named @samp{_bfd_stat_arch_elt}.
694 called by the archive @samp{write_contents} routine. The corresponding
695 field in the target vector is named @samp{_bfd_update_armap_timestamp}.
700 @cindex @samp{BFD_JUMP_TABLE_SYMBOLS}
702 The @samp{BFD_JUMP_TABLE_SYMBOLS} macro is used for functions which deal
705 @table @samp
709 amount of memory required to hold @samp{asymbol} pointers for all the
710 symbols plus a trailing @samp{NULL} entry, and store the actual symbol
712 @samp{bfd_get_symtab_upper_bound}. The corresponding field in the
713 target vector is named @samp{_bfd_get_symtab_upper_bound}.
717 @samp{bfd_canonicalize_symtab}. The corresponding field in the target
718 vector is named @samp{_bfd_canonicalize_symtab}.
723 larger than an @samp{asymbol} and storing the extra information at the
725 what looks like a pointer to an empty @samp{asymbol}. This is called
726 via @samp{bfd_make_empty_symbol}. The corresponding field in the target
727 vector is named @samp{_bfd_make_empty_symbol}.
731 @samp{bfd_print_symbol}. One of the arguments indicates what sort of
734 @table @samp
741 Print all information about the symbol. This is used by @samp{objdump}
742 when run with the @samp{-t} option.
745 @samp{_bfd_print_symbol}.
749 via @samp{bfd_symbol_info}. The corresponding field in the target
750 vector is named @samp{_bfd_get_symbol_info}.
754 local label. This is called via @samp{bfd_is_local_label} and
755 @samp{bfd_is_local_label_name}. Local labels are normally discarded by
757 @samp{-x} and @samp{-X} options.
766 called via @samp{bfd_find_nearest_line}. The corresponding field in the
767 target vector is named @samp{_bfd_find_nearest_line}.
772 @samp{N_DEBUG} section when it is written out. This is called via
773 @samp{bfd_make_debug_symbol}.
777 @samp{nm}. A minisymbol is a cookie pointing to internal symbol
781 via @samp{bfd_read_minisymbols}. Most targets do not implement this,
783 @samp{asymbol} structures.
786 Convert a minisymbol to a standard @samp{asymbol}. This is called via
787 @samp{bfd_minisymbol_to_symbol}.
792 @cindex @samp{BFD_JUMP_TABLE_RELOCS}
794 The @samp{BFD_JUMP_TABLE_RELOCS} macro is used for functions which deal
797 @table @samp
801 targets return the amount of memory required to hold @samp{arelent}
802 pointers for all the relocations plus a trailing @samp{NULL} entry, and
804 called via @samp{bfd_get_reloc_upper_bound}.
808 @samp{bfd_canonicalize_reloc}. The corresponding field in the target
809 vector is named @samp{_bfd_canonicalize_reloc}.
814 @samp{bfd_reloc_type_lookup}. The corresponding field in the target
815 vector is named @samp{reloc_type_lookup}.
820 @cindex @samp{BFD_JUMP_TABLE_WRITE}
822 The @samp{BFD_JUMP_TABLE_WRITE} macro is used for functions which deal
825 @table @samp
828 @samp{bfd_set_arch_mach}. Most targets implement this by calling
829 @samp{bfd_default_set_arch_mach}. The corresponding field in the target
830 vector is named @samp{_bfd_set_arch_mach}.
834 @samp{bfd_set_section_contents}. The corresponding field in the target
835 vector is named @samp{_bfd_set_section_contents}.
840 @cindex @samp{BFD_JUMP_TABLE_LINK}
842 The @samp{BFD_JUMP_TABLE_LINK} macro is used for functions called by the
845 @table @samp
848 used to implement the @samp{SIZEOF_HEADERS} linker script function. It
850 the page. This is called via @samp{bfd_sizeof_headers}. The
852 @samp{_bfd_sizeof_headers}.
858 @samp{bfd_get_relocated_section_contents}. Most targets implement it by
859 calling @samp{bfd_generic_get_relocated_section_contents}.
863 by the linker when the @samp{-relax} option is used. This is called via
864 @samp{bfd_relax_section}. Most targets do not support any sort of
871 @samp{bfd_link_hash_table_create}.
876 elements in the link. This is called via @samp{bfd_link_add_symbols}.
881 generate the output file. This is called via @samp{bfd_final_link}.
890 @cindex @samp{BFD_JUMP_TABLE_DYNAMIC}
892 The @samp{BFD_JUMP_TABLE_DYNAMIC} macro is used for functions which read
895 @table @samp
899 return the amount of memory required to hold @samp{asymbol} pointers for
900 all the symbols plus a trailing @samp{NULL} entry, and store the actual
902 @samp{bfd_get_dynamic_symtab_upper_bound}. The corresponding field in
903 the target vector is named @samp{_bfd_get_dynamic_symtab_upper_bound}.
907 @samp{bfd_canonicalize_dynamic_symtab}. The corresponding field in the
908 target vector is named @samp{_bfd_canonicalize_dynamic_symtab}.
913 return the amount of memory required to hold @samp{arelent} pointers for
914 all the relocations plus a trailing @samp{NULL} entry, and store the
916 @samp{bfd_get_dynamic_reloc_upper_bound}. The corresponding field in
917 the target vector is named @samp{_bfd_get_dynamic_reloc_upper_bound}.
921 @samp{bfd_canonicalize_dynamic_reloc}. The corresponding field in the
922 target vector is named @samp{_bfd_canonicalize_dynamic_reloc}.
934 you configure with the @samp{--enable-maintainer-mode} option. Some
951 To see them, search for @samp{@@} in @file{bfd-in2.h}. They mainly
958 @samp{--enable-maintainer-mode} option, @file{bfd-in2.h} is rebuilt
973 @samp{--enable-maintainer-mode} option, @file{libbfd.h} is rebuilt
980 @samp{--enable-maintainer-mode} option, @file{libcoff.h} is rebuilt
1032 @samp{N_TXTADDR} and similar a.out macros.
1037 a.out targets based on the preprocessor macro @samp{ARCH_SIZE}, but
1047 intention was that this file would only be included by @samp{aout32.c}
1048 and @samp{aout64.c}, and that other a.out targets would simply refer to
1077 only two). The control is the preprocessor macro @samp{ECOFF_32} or
1078 @samp{ECOFF_64}.
1084 It is controlled by the @samp{ARCH_SIZE} macro which is defined to be
1085 @samp{32} or @samp{64} before including it. The @samp{NAME} macro is
1140 @samp{p} and @samp{i} are global variables. A relocation for the symbol
1141 @samp{i} would be generated such that the linker would initialize the
1142 area of memory which holds the value of @samp{p} to the value of the
1143 symbol @samp{i}.
1167 In BFD, each section has an array of @samp{arelent} structures. Each
1169 addend, and a pointer to a @samp{reloc_howto_struct} structure. The
1174 Originally, the function @samp{bfd_perform_relocation} was supposed to
1177 that weren't, the howto structure included a @samp{special_function}
1180 While this seems plausible, a look at @samp{bfd_perform_relocation}
1182 fields in the howto structure, such as @samp{pcrel_offset}, were not
1185 The linker uses @samp{bfd_perform_relocation} to do all relocations when
1189 @samp{bfd_get_relocated_section_contents}, which for most targets turns
1190 into a call to @samp{bfd_generic_get_relocated_section_contents}, which
1191 calls @samp{bfd_perform_relocation}. So @samp{bfd_perform_relocation}
1195 The assembler used @samp{bfd_perform_relocation} for a while. This
1197 @samp{bfd_perform_relocation} was written to handle relocations on an
1200 @samp{bfd_install_relocation} instead, and @samp{bfd_install_relocation}
1201 was created as a copy of @samp{bfd_perform_relocation}.
1204 @samp{bfd_install_relocation} remains a simple copy of
1205 @samp{bfd_perform_relocation}, with all the odd special cases and
1211 @samp{arelent} structures, so it can not use
1212 @samp{bfd_perform_relocation} at all. Instead, users of the new linker
1213 are expected to write a @samp{relocate_section} function which will
1217 @samp{_bfd_final_link_relocate} and @samp{_bfd_relocate_contents}.
1219 @samp{special_function} field. Since the functions are normally called
1220 from target specific code, the @samp{special_function} field adds
1243 call @samp{bfd_install_relocation}, so your howto structure has to be
1244 able to handle that. You may need to set the @samp{special_function}
1247 relocatable link. For example, see @samp{bfd_elf_generic_reloc}.
1259 cases this will just involve a call to @samp{_bfd_final_link_relocate}
1260 or @samp{_bfd_relocate_contents}, depending upon the definition of the
1275 to work correctly, @samp{bfd_perform_relocation} has to do the right
1277 @samp{special_function} field to handle this correctly. Test this by
1296 structures described above: the enum @samp{bfd_reloc_code_real_type}.
1301 used. For example, the single value @samp{BFD_RELOC_32} is used for all
1305 mechanism to create @samp{arelent} structures. In order for the
1306 assembler to create an @samp{arelent} structure, it has to be able to
1307 obtain a howto structure. The function @samp{bfd_reloc_type_lookup},
1309 @samp{reloc_type_lookup}, takes a relocation code and returns a howto
1312 The function @samp{bfd_get_reloc_code_name} returns the name of a
1344 One or more generic functions similar to @samp{bfd_perform_relocation}
1355 @samp{bfd_generic_get_relocated_section_contents} function which is
1401 segments (type @samp{PT_LOAD}) are directly loaded into memory. Other
1424 @samp{0x40080} and the page size is @samp{0x1000}, then the position of
1425 the segment contents within the file must equal @samp{0x80} modulo
1426 @samp{0x1000}.
1438 @samp{copy_private} entry points. They will be printed by the
1439 @samp{print_private} entry point. Otherwise, the program segments are
1445 the function @samp{assign_file_positions_for_segments} in @file{elf.c}.
1450 segments when creating an executable: the @samp{bfd_record_phdr}
1454 implement the @samp{PHDRS} linker script command.
1462 internal structures are defined in terms of @samp{bfd_vma}, and so may
1467 @file{elf32.c} with @samp{ARCH_SIZE} defined as @samp{32}, and once via
1468 @file{elf64.c} with @samp{ARCH_SIZE} defined as @samp{64}.
1474 @samp{elf_backend_relocate_section}, which is required to relocate the
1476 is used, and relocations are handled via @samp{bfd_perform_relocation}.
1492 @samp{bfd_reloc_type_lookup} entry point is always processor specific.
1515 Define either @samp{TARGET_BIG_SYM} or @samp{TARGET_LITTLE_SYM}, or
1519 @samp{TARGET_BIG_SYM} for a big-endian processor,
1520 @samp{TARGET_LITTLE_SYM} for a little-endian processor, and define both
1523 Define either @samp{TARGET_BIG_NAME} or @samp{TARGET_LITTLE_NAME}, or
1529 Define @samp{ELF_ARCH} to the BFD architecture (an element of the
1530 @samp{bfd_architecture} enum, typically @samp{bfd_arch_@var{cpu}}).
1532 Define @samp{ELF_MACHINE_CODE} to the magic number which should appear
1533 in the @samp{e_machine} field of the ELF header. As of this writing,
1538 @samp{EM_}.
1540 Define @samp{ELF_MAXPAGESIZE} to the maximum size of a virtual page in
1544 can simply be @samp{1}.
1546 If the format should use @samp{Rel} rather than @samp{Rela} relocations,
1547 define @samp{USE_REL}. This is normally defined in chapter 4 of the
1550 In the absence of a supplement, it's easier to work with @samp{Rela}
1551 relocations. @samp{Rela} relocations will require more space in object
1554 using @samp{Rela} relocations. With @samp{Rel} relocations, the addend
1558 For example, consider C code like @code{i = a[1000];} where @samp{a} is
1559 a global array. The instructions which load the value of @samp{a[1000]}
1561 representing @samp{a}, with an addend that gives the offset from the
1562 start of @samp{a} to element @samp{1000}. When using @samp{Rel}
1571 It is possible, though somewhat awkward, to support both @samp{Rel} and
1572 @samp{Rela} relocations for a single target; @file{elf64-mips.c} does it
1577 Define a @samp{bfd_reloc_type_lookup} routine. This must be named
1578 @samp{bfd_elf@var{nn}_bfd_reloc_type_lookup}, and may be either a
1582 If using @samp{Rel} relocations, define @samp{elf_info_to_howto_rel}.
1583 If using @samp{Rela} relocations, define @samp{elf_info_to_howto}.
1585 takes an @samp{arelent} and a @samp{Rel} or @samp{Rela} structure, and
1586 sets the @samp{howto} field of the @samp{arelent} based on the
1587 @samp{Rel} or @samp{Rela} structure. This is normally uses
1588 @samp{ELF@var{nn}_R_TYPE} to get the ELF relocation type and uses it as
1593 @samp{prep_headers} function in @file{elf.c}.
1598 it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER},
1599 @samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS}
1604 program @samp{readelf} parse your ELF objects. For this, you need to add
1615 relocations into BFD @samp{asymbol} and @samp{arelent} structures. In
1617 @samp{bfd_perform_relocation}, which will use the howto structures you
1621 S-records, @samp{bfd_perform_relocation} must work correctly with your
1628 @samp{elf_backend_relocate_section} as the name of a function which will
1633 @samp{_bfd_final_link_relocate}. The function must check for a
1656 @samp{elf_backend_data} structure defined in @file{elf-bfd.h}. In
1658 @samp{elf_backend_@var{name}}.
1661 These are again found in the @samp{elf_backend_data} structure.
1667 via a hook function. For example, the special @samp{SHN_MIPS_SCOMMON}
1669 @samp{section_from_bfd_section}, @samp{symbol_processing},
1670 @samp{add_symbol_hook}, and @samp{output_symbol_hook}.
1684 have names, BFD will invent names like @samp{segment@var{n}} where
1689 @samp{p_filesz} field. The total size of the segment is given by the
1690 @samp{p_memsz} field. If @samp{p_memsz} is larger than @samp{p_filesz},
1695 The first, named @samp{segment@var{n}a}, will represent the initialized
1696 part of the program segment. The second, named @samp{segment@var{n}b},
1700 program segments with the type @samp{PT_NOTE}. BFD will attempt to
1708 implement this would be to write @samp{bfd_set_format} and
1709 @samp{bfd_write_contents} routines for the @samp{bfd_core} type; see
1723 the @samp{reloc_type_lookup} and @samp{info_to_howto} functions are
1727 relocate section function (@samp{_bfd_coff_generic_relocate_section}),
1732 @samp{prep_headers} in @file{elf.c} is somewhat bogus. It should be
1752 A collection of object files produced and manipulated by the @samp{ar}
1761 opened by the BFD library has the type @samp{bfd *}, and is sometimes
1840 format. The @samp{bfd_target} structure.