#include "mach-o.h"#include "bfd.h"#include "sysdep.h"#include "libbfd.h"#include "libiberty.h"#include <ctype.h>#include "mach-o-target.c"

Go to the source code of this file.
| #define BFD_IO_FUNCS 0 |
Definition at line 33 of file mach-o.c.
Referenced by bfd_mach_o_scan(), bfd_pef_scan(), and bfd_pef_xlib_scan().
| #define bfd_mach_o_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data |
| #define bfd_mach_o_bfd_discard_group bfd_generic_discard_group |
| #define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info |
| #define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents |
| #define bfd_mach_o_bfd_is_group_section bfd_generic_is_group_section |
| #define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name |
| #define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name |
| #define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols |
| #define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create |
| #define bfd_mach_o_bfd_link_hash_table_free _bfd_generic_link_hash_table_free |
| #define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms |
| #define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section |
| #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol |
| #define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data |
| #define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections |
| #define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data |
| #define bfd_mach_o_bfd_relax_section bfd_generic_relax_section |
| #define bfd_mach_o_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup |
| #define bfd_mach_o_bfd_set_private_flags _bfd_generic_bfd_set_private_flags |
| #define bfd_mach_o_canonicalize_reloc _bfd_norelocs_canonicalize_reloc |
| #define bfd_mach_o_close_and_cleanup _bfd_generic_close_and_cleanup |
| #define bfd_mach_o_construct_extended_name_table _bfd_noarchive_construct_extended_name_table |
| #define bfd_mach_o_find_nearest_line _bfd_nosymbols_find_nearest_line |
| #define bfd_mach_o_generic_stat_arch_elt _bfd_noarchive_generic_stat_arch_elt |
| #define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index |
| #define bfd_mach_o_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound |
| #define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents |
| #define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window |
| #define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol |
| #define bfd_mach_o_new_section_hook _bfd_generic_new_section_hook |
| #define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols |
| #define bfd_mach_o_section_already_linked _bfd_generic_section_already_linked |
| #define bfd_mach_o_set_section_contents _bfd_generic_set_section_contents |
| #define bfd_mach_o_slurp_extended_name_table _bfd_noarchive_slurp_extended_name_table |
| #define bfd_mach_o_truncate_arname _bfd_noarchive_truncate_arname |
| #define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp |
| #define N_ABS 0x2 |
Definition at line 171 of file mach-o.c.
Referenced by _bfd_coff_link_input_bfd(), _bfd_coff_write_global_sym(), aout_link_add_symbols(), aout_link_check_ar_symbols(), aout_link_reloc_link_order(), aout_link_write_other_symbol(), aout_link_write_symbols(), b_out_slurp_reloc_table(), coff_section_from_bfd_index(), coff_write_symbol(), convert_sym_type(), fixup_symbol_value(), pdp11_aout_link_input_section(), pdp11_aout_swap_reloc_in(), sunos_write_dynamic_symbol(), swap_ext_reloc_in(), swap_ext_reloc_out(), translate_from_native_sym_flags(), and translate_to_native_sym_flags().
| #define N_EXT 0x01 |
Definition at line 169 of file mach-o.c.
Referenced by aout_link_add_symbols(), aout_link_check_ar_symbols(), aout_link_reloc_link_order(), aout_link_write_other_symbol(), aout_link_write_symbols(), b_out_slurp_reloc_table(), convert_sym_type(), sunos_write_dynamic_symbol(), translate_from_native_sym_flags(), and translate_to_native_sym_flags().
| #define N_INDR 0xa |
| #define N_STAB 0xe0 |
| #define N_TYPE 0x1e |
Definition at line 168 of file mach-o.c.
Referenced by aout_link_write_symbols(), translate_from_native_sym_flags(), and translate_to_native_sym_flags().
| #define N_UNDF 0x0 |
Definition at line 170 of file mach-o.c.
Referenced by aout_link_add_symbols(), aout_link_check_ar_symbols(), aout_link_write_other_symbol(), convert_sym_type(), sunos_write_dynamic_symbol(), translate_from_native_sym_flags(), and translate_to_native_sym_flags().
| #define SECTION_TYPE 0x000000ff |
| #define TARGET_BIG_ENDIAN 1 |
Definition at line 2171 of file mach-o.c.
Referenced by arc_print_operand(), build_mips16_call_stub(), Initialize_C_Int_Model(), mips16_fp_args(), mips_cannot_change_mode_class(), mips_emit_frame_related_store(), mips_get_unaligned_mem(), mips_return_in_msb(), mips_subword(), and xtensa_return_in_msb().
| #define TARGET_NAME mach_o_fat_vec |
| #define TARGET_NAME mach_o_le_vec |
| #define TARGET_NAME mach_o_be_vec |
| #define TARGET_STRING "mach-o-be" |
Definition at line 2170 of file mach-o.c.
Referenced by expand_block_move(), and rs6000_override_options().
| const bfd_target* bfd_mach_o_archive_p | ( | bfd * | abfd | ) |
Definition at line 1817 of file mach-o.c.
References mach_o_fat_archentry::abfd, adata, mach_o_fat_archentry::align, mach_o_fat_data_struct::archentries, bfd_alloc(), bfd_bread(), bfd_error_wrong_format, bfd_getb32(), bfd_release(), bfd_seek(), bfd_set_error(), buf, mach_o_fat_archentry::cpusubtype, mach_o_fat_archentry::cputype, error(), i, mach_o_fat_data_struct::magic, mach_o_fat_data_struct::nfat_arch, NULL, mach_o_fat_archentry::offset, PTR, SEEK_SET, and mach_o_fat_archentry::size.
Definition at line 222 of file mach-o.c.
References BFD_ASSERT, bfd_mach_o_valid(), mach_o_data_struct::ibfd, bfd::mach_o_data, bfd::tdata, and TRUE.
| static bfd_boolean bfd_mach_o_bfd_copy_private_section_data | ( | ibfd | , | |
| isection | , | |||
| obfd | , | |||
| osection | ||||
| ) | [static] |
| static bfd_boolean bfd_mach_o_bfd_copy_private_symbol_data | ( | ibfd | , | |
| isymbol | , | |||
| obfd | , | |||
| osymbol | ||||
| ) | [static] |
Definition at line 268 of file mach-o.c.
References BFD_ASSERT, bfd_mach_o_count_symbols(), BFD_MACH_O_LC_SYMTAB, bfd_mach_o_scan_read_symtab_symbols(), bfd_mach_o_load_command::command, mach_o_data_struct::commands, fprintf(), mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, bfd_mach_o_symtab_command::nsyms, NULL, sym, bfd_mach_o_symtab_command::symbols, bfd_mach_o_load_command::symtab, and bfd_mach_o_load_command::type.
| static void bfd_mach_o_convert_architecture | ( | bfd_mach_o_cpu_type | mtype, | |
| msubtype | , | |||
| enum bfd_architecture * | type, | |||
| unsigned long * | subtype | |||
| ) | [static] |
Definition at line 337 of file mach-o.c.
References bfd_arch_alpha, bfd_arch_arm, bfd_arch_hppa, bfd_arch_i386, bfd_arch_i860, bfd_arch_m68k, bfd_arch_m88k, bfd_arch_m98k, bfd_arch_powerpc, bfd_arch_sparc, bfd_arch_unknown, bfd_arch_vax, bfd_mach_i386_i386, BFD_MACH_O_CPU_TYPE_ALPHA, BFD_MACH_O_CPU_TYPE_ARM, BFD_MACH_O_CPU_TYPE_HPPA, BFD_MACH_O_CPU_TYPE_I386, BFD_MACH_O_CPU_TYPE_I860, BFD_MACH_O_CPU_TYPE_MC680x0, BFD_MACH_O_CPU_TYPE_MC88000, BFD_MACH_O_CPU_TYPE_MC98000, BFD_MACH_O_CPU_TYPE_MIPS, BFD_MACH_O_CPU_TYPE_POWERPC, BFD_MACH_O_CPU_TYPE_SPARC, BFD_MACH_O_CPU_TYPE_VAX, and bfd_mach_sparc.
Referenced by bfd_mach_o_scan().
| int bfd_mach_o_core_fetch_environment | ( | bfd * | abfd, | |
| unsigned char ** | rbuf, | |||
| unsigned int * | rlen | |||
| ) |
Definition at line 2036 of file mach-o.c.
References bfd_bread(), BFD_MACH_O_LC_SEGMENT, bfd_mach_o_stack_addr(), bfd_malloc(), bfd_realloc(), bfd_seek(), buf, bfd_mach_o_load_command::command, mach_o_data_struct::commands, bfd_mach_o_header::cputype, cur, end, bfd_mach_o_segment_command::fileoff, bfd_mach_o_segment_command::filesize, mach_o_data_struct::header, i, memcpy, bfd_mach_o_header::ncmds, NULL, offset, SEEK_SET, bfd_mach_o_load_command::segment, size, start, top, bfd_mach_o_load_command::type, val, bfd_mach_o_segment_command::vmaddr, bfd_mach_o_segment_command::vmsize, and x0.
Referenced by bfd_mach_o_core_file_failing_command().
| char* bfd_mach_o_core_file_failing_command | ( | bfd * | abfd | ) |
| bfd_boolean bfd_mach_o_core_file_matches_executable_p | ( | core_bfd | , | |
| exec_bfd | ||||
| ) |
| const bfd_target* bfd_mach_o_core_p | ( | bfd * | abfd | ) |
Definition at line 1749 of file mach-o.c.
References abort, BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, bfd_error_wrong_format, BFD_MACH_O_MH_CORE, bfd_mach_o_read_header(), bfd_mach_o_scan(), bfd_preserve_finish(), bfd_preserve_restore(), bfd_preserve_save(), bfd_set_error(), bfd_zalloc(), fail, fprintf(), bfd_preserve::marker, and NULL.
Definition at line 235 of file mach-o.c.
References BFD_ASSERT, BFD_MACH_O_LC_SYMTAB, bfd_mach_o_valid(), bfd_mach_o_load_command::command, mach_o_data_struct::commands, mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, bfd_mach_o_symtab_command::nsyms, NULL, sym, bfd_mach_o_load_command::symtab, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_canonicalize_symtab(), and bfd_mach_o_get_symtab_upper_bound().
Definition at line 1516 of file mach-o.c.
References bfd_alloc(), BFD_ASSERT, BFD_MACH_O_LC_SEGMENT, bfd_mach_o_load_command::command, mach_o_data_struct::commands, mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, mach_o_data_struct::nsects, bfd_mach_o_segment_command::nsects, mach_o_data_struct::sections, bfd_mach_o_segment_command::sections, bfd_mach_o_load_command::segment, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_scan().
| static void bfd_mach_o_get_symbol_info | ( | abfd | , | |
| asymbol * | symbol, | |||
| symbol_info * | ret | |||
| ) | [static] |
| static const char* bfd_mach_o_i386_flavour_string | ( | unsigned int | flavour | ) | [static] |
Definition at line 882 of file mach-o.c.
References BFD_MACH_O_i386_FLOAT_STATE, BFD_MACH_O_i386_ISA_PORT_MAP_STATE, BFD_MACH_O_i386_NEW_THREAD_STATE, BFD_MACH_O_i386_REGS_SEGS_STATE, BFD_MACH_O_i386_SAVED_STATE, BFD_MACH_O_i386_THREAD_CTHREADSTATE, BFD_MACH_O_i386_THREAD_EXCEPTSTATE, BFD_MACH_O_i386_THREAD_FPSTATE, BFD_MACH_O_i386_THREAD_STATE, BFD_MACH_O_i386_THREAD_STATE_NONE, BFD_MACH_O_i386_THREAD_SYSCALL_STATE, and BFD_MACH_O_i386_V86_ASSIST_STATE.
Referenced by bfd_mach_o_scan_read_thread().
| int bfd_mach_o_lookup_command | ( | bfd * | abfd, | |
| bfd_mach_o_load_command_type | type, | |||
| bfd_mach_o_load_command ** | mcommand | |||
| ) |
Definition at line 1979 of file mach-o.c.
References BFD_ASSERT, cmd, mach_o_data_struct::commands, mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, NULL, and bfd_mach_o_load_command::type.
| int bfd_mach_o_lookup_section | ( | bfd * | abfd, | |
| asection * | section, | |||
| bfd_mach_o_load_command ** | mcommand, | |||
| bfd_mach_o_section ** | msection | |||
| ) |
Definition at line 1928 of file mach-o.c.
References BFD_ASSERT, BFD_MACH_O_LC_SEGMENT, bfd_mach_o_section::bfdsection, cmd, bfd_mach_o_load_command::command, mach_o_data_struct::commands, mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, bfd_mach_o_segment_command::nsects, NULL, bfd_mach_o_segment_command::sections, bfd_mach_o_segment_command::segment, bfd_mach_o_load_command::segment, and bfd_mach_o_load_command::type.
| static asection* bfd_mach_o_make_bfd_section | ( | bfd * | abfd, | |
| bfd_mach_o_section * | section | |||
| ) | [static] |
Definition at line 536 of file mach-o.c.
References bfd_mach_o_section::addr, bfd_mach_o_section::align, bfd_section::alignment_power, bfd_alloc(), BFD_MACH_O_S_ZEROFILL, bfd_make_section_anyway(), bfd_section::filepos, bfd_mach_o_section::flags, bfd_section::flags, bfd_section::lma, NULL, bfd_mach_o_section::offset, prefix, SEC_ALLOC, SEC_CODE, SEC_HAS_CONTENTS, SEC_LOAD, bfd_mach_o_section::sectname, bfd_mach_o_section::segname, bfd_mach_o_section::size, bfd_section::size, sprintf(), strlen(), and bfd_section::vma.
Referenced by bfd_mach_o_scan_read_section().
| bfd_boolean bfd_mach_o_mkobject | ( | bfd * | abfd | ) |
Definition at line 1671 of file mach-o.c.
References bfd_alloc(), BFD_ENDIAN_UNKNOWN, bfd_mach_o_header::byteorder, mach_o_data_struct::commands, bfd_mach_o_header::cpusubtype, bfd_mach_o_header::cputype, FALSE, bfd_mach_o_header::filetype, bfd_mach_o_header::flags, mach_o_data_struct::header, mach_o_data_struct::ibfd, bfd_mach_o_header::magic, bfd_mach_o_header::ncmds, mach_o_data_struct::nsects, mach_o_data_struct::nsymbols, NULL, mach_o_data_struct::sections, bfd_mach_o_header::sizeofcmds, mach_o_data_struct::symbols, and TRUE.
| const bfd_target* bfd_mach_o_object_p | ( | bfd * | abfd | ) |
Definition at line 1701 of file mach-o.c.
References BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, bfd_error_wrong_format, bfd_mach_o_read_header(), bfd_mach_o_scan(), bfd_preserve_finish(), bfd_preserve_restore(), bfd_preserve_save(), bfd_set_error(), bfd_zalloc(), fail, fprintf(), bfd_preserve::marker, and NULL.
Definition at line 1868 of file mach-o.c.
References _bfd_new_bfd_contained_in(), mach_o_fat_archentry::abfd, adata, mach_o_fat_data_struct::archentries, BFD_ASSERT, bfd_error_bad_value, bfd_error_no_more_archived_files, bfd_malloc(), bfd_set_error(), bfd::filename, i, bfd::iostream, mach_o_fat_data_struct::nfat_arch, NULL, mach_o_fat_archentry::offset, bfd::origin, s, strcpy, and strlen().
| static const char* bfd_mach_o_ppc_flavour_string | ( | unsigned int | flavour | ) | [static] |
Definition at line 904 of file mach-o.c.
References BFD_MACH_O_PPC_EXCEPTION_STATE, BFD_MACH_O_PPC_FLOAT_STATE, BFD_MACH_O_PPC_THREAD_STATE, and BFD_MACH_O_PPC_VECTOR_STATE.
Referenced by bfd_mach_o_scan_read_thread().
| static void bfd_mach_o_print_symbol | ( | bfd * | abfd, | |
| PTR | afile, | |||
| asymbol * | symbol, | |||
| bfd_print_symbol_type | how | |||
| ) | [static] |
Definition at line 317 of file mach-o.c.
References bfd_print_symbol_name, bfd_print_symbol_vandf(), fprintf(), bfd_symbol::name, bfd_section::name, PTR, and bfd_symbol::section.
| static int bfd_mach_o_read_header | ( | bfd * | abfd, | |
| bfd_mach_o_header * | header | |||
| ) | [static] |
Definition at line 495 of file mach-o.c.
References bfd_bread(), BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN, bfd_getb32(), bfd_getl32(), bfd_seek(), buf, bfd_mach_o_header::byteorder, bfd_mach_o_header::cpusubtype, bfd_mach_o_header::cputype, bfd_mach_o_header::filetype, bfd_mach_o_header::flags, get32(), bfd_mach_o_header::magic, bfd_mach_o_header::ncmds, NULL, PTR, SEEK_SET, and bfd_mach_o_header::sizeofcmds.
Referenced by bfd_mach_o_core_p(), and bfd_mach_o_object_p().
| int bfd_mach_o_scan | ( | bfd * | abfd, | |
| bfd_mach_o_header * | header, | |||
| bfd_mach_o_data_struct * | mdata | |||
| ) |
Definition at line 1611 of file mach-o.c.
References bfd_alloc(), bfd_arch_unknown, BFD_IN_MEMORY, BFD_IO_FUNCS, bfd_mach_o_convert_architecture(), bfd_mach_o_flatten_sections(), bfd_mach_o_scan_read_command(), bfd_mach_o_scan_start_address(), bfd_set_arch_mach, mach_o_data_struct::commands, bfd_mach_o_header::cpusubtype, bfd_mach_o_header::cputype, cur, fprintf(), mach_o_data_struct::header, i, bfd_mach_o_load_command::len, bfd_mach_o_header::ncmds, NULL, bfd_mach_o_load_command::offset, prev, and mach_o_data_struct::symbols.
Referenced by bfd_mach_o_core_p(), and bfd_mach_o_object_p().
| static int bfd_mach_o_scan_read_command | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1441 of file mach-o.c.
References bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_DYSYMTAB, BFD_MACH_O_LC_FVMFILE, BFD_MACH_O_LC_ID_DYLIB, BFD_MACH_O_LC_ID_DYLINKER, BFD_MACH_O_LC_IDENT, BFD_MACH_O_LC_IDFVMLIB, BFD_MACH_O_LC_LOAD_DYLIB, BFD_MACH_O_LC_LOAD_DYLINKER, BFD_MACH_O_LC_LOAD_WEAK_DYLIB, BFD_MACH_O_LC_LOADFVMLIB, BFD_MACH_O_LC_PREBIND_CKSUM, BFD_MACH_O_LC_PREBOUND_DYLIB, BFD_MACH_O_LC_PREPAGE, BFD_MACH_O_LC_REQ_DYLD, BFD_MACH_O_LC_ROUTINES, BFD_MACH_O_LC_SEGMENT, BFD_MACH_O_LC_SUB_CLIENT, BFD_MACH_O_LC_SUB_FRAMEWORK, BFD_MACH_O_LC_SUB_LIBRARY, BFD_MACH_O_LC_SUB_UMBRELLA, BFD_MACH_O_LC_SYMSEG, BFD_MACH_O_LC_SYMTAB, BFD_MACH_O_LC_THREAD, BFD_MACH_O_LC_TWOLEVEL_HINTS, BFD_MACH_O_LC_UNIXTHREAD, bfd_mach_o_scan_read_dylib(), bfd_mach_o_scan_read_dylinker(), bfd_mach_o_scan_read_dysymtab(), bfd_mach_o_scan_read_prebound_dylib(), bfd_mach_o_scan_read_segment(), bfd_mach_o_scan_read_symtab(), bfd_mach_o_scan_read_thread(), bfd_seek(), buf, fprintf(), bfd_mach_o_load_command::len, bfd_mach_o_load_command::offset, PTR, SEEK_SET, bfd_mach_o_load_command::type, and bfd_mach_o_load_command::type_required.
Referenced by bfd_mach_o_scan().
| static int bfd_mach_o_scan_read_dylib | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1004 of file mach-o.c.
References abort, bfd_section::alignment_power, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_ID_DYLIB, BFD_MACH_O_LC_LOAD_DYLIB, BFD_MACH_O_LC_LOAD_WEAK_DYLIB, bfd_make_section_anyway(), bfd_seek(), buf, cmd, bfd_mach_o_load_command::command, bfd_mach_o_dylib_command::compatibility_version, bfd_mach_o_dylib_command::current_version, bfd_mach_o_load_command::dylib, bfd_section::filepos, bfd_section::flags, bfd_mach_o_load_command::len, bfd_section::lma, bfd_mach_o_dylib_command::name_len, bfd_mach_o_dylib_command::name_offset, NULL, bfd_mach_o_load_command::offset, prefix, PTR, SEC_HAS_CONTENTS, bfd_mach_o_dylib_command::section, SEEK_SET, bfd_section::size, strcpy, strlen(), bfd_mach_o_dylib_command::timestamp, bfd_mach_o_load_command::type, and bfd_section::vma.
Referenced by bfd_mach_o_scan_read_command().
| static int bfd_mach_o_scan_read_dylinker | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 952 of file mach-o.c.
References abort, bfd_section::alignment_power, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_ID_DYLINKER, BFD_MACH_O_LC_LOAD_DYLINKER, bfd_make_section_anyway(), bfd_seek(), buf, cmd, bfd_mach_o_load_command::command, bfd_mach_o_load_command::dylinker, bfd_section::filepos, bfd_section::flags, bfd_mach_o_load_command::len, bfd_section::lma, bfd_mach_o_dylinker_command::name_len, bfd_mach_o_dylinker_command::name_offset, NULL, bfd_mach_o_load_command::offset, prefix, PTR, SEC_HAS_CONTENTS, bfd_mach_o_dylinker_command::section, SEEK_SET, bfd_section::size, strcpy, strlen(), bfd_mach_o_load_command::type, and bfd_section::vma.
Referenced by bfd_mach_o_scan_read_command().
| static int bfd_mach_o_scan_read_dysymtab | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1211 of file mach-o.c.
References BFD_ASSERT, bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_DYSYMTAB, bfd_seek(), buf, bfd_mach_o_load_command::command, bfd_mach_o_load_command::dysymtab, bfd_mach_o_dysymtab_command::extrefsymoff, bfd_mach_o_dysymtab_command::extreloff, bfd_mach_o_dysymtab_command::iextdefsym, bfd_mach_o_dysymtab_command::ilocalsym, bfd_mach_o_dysymtab_command::indirectsymoff, bfd_mach_o_dysymtab_command::iundefsym, bfd_mach_o_dysymtab_command::locreloff, bfd_mach_o_dysymtab_command::modtaboff, bfd_mach_o_dysymtab_command::nextdefsym, bfd_mach_o_dysymtab_command::nextrefsyms, bfd_mach_o_dysymtab_command::nextrel, bfd_mach_o_dysymtab_command::nindirectsyms, bfd_mach_o_dysymtab_command::nlocalsym, bfd_mach_o_dysymtab_command::nlocrel, bfd_mach_o_dysymtab_command::nmodtab, bfd_mach_o_dysymtab_command::ntoc, bfd_mach_o_dysymtab_command::nundefsym, bfd_mach_o_load_command::offset, PTR, SEEK_SET, bfd_mach_o_dysymtab_command::tocoff, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_scan_read_command().
| int bfd_mach_o_scan_read_dysymtab_symbol | ( | bfd * | abfd, | |
| bfd_mach_o_dysymtab_command * | dysym, | |||
| bfd_mach_o_symtab_command * | sym, | |||
| asymbol * | s, | |||
| unsigned long | i | |||
| ) |
Definition at line 856 of file mach-o.c.
References BFD_ASSERT, bfd_bread(), bfd_h_get_32, bfd_mach_o_scan_read_symtab_symbol(), bfd_seek(), buf, fprintf(), bfd_mach_o_dysymtab_command::indirectsymoff, PTR, and SEEK_SET.
| static int bfd_mach_o_scan_read_prebound_dylib | ( | abfd | , | |
| command | ||||
| ) | [static] |
Definition at line 1062 of file mach-o.c.
References BFD_ASSERT, and BFD_MACH_O_LC_PREBOUND_DYLIB.
Referenced by bfd_mach_o_scan_read_command().
| static int bfd_mach_o_scan_read_section | ( | bfd * | abfd, | |
| bfd_mach_o_section * | section, | |||
| bfd_vma | offset | |||
| ) | [static] |
Definition at line 573 of file mach-o.c.
References bfd_mach_o_section::addr, bfd_mach_o_section::align, bfd_bread(), bfd_h_get_32, bfd_mach_o_make_bfd_section(), bfd_seek(), bfd_mach_o_section::bfdsection, buf, bfd_mach_o_section::flags, memcpy, bfd_mach_o_section::nreloc, NULL, bfd_mach_o_section::offset, PTR, bfd_mach_o_section::reloff, bfd_mach_o_section::reserved1, bfd_mach_o_section::reserved2, bfd_mach_o_section::sectname, SEEK_SET, bfd_mach_o_section::segname, and bfd_mach_o_section::size.
Referenced by bfd_mach_o_scan_read_segment().
| static int bfd_mach_o_scan_read_segment | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1311 of file mach-o.c.
References bfd_section::alignment_power, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_SEGMENT, bfd_mach_o_scan_read_section(), bfd_make_section_anyway(), bfd_seek(), buf, bfd_mach_o_load_command::command, bfd_mach_o_segment_command::fileoff, bfd_section::filepos, bfd_mach_o_segment_command::filesize, bfd_mach_o_segment_command::flags, bfd_section::flags, i, bfd_section::lma, memcpy, bfd_mach_o_segment_command::nsects, NULL, bfd_mach_o_load_command::offset, prefix, PTR, SEC_ALLOC, SEC_CODE, SEC_HAS_CONTENTS, SEC_LOAD, bfd_mach_o_segment_command::sections, SEEK_SET, bfd_mach_o_segment_command::segment, bfd_mach_o_load_command::segment, bfd_mach_o_segment_command::segname, bfd_section::size, sprintf(), strlen(), bfd_mach_o_load_command::type, bfd_section::vma, bfd_mach_o_segment_command::vmaddr, and bfd_mach_o_segment_command::vmsize.
Referenced by bfd_mach_o_scan_read_command().
| static int bfd_mach_o_scan_read_symtab | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1247 of file mach-o.c.
References bfd_section::alignment_power, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_h_get_32, BFD_MACH_O_LC_SYMTAB, bfd_make_section_anyway(), bfd_seek(), buf, bfd_mach_o_load_command::command, bfd_section::filepos, bfd_section::flags, bfd_section::lma, bfd_mach_o_symtab_command::nsyms, NULL, bfd_mach_o_load_command::offset, prefix, PTR, SEC_HAS_CONTENTS, SEEK_SET, bfd_section::size, bfd_mach_o_symtab_command::stabs_segment, bfd_mach_o_symtab_command::stabstr_segment, strcpy, strlen(), bfd_mach_o_symtab_command::stroff, bfd_mach_o_symtab_command::strsize, bfd_mach_o_symtab_command::strtab, bfd_mach_o_symtab_command::symbols, bfd_mach_o_symtab_command::symoff, bfd_mach_o_load_command::symtab, bfd_mach_o_load_command::type, and bfd_section::vma.
Referenced by bfd_mach_o_scan_read_command().
| int bfd_mach_o_scan_read_symtab_strtab | ( | bfd * | abfd, | |
| bfd_mach_o_symtab_command * | sym | |||
| ) |
Definition at line 788 of file mach-o.c.
References b, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_error_file_truncated, BFD_IN_MEMORY, bfd_seek(), bfd_set_error(), bfd_in_memory::buffer, fprintf(), if(), NULL, PTR, SEEK_SET, bfd_in_memory::size, bfd_mach_o_symtab_command::stroff, bfd_mach_o_symtab_command::strsize, and bfd_mach_o_symtab_command::strtab.
Referenced by bfd_mach_o_scan_read_symtab_symbols().
| int bfd_mach_o_scan_read_symtab_symbol | ( | bfd * | abfd, | |
| bfd_mach_o_symtab_command * | sym, | |||
| asymbol * | s, | |||
| unsigned long | i | |||
| ) |
Definition at line 675 of file mach-o.c.
References bfd_mach_o_section::addr, bfd_abs_section_ptr, BFD_ASSERT, bfd_bread(), bfd_h_get_16, bfd_h_get_32, bfd_h_get_8, BFD_MACH_O_N_ABS, BFD_MACH_O_N_EXT, BFD_MACH_O_N_INDR, BFD_MACH_O_N_PBUD, BFD_MACH_O_N_PEXT, BFD_MACH_O_N_SECT, BFD_MACH_O_N_STAB, BFD_MACH_O_N_UNDF, bfd_seek(), bfd_und_section_ptr, bfd_mach_o_section::bfdsection, BSF_DEBUGGING, BSF_GLOBAL, buf, bfd_symbol::flags, fprintf(), bfd_symbol::i, bfd_symbol::name, mach_o_data_struct::nsects, NULL, PTR, bfd_symbol::section, mach_o_data_struct::sections, SEEK_SET, bfd_mach_o_symtab_command::strsize, bfd_mach_o_symtab_command::strtab, bfd_mach_o_symtab_command::symoff, bfd_symbol::the_bfd, bfd_symbol::udata, and bfd_symbol::value.
Referenced by bfd_mach_o_scan_read_dysymtab_symbol(), and bfd_mach_o_scan_read_symtab_symbols().
| int bfd_mach_o_scan_read_symtab_symbols | ( | bfd * | abfd, | |
| bfd_mach_o_symtab_command * | sym | |||
| ) |
Definition at line 825 of file mach-o.c.
References bfd_alloc(), BFD_ASSERT, bfd_mach_o_scan_read_symtab_strtab(), bfd_mach_o_scan_read_symtab_symbol(), fprintf(), i, bfd_mach_o_symtab_command::nsyms, NULL, ret, and bfd_mach_o_symtab_command::symbols.
Referenced by bfd_mach_o_canonicalize_symtab().
| static int bfd_mach_o_scan_read_thread | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1073 of file mach-o.c.
References bfd_section::alignment_power, bfd_alloc(), BFD_ASSERT, bfd_bread(), bfd_get_section_by_name(), bfd_h_get_32, BFD_MACH_O_CPU_TYPE_I386, BFD_MACH_O_CPU_TYPE_POWERPC, bfd_mach_o_i386_flavour_string(), BFD_MACH_O_LC_THREAD, BFD_MACH_O_LC_UNIXTHREAD, bfd_mach_o_ppc_flavour_string(), bfd_mach_o_valid(), bfd_make_section(), bfd_seek(), buf, cmd, bfd_mach_o_load_command::command, bfd_mach_o_header::cputype, bfd_section::filepos, bfd_section::flags, bfd_mach_o_thread_flavour::flavour, bfd_mach_o_thread_command::flavours, mach_o_data_struct::header, i, bfd_mach_o_load_command::len, bfd_section::lma, bfd_mach_o_thread_command::nflavours, NULL, bfd_mach_o_thread_flavour::offset, bfd_mach_o_load_command::offset, offset, prefix, PTR, SEC_HAS_CONTENTS, bfd_mach_o_thread_command::section, SEEK_SET, bfd_section::size, bfd_mach_o_thread_flavour::size, sprintf(), strlen(), bfd_mach_o_load_command::thread, bfd_mach_o_load_command::type, and bfd_section::vma.
Referenced by bfd_mach_o_scan_read_command().
| int bfd_mach_o_scan_start_address | ( | bfd * | abfd | ) |
Definition at line 1556 of file mach-o.c.
References bfd_bread(), bfd_h_get_32, BFD_MACH_O_CPU_TYPE_I386, BFD_MACH_O_CPU_TYPE_POWERPC, BFD_MACH_O_i386_THREAD_STATE, BFD_MACH_O_LC_THREAD, BFD_MACH_O_LC_UNIXTHREAD, BFD_MACH_O_PPC_THREAD_STATE, bfd_seek(), buf, cmd, bfd_mach_o_load_command::command, mach_o_data_struct::commands, bfd_mach_o_header::cputype, bfd_mach_o_thread_flavour::flavour, bfd_mach_o_thread_command::flavours, mach_o_data_struct::header, i, bfd_mach_o_header::ncmds, bfd_mach_o_thread_command::nflavours, NULL, bfd_mach_o_thread_flavour::offset, SEEK_SET, bfd_mach_o_load_command::thread, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_scan().
| static int bfd_mach_o_scan_write_section | ( | bfd * | abfd, | |
| bfd_mach_o_section * | section, | |||
| bfd_vma | offset | |||
| ) | [static] |
Definition at line 606 of file mach-o.c.
References bfd_mach_o_section::addr, bfd_mach_o_section::align, bfd_bwrite(), bfd_h_put_32, bfd_seek(), buf, bfd_mach_o_section::flags, memcpy, bfd_mach_o_section::nreloc, bfd_mach_o_section::offset, PTR, bfd_mach_o_section::reloff, bfd_mach_o_section::sectname, SEEK_SET, bfd_mach_o_section::segname, and bfd_mach_o_section::size.
Referenced by bfd_mach_o_scan_write_segment().
| static int bfd_mach_o_scan_write_segment | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1380 of file mach-o.c.
References BFD_ASSERT, bfd_bread(), bfd_bwrite(), bfd_h_put_32, BFD_MACH_O_LC_SEGMENT, bfd_mach_o_scan_write_section(), bfd_seek(), buf, bfd_mach_o_load_command::command, bfd_mach_o_segment_command::fileoff, bfd_mach_o_segment_command::filesize, bfd_mach_o_segment_command::flags, i, memcpy, bfd_mach_o_segment_command::nsects, bfd_mach_o_load_command::offset, PTR, bfd_mach_o_segment_command::sections, SEEK_SET, bfd_mach_o_load_command::segment, bfd_mach_o_segment_command::segname, bfd_mach_o_load_command::type, bfd_mach_o_segment_command::vmaddr, and bfd_mach_o_segment_command::vmsize.
Referenced by bfd_mach_o_write_contents().
| static int bfd_mach_o_scan_write_symtab | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 1186 of file mach-o.c.
References BFD_ASSERT, bfd_bwrite(), bfd_h_put_32, BFD_MACH_O_LC_SYMTAB, bfd_mach_o_scan_write_symtab_symbols(), bfd_seek(), buf, bfd_mach_o_load_command::command, bfd_mach_o_symtab_command::nsyms, bfd_mach_o_load_command::offset, PTR, SEEK_SET, bfd_mach_o_symtab_command::stroff, bfd_mach_o_symtab_command::strsize, bfd_mach_o_symtab_command::symoff, bfd_mach_o_load_command::symtab, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_write_contents().
| static int bfd_mach_o_scan_write_symtab_symbols | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 633 of file mach-o.c.
References bfd_bwrite(), bfd_h_put_16, bfd_h_put_32, bfd_h_put_8, bfd_seek(), buf, bfd_mach_o_load_command::command, fprintf(), i, bfd_symbol::i, bfd_symbol::name, bfd_mach_o_symtab_command::nsyms, NULL, PTR, s, bfd_symbol::section, SEEK_SET, bfd_mach_o_symtab_command::strtab, sym, bfd_mach_o_symtab_command::symbols, bfd_mach_o_symtab_command::symoff, bfd_mach_o_load_command::symtab, bfd_symbol::udata, bfd_symbol::value, and bfd_section::vma.
Referenced by bfd_mach_o_scan_write_symtab().
| static int bfd_mach_o_scan_write_thread | ( | bfd * | abfd, | |
| bfd_mach_o_load_command * | command | |||
| ) | [static] |
Definition at line 918 of file mach-o.c.
References BFD_ASSERT, bfd_bwrite(), bfd_h_put_32, BFD_MACH_O_LC_THREAD, BFD_MACH_O_LC_UNIXTHREAD, bfd_seek(), buf, cmd, bfd_mach_o_load_command::command, bfd_mach_o_thread_flavour::flavour, bfd_mach_o_thread_command::flavours, i, bfd_mach_o_thread_command::nflavours, bfd_mach_o_thread_flavour::offset, bfd_mach_o_load_command::offset, offset, PTR, SEEK_SET, bfd_mach_o_thread_flavour::size, bfd_mach_o_load_command::thread, and bfd_mach_o_load_command::type.
Referenced by bfd_mach_o_write_contents().
| unsigned long bfd_mach_o_stack_addr | ( | enum bfd_mach_o_cpu_type | type | ) |
Definition at line 2011 of file mach-o.c.
References BFD_MACH_O_CPU_TYPE_HPPA, BFD_MACH_O_CPU_TYPE_I386, BFD_MACH_O_CPU_TYPE_I860, BFD_MACH_O_CPU_TYPE_MC680x0, BFD_MACH_O_CPU_TYPE_MC88000, BFD_MACH_O_CPU_TYPE_POWERPC, and BFD_MACH_O_CPU_TYPE_SPARC.
Referenced by bfd_mach_o_core_fetch_environment().
| bfd_boolean bfd_mach_o_valid | ( | bfd * | abfd | ) |
Definition at line 176 of file mach-o.c.
References mach_o_be_vec, mach_o_fat_vec, mach_o_le_vec, and NULL.
Referenced by bfd_mach_o_bfd_copy_private_bfd_data(), bfd_mach_o_count_symbols(), and bfd_mach_o_scan_read_thread().
| static bfd_boolean bfd_mach_o_write_contents | ( | bfd * | abfd | ) | [static] |
Definition at line 372 of file mach-o.c.
References bfd_bwrite(), bfd_h_put_32, BFD_MACH_O_LC_DYSYMTAB, BFD_MACH_O_LC_FVMFILE, BFD_MACH_O_LC_ID_DYLIB, BFD_MACH_O_LC_ID_DYLINKER, BFD_MACH_O_LC_IDENT, BFD_MACH_O_LC_IDFVMLIB, BFD_MACH_O_LC_LOAD_DYLIB, BFD_MACH_O_LC_LOAD_DYLINKER, BFD_MACH_O_LC_LOAD_WEAK_DYLIB, BFD_MACH_O_LC_LOADFVMLIB, BFD_MACH_O_LC_PREBOUND_DYLIB, BFD_MACH_O_LC_PREPAGE, BFD_MACH_O_LC_REQ_DYLD, BFD_MACH_O_LC_ROUTINES, BFD_MACH_O_LC_SEGMENT, BFD_MACH_O_LC_SUB_FRAMEWORK, BFD_MACH_O_LC_SYMSEG, BFD_MACH_O_LC_SYMTAB, BFD_MACH_O_LC_THREAD, BFD_MACH_O_LC_UNIXTHREAD, bfd_mach_o_scan_write_segment(), bfd_mach_o_scan_write_symtab(), bfd_mach_o_scan_write_thread(), bfd_mach_o_write_header(), bfd_seek(), buf, mach_o_data_struct::commands, cur, FALSE, fprintf(), mach_o_data_struct::header, i, bfd_mach_o_load_command::len, bfd_mach_o_header::ncmds, bfd_section::next, NULL, bfd_mach_o_load_command::offset, PTR, s, SEEK_SET, TRUE, bfd_mach_o_load_command::type, and bfd_mach_o_load_command::type_required.
| static int bfd_mach_o_write_header | ( | bfd * | abfd, | |
| bfd_mach_o_header * | header | |||
| ) | [static] |
Definition at line 473 of file mach-o.c.
References bfd_bwrite(), bfd_h_put_32, bfd_seek(), buf, bfd_mach_o_header::cpusubtype, bfd_mach_o_header::cputype, bfd_mach_o_header::filetype, bfd_mach_o_header::flags, bfd_mach_o_header::magic, bfd_mach_o_header::ncmds, PTR, SEEK_SET, and bfd_mach_o_header::sizeofcmds.
Referenced by bfd_mach_o_write_contents().
| static const char* bfd_mach_o_i386_flavour_string PARAMS | ( | (unsigned int) | ) | [static] |
| static int bfd_mach_o_scan_write_symtab_symbols PARAMS | ( | (bfd *, bfd_mach_o_load_command *) | ) | [static] |
| static int bfd_mach_o_scan_read_section PARAMS | ( | (bfd *, bfd_mach_o_section *, bfd_vma) | ) | [static] |
| static asection* bfd_mach_o_make_bfd_section PARAMS | ( | (bfd *, bfd_mach_o_section *) | ) | [static] |
| static int bfd_mach_o_write_header PARAMS | ( | (bfd *, bfd_mach_o_header *) | ) | [static] |
| static int bfd_mach_o_sizeof_headers PARAMS | ( | (bfd *, bfd_boolean) | ) | [static] |
| static void bfd_mach_o_convert_architecture PARAMS | ( | (bfd_mach_o_cpu_type, bfd_mach_o_cpu_subtype, enum bfd_architecture *, unsigned long *) | ) | [static] |
| static void bfd_mach_o_print_symbol PARAMS | ( | (bfd *, PTR, asymbol *, bfd_print_symbol_type) | ) | [static] |
| static void bfd_mach_o_get_symbol_info PARAMS | ( | (bfd *, asymbol *, symbol_info *) | ) | [static] |
| static bfd_boolean bfd_mach_o_bfd_copy_private_section_data PARAMS | ( | (bfd *, asection *, bfd *, asection *) | ) | [static] |
| static bfd_boolean bfd_mach_o_bfd_copy_private_symbol_data PARAMS | ( | (bfd *, asymbol *, bfd *, asymbol *) | ) | [static] |
1.5.6