aboutsummaryrefslogtreecommitdiff
path: root/include/mach-o
AgeCommit message (Collapse)AuthorFilesLines
2021-01-01Update year range in copyright notice of binutils filesAlan Modra8-8/+8
2020-06-22Recognize some new Mach-O load commandsSaagar Jha1-0/+2
bfd * mach-o.c: Support the new load commands by reading a linkedit data command for them. binutils * od-macho.c: Dump linkedit data for new load commands. include * mach-o/loader.h: Add declarations of two new Mach-O load commands.
2020-01-01Update year range in copyright notice of binutils filesAlan Modra8-8/+8
2019-02-15Use the correct name for various MACH-O based operating systems in comments.Saagar Jha1-3/+3
include * mach-o/loader.h: Use new OS names in comments.
2019-01-01Update year range in copyright notice of binutils filesAlan Modra8-8/+8
2018-11-07Add support for new load commands added by Apple to the MACH-O file format.Roman Bolshakov2-28/+45
bfd * mach-o.h: Add new enums for BFD_MACH_O_PLATFORM_MACOS, BFD_MACH_O_PLATFORM_IOS, BFD_MACH_O_PLATFORM_TVOS, BFD_MACH_O_PLATFORM_WATCHOS, BFD_MACH_O_PLATFORM_BRIDGEOS, BFD_MACH_O_TOOL_CLANG, BFD_MACH_O_TOOL_SWIFT, BFD_MACH_O_TOOL_LD. (struct bfd_mach_o_note_command): New. (struct bfd_mach_o_build_version_tool): New. (struct bfd_mach_o_build_version_command): New. (bfd_mach_o_read_version_min): Don't split version into a few fields. Rename reserved to sdk. * mach-o.c (bfd_mach_o_read_version_min): Don't split version into a few fields. Rename reserved to sdk. (bfd_mach_o_read_command): Handle LC_VERSION_MIN_TVOS, LC_NOTE, LC_BUILD_VERSION. (bfd_mach_o_read_note): New. (bfd_mach_o_read_build_version): New. PR 23728 binutils* od-macho.c (printf_version): New. (dump_load_command): Use it to print version. Print sdk version. Print version info for watchOS and tvOS. Print LC_NOTE, LC_BUILD_VERSION. (dump_buld_version): New. (bfd_mach_o_platform_name): New (bfd_mach_o_tool_name): New * mach-o/external.h (mach_o_nversion_min_command_external): Rename reserved to sdk. (mach_o_note_command_external): New. (mach_o_build_version_command_external): New. * mach-o/loader.h (BFD_MACH_O_LC_VERSION_MIN_TVOS): Define. (BFD_MACH_O_LC_NOTE): Define.
2018-11-06Add support for a couple of new Mach-O commands.Nick Clifton1-1/+2
PR 23742 * mach-o.c (bfd_mach_o_read_command): Accept and ignore BFD_MACH_O_LC_LINKER_OPTIONS and BFD_MACH_O_LC_BUILD_VERSION commands. * mach-o/loader.h: Add BFD_MACH_O_LC_BUILD_VERSION.
2018-05-09PR22069, Several instances of register accidentally spelled as regsiterAlan Modra1-2/+2
PR 22069 binutils/ * od-macho.c (dump_unwind_encoding_x86): Adjust for macro renaming. cpu/ChangeLog * or1kcommon.cpu (spr-reg-info): Typo fix. include/ChangeLog * mach-o/unwind.h (MACH_O_UNWIND_X86_64_RBP_FRAME_REGISTERS): Rename from MACH_O_UNWIND_X86_64_RBP_FRAME_REGSITERS. (MACH_O_UNWIND_X86_EBP_FRAME_REGISTERS): Rename from MACH_O_UNWIND_X86_EBP_FRAME_REGSITERS. opcodes/ChangeLog * cr16-opc.c (cr16_instruction): Comment typo fix. * hppa-dis.c (print_insn_hppa): Likewise. sim/ppc/ChangeLog * e500_registers.h: Comment typo fix. * ppc-instructions (ppc_insn_mfcr): Likewise.
2018-01-03Update year range in copyright notice of binutils filesAlan Modra8-8/+8
2017-07-18Fix spelling typos.Yuri Chornovian1-1/+1
2017-01-02Update year range in copyright notice of all files.Alan Modra8-8/+8
2016-01-01Copyright update for binutilsAlan Modra8-8/+8
2016-01-01binutils ChangeLog rotationAlan Modra1-0/+0
2015-12-03Darwin: add new mach-o header flags.Tristan Gingold2-1/+7
binutils/ * od-macho.c (bfd_mach_o_header_flags_name): Add name for flags until BFD_MACH_O_MH_APP_EXTENSION_SAFE. include/mach-o/ * loader.h (bfd_mach_o_header_flags): Add BFD_MACH_O_MH_APP_EXTENSION_SAFE.
2015-11-17Mach-O: add new defines and struct for darwin 14.5Tristan Gingold5-2/+158
include/mach-o/ * arm64.h: New file. * unwind.h: Add arm64 encodings. * loader.h (bfd_mach_o_cpu_subtype): Add arm64 literals. (BFD_MACH_O_LC_ENCRYPTION_INFO_64, BFD_MACH_O_LC_LINKER_OPTIONS) (BFD_MACH_O_LC_LINKER_OPTIMIZATION_HINT) (BFD_MACH_O_LC_VERSION_MIN_WATCHOS): Define. * external.h (mach_o_encryption_info_64_command_external): (mach_o_linker_option_command_external) (mach_o_dyld_cache_header_external) (mach_o_dyld_cache_mapping_info_external) (mach_o_dyld_cache_image_info_external): New types.
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra8-8/+12
2014-04-16Mach-O: Add objdump -P dyld_info to dump dyld data.Tristan Gingold2-0/+61
include/mach-o/ * loader.h: Add macros for rebase, bind and export constants. binutils/ * od-macho.c (OPT_DYLD_INFO): New macro. (options): Add entry for dyld_info. (mach_o_help): Likewise. (load_and_dump, dump_dyld_info_rebase, dump_dyld_info_bind) (dump_dyld_info_export_1, dump_dyld_info_export): New functions. (bfd_mach_o_dyld_rebase_type_name): New array. (export_info_data): New struct. (dump_dyld_info): Add verbose argument. Dump rebase, bind and exports data. (dump_load_command): Adjust dump_dyld_info call. (mach_o_dump): Handle dyld_info.
2014-04-16Mach-O: add cpu and cpusubtype caps.Tristan Gingold2-1/+13
include/mach-o/ 2014-04-16 Tristan Gingold <gingold@adacore.com> * loader.h (BFD_MACH_O_CPU_ARCH_MASK, BFD_MACH_O_CPU_ARCH_ABI64) (BFD_MACH_O_CPU_SUBTYPE_MASK, BFD_MACH_O_CPU_SUBTYPE_LIB64): Define. bfd/ 2014-04-16 Tristan Gingold <gingold@adacore.com> * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype flag.
2014-04-03mach-o: fix warnings on 32 bit hosts. Display personality functions.Tristan Gingold2-1/+5
binutils/ * od-macho.c (printf_uint64): New function. (dump_load_command, dump_obj_compact_unwind): Use it. (dump_exe_compact_unwind): Display personality functions. include/mach-o/ * unwind.h (mach_o_compact_unwind_64): Fix typo in personality.
2014-04-02mach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.Tristan Gingold2-0/+24
include/mach-o: * external.h (mach_o_prebound_dylib_command_external) (mach_o_prebind_cksum_command_external) (mach_o_twolevel_hints_command_external): New types. bfd/ * mach-o.h (bfd_mach_o_twolevel_hints_command) (bfd_mach_o_prebind_cksum_command): New types. (bfd_mach_o_prebound_dylib_command): Rewrite. (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints fields. * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the command. (bfd_mach_o_read_prebind_cksum): New function. (bfd_mach_o_read_twolevel_hints): Ditto. (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints commands. binutils/ * od-macho.c (OPT_TWOLEVEL_HINTS): New macro. (options): Add entry for twolevel_hints. (dump_data_in_code): Fix error message. (dump_twolevel_hints): New function. (dump_load_command): Handle prebound dylib, prebind cksum and twolevel hints. (mach_o_dump): Handle twolevel hints.
2014-03-26Mach-O: Add BFD_MACH_O_CPU_TYPE_ARM64.Tristan Gingold2-3/+11
include/mach-o/ * loader.h (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_ARM64. bfd/ * mach-o.c (bfd_mach_o_convert_architecture): Add BFD_MACH_O_CPU_TYPE_ARM64. binutils/ * od-macho.c (bfd_mach_o_cpu_name): Add BFD_MACH_O_CPU_TYPE_ARM64.
2014-03-17od-macho: dump compact unwind info.Tristan Gingold2-0/+203
binutils/ * od-macho.c (dump_section_header): Renames of dump_section. (dump_segment): Adjust after renaming. (OPT_COMPACT_UNWIND): Define. (options): Add compact unwind. (mach_o_help): Document compact_unwind. (unwind_x86_64_regs, unwind_x86_regs): New arrays. (dump_unwind_encoding_x86, dump_unwind_encoding) (dump_obj_compact_unwind, dump_exe_compact_unwind) (dump_section_content): New functions. (mach_o_dump): Handle compact unwind. include/mach-o/ * unwind.h: New file.
2014-03-05Update copyright yearsAlan Modra7-13/+11
2012-12-10Add copyright noticesNick Clifton1-1/+13
2012-11-142012-11-14 Tristan Gingold <gingold@adacore.com>Tristan Gingold3-8/+62
* external.h (mach_o_entry_point_command_external) (mach_o_source_version_command_external) (mach_o_data_in_code_entry_external): New structures. * loader.h (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_MAIN, BFD_MACH_O_LC_DATA_IN_CODE, BFD_MACH_O_LC_SOURCE_VERSION and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS. (BFD_MACH_O_REFERENCE_MASK): Adjust value. (BFD_MACH_O_N_REF_TO_WEAK): New definition. (BFD_MACH_O_N_ARM_THUMB_DEF, BFD_MACH_O_N_SYMBOL_RESOLVER): Likewise. (bfd_mach_o_data_in_code_entry_kind): New enum.
2012-11-142012-11-14 Tristan Gingold <gingold@adacore.com>Tristan Gingold2-0/+41
* arm.h: New file.
2012-02-23deal with endian-ness in mach-o non-scattered relocs.Iain Sandoe3-21/+48
BFD: * mach-o.c (bfd_mach_o_swap_in_non_scattered_reloc): New. (bfd_mach_o_canonicalize_one_reloc): Swap non-scattered reloc bit-fields when target and host differ in endian-ness. When PAIRs are non-scattered find the 'symbol' from the preceding reloc. Add FIXME re. reloc symbols on section boundaries. (bfd_mach_o_swap_out_non_scattered_reloc): New. (bfd_mach_o_write_relocs): Use bfd_mach_o_encode_non_scattered_reloc. include/mach-o: * external.h: Add comments about relocations fields. Add macros for non-scattered relocations. Move scattered relocation macros to here. * reloc.h: Remove macros related to external representation of reloc fields.
2012-01-12add indirect_symbol to mach-o port.Iain Sandoe2-0/+8
bfd: * mach-o.c (bfd_mach_o_count_indirect_symbols): New. (bfd_mach_o_build_dysymtab_command): Populate indirect symbol table. * mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the file. (bfd_mach_o_section): Add indirect_syms field. gas: * config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Switch off lazy when the symbol is private_extern. (obj_mach_o_indirect_sym): New type. (obj_mach_o_indirect_symbol): New. (mach_o_pseudo_table): Use obj_mach_o_indirect_symbol. (obj_macho_frob_label): Adjust to avoid adding bsyms for locals. (obj_macho_frob_label): Likewise. Adjust external and comm symbol tests. (obj_mach_o_set_indirect_symbols): New. (obj_mach_o_frob_file_after_relocs): New. *config/obj-macho.h (obj_frob_file_after_relocs): Define. (obj_mach_o_frob_file_after_relocs): Declare. include/mach-o: * loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New. (BFD_MACH_O_INDIRECT_SYM_ABS): New gas/testsuite: * gas/mach-o/dysymtab-2.d: New. * gas/mach-o/err-syms-4.s: New. * gas/mach-o/err-syms-5.s: New. * gas/mach-o/err-syms-6.s: New. * gas/mach-o/symbols-6-64.d: New. * gas/mach-o/symbols-6-64.s: New. * gas/mach-o/symbols-6.d: New. * gas/mach-o/symbols-6.s: New.
2012-01-04bfd/Tristan Gingold2-0/+11
2012-01-04 Tristan Gingold <gingold@adacore.com> * mach-o.h (bfd_mach_o_fvmlib_command): New structure. (bfd_mach_o_load_command): Add fvmlib field. * mach-o.c (bfd_mach_o_read_fvmlib): New function. (bfd_mach_o_read_command): Handle fvmlib. binutils/ 2012-01-04 Tristan Gingold <gingold@adacore.com> * od-macho.c (dump_load_command): Handle fvmlib. include/mach-o/ 2012-01-04 Tristan Gingold <gingold@adacore.com> * external.h (mach_o_fvmlib_command_external): New structure.
2012-01-04bfd/Tristan Gingold2-2/+16
2012-01-04 Tristan Gingold <gingold@adacore.com> * mach-o.c (bfd_mach_o_convert_architecture): Reindent. Decode msubtype for ARM. include/mach-o/ 2012-01-04 Tristan Gingold <gingold@adacore.com> * loader.h: Update copyright year. (bfd_mach_o_cpu_subtype): Add ARM subtypes.
2012-01-04bfd/Tristan Gingold2-5/+18
2012-01-04 Tristan Gingold <gingold@adacore.com> * mach-o.h: Reindent header. (bfd_mach_o_encryption_info_command): New structure. (bfd_mach_o_load_command): Add encryption_info field. * mach-o.c (bfd_mach_o_read_encryption_info): New function. (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO. (bfd_mach_o_read_command): Adjust error message. binutils/ 2012-01-04 Tristan Gingold <gingold@adacore.com> * od-macho.c: Update copyright year. (dump_load_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO. include/mach-o/ 2012-01-04 Tristan Gingold <gingold@adacore.com> * external.h: Update copyright year. (mach_o_symtab_command_external): Add comments. (mach_o_encryption_info_command_external): New structure.
2011-12-16binutils/Tristan Gingold2-0/+89
2011-12-16 Tristan Gingold <gingold@adacore.com> * od-macho.c: Include mach-o/codesign.h (OPT_CODESIGN): Define. (options): Add an entry for codesign. (mach_o_help): Likewise. (dump_header): Fix indentation. (dump_thread): Do not test result of xmalloc. (bfd_mach_o_cs_magic, bfd_mach_o_cs_hash_type): New. (dump_code_signature_superblob): New function. (swap_code_codedirectory_v1_in): Likewise. (hexdump): Likewise. (dump_code_signature_codedirectory): Likewise. (dump_code_signature_blob, dump_code_signature): Likewise. (dump_load_command): Dump code signature. (mach_o_dump): Likewise. include/mach-o/ 2011-12-16 Tristan Gingold <gingold@adacore.com> * codesign.h: New file.
2011-12-14bfd/Tristan Gingold1-0/+3
2011-12-14 Iain Sandoe <iains@gcc.gnu.org> * mach-o-i386.c (text_section_names_xlat): New table. (data_section_names_xlat): Likewise. (import_section_names_xlat): Likewise. (mach_o_i386_segsec_names_xlat): Likewise. (bfd_mach_o_tgt_seg_table): Use new tables. * mach-o-x86-64.c (bfd_mach_o_tgt_seg_table): Set NULL. * mach-o.c (mach_o_section_name_xlat, mach_o_segment_name_xlat): Move to mach-o.h as typedefs. (text_section_names_xlat): Update for current GCC usage. (data_section_names_xlat): Likewise. (dwarf_section_names_xlat): Likewise. (objc_section_names_xlat): New table. (segsec_names_xlat): Add objc table. (bfd_mach_o_normalize_section_name): Replace with... (bfd_mach_o_section_data_for_mach_sect): New. (bfd_mach_o_section_data_for_bfd_name): New. (bfd_mach_o_section_data_for_bfd_name): Update to use additional data. (bfd_mach_o_convert_section_name_to_mach_o): Likewise. (bfd_mach_o_bfd_copy_private_section_data): Implement. (bfd_mach_o_write_symtab): Write a zero-length string as the first entry for compatibility with system tools. (bfd_mach_o_build_commands): Update section alignment info. (bfd_mach_o_new_section_hook): Use translation table data to define default section flags, type, attributes and alignment, when available. (bfd_mach_o_init_section_from_mach_o): Add TODO comment. (bfd_mach_o_section_type_name): Add 'symbol_stubs'. (bfd_mach_o_section_attribute_name): Add 'self_modifying_code'. (bfd_mach_o_get_section_type_from_name): Change "not-found" return value. (bfd_mach_o_tgt_seg_table): Set default NULL. * mach-o.h (bfd_mach_o_segment_command): Use define for name length. (bfd_mach_o_backend_data): Move until after contents are defined. (bfd_mach_o_normalize_section_name): Remove. (bfd_mach_o_convert_section_name_to_bfd): Declare. (mach_o_section_name_xlat): Declare. (mach_o_segment_name_xlat): Declare. (bfd_mach_o_section_data_for_mach_sect): Declare. (bfd_mach_o_section_data_for_bfd_name): Declare. include/ 2011-12-14 Iain Sandoe <iains@gcc.gnu.org> * mach-o/loader.h (bfd_mach_o_section_type): define BFD_MACH_O_S_ATTR_NONE to 0. gas/ 2011-12-14 Iain Sandoe <iains@gcc.gnu.org> * config/obj-macho.c: Add some more top-level comments. (collect_16char_name): New. (obj_mach_o_section): Amend to allow syntax compatible with existing system tools. Use section translation data when available. (obj_mach_o_segT_from_bfd_name): New. (known_sections): Update. (obj_mach_o_known_section): Use obj_mach_o_segT_from_bfd_name. (objc_sections): New. (obj_mach_o_objc_section): New. (debug_sections): New. (obj_mach_o_debug_section): New. (tgt_sections): New. (obj_mach_o_opt_tgt_section): New. (obj_mach_o_base_section): New. (obj_mach_o_common_parse): Update to create BSS on demand and to handle lcomm optional alignment param. (obj_mach_o_comm): Update parameter name. (obj_mach_o_placeholder): New. (mach_o_pseudo_table): Update for GCC section directives. * config/obj-macho.h (_OBJ_MACH_O_H): New. (USE_ALIGN_PTWO): Define. (S_SET_ALIGN) Define.
2011-08-08bfd/Tristan Gingold3-1/+20
2011-08-08 Tristan Gingold <gingold@adacore.com> * mach-o.h (bfd_mach_o_version_min_command): New structure. (bfd_mach_o_load_command): Add version_min. (mach_o_data_struct): Fix comment. * mach-o.c (bfd_mach_o_read_version_min): New function. (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_FUNCTION_STARTS, BFD_MACH_O_LC_VERSION_MIN_MACOSX and BFD_MACH_O_LC_VERSION_MIN_IPHONEOS. (bfd_mach_o_get_name_or_null): New function. (bfd_mach_o_get_name): Use the above new one. (bfd_mach_o_load_command_name): Add the above new commands. (bfd_mach_o_bfd_print_private_bfd_data): Display numerically unknown commands. Handle BFD_MACH_O_LC_FUNCTION_STARTS, BFD_MACH_O_LC_VERSION_MIN_MACOSX and BFD_MACH_O_LC_VERSION_MIN_IPHONEOS. include/mach-o/ 2011-08-08 Tristan Gingold <gingold@adacore.com> * loader.h (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_LOAD_UPWARD_DYLIB, BFD_MACH_O_LC_VERSION_MIN_MACOSX, BFD_MACH_O_LC_VERSION_MIN_IPHONEOS, BFD_MACH_O_LC_FUNCTION_STARTS, and BFD_MACH_O_LC_DYLD_ENVIRONMENT. * external.h (mach_o_version_min_command_external): New structure.
2011-08-08bfd/Tristan Gingold5-123/+498
2011-08-08 Tristan Gingold <gingold@adacore.com> * mach-o.h: Move size macros to external.h Move reloc macros to reloc.h and x86-64.h. * mach-o-i386.c: Includes mach-o/reloc.h * mach-o-x86-64.c: Ditto and includes mach-o/x86-64.h * mach-o.c: Add includes. (bfd_mach_o_write_header): Use structure from external.h to convert. (bfd_mach_o_write_thread): Ditto. (bfd_mach_o_write_relocs): Ditto. (bfd_mach_o_write_section_32): Ditto. (bfd_mach_o_write_section_64): Ditto. (bfd_mach_o_write_segment_32): Ditto. (bfd_mach_o_write_segment_64): Ditto. (bfd_mach_o_write_symtab): Ditto. (bfd_mach_o_write_contents): Ditto. (bfd_mach_o_read_header): Ditto. (bfd_mach_o_read_section_32): Ditto. (bfd_mach_o_read_section_64): Ditto. (bfd_mach_o_read_symtab_symbol): Ditto. (bfd_mach_o_read_dylinker): Ditto. (bfd_mach_o_read_dylib): Ditto. (bfd_mach_o_read_dysymtab): Ditto. (bfd_mach_o_read_symtab): Ditto. (bfd_mach_o_read_linkedit): Ditto. (bfd_mach_o_read_str): Ditto. (bfd_mach_o_read_dyld_info): Ditto. (bfd_mach_o_read_segment): Ditto. (bfd_mach_o_read_command): Ditto. (bfd_mach_o_archive_p): Ditto. (bfd_mach_o_canonicalize_one_reloc): Ditto. Change the BUF parameter. (bfd_mach_o_canonicalize_relocs): Adjust to call the above function. (bfd_mach_o_read_dysymtab_symbol): Rename BUF variable. (bfd_mach_o_read_uuid): Remove useless cast. Use a macro instead of an hard-coded value. include/mach-o 2011-08-08 Tristan Gingold <gingold@adacore.com> * loader.h: Reorder declarations. * x86-64.h: New file. * external.h: New file. * reloc.h: New file.
2011-07-06bfd/Tristan Gingold2-0/+333
2011-07-06 Tristan Gingold <gingold@adacore.com> * mach-o.h: Move loader related definitions to include/mach-o/loader.h. Include it. include/mach-o/ 2011-07-06 Tristan Gingold <gingold@adacore.com> * loader.h: New file.