diff options
author | Tristan Gingold <gingold@adacore.com> | 2015-11-18 10:33:11 +0100 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2015-11-18 11:48:56 +0100 |
commit | 47daa70fe08c57aaafa6fe1a7e762072909d0f8f (patch) | |
tree | f9594075db7b1de293c26c5311a393e8e65aae3b /bfd/mach-o-target.c | |
parent | c389945b7a470aa328972026fe4a836c57ccb7ae (diff) | |
download | gdb-47daa70fe08c57aaafa6fe1a7e762072909d0f8f.zip gdb-47daa70fe08c57aaafa6fe1a7e762072909d0f8f.tar.gz gdb-47daa70fe08c57aaafa6fe1a7e762072909d0f8f.tar.bz2 |
mach-o cleanup: remove useless calls to bfd_seek.
Also support new commands.
bfd/
* mach-o.h (struct mach_o_data_struct): Add hdr_offset field.
(bfd_mach_o_fat_archive_p): Renames prototype.
(bfd_mach_o_fat_openr_next_archived_file): Renames.
(bfd_mach_o_header_p): Add argument.
* mach-o.c (bfd_mach_o_read_header): Add hdr_off argument and
use it.
(bfd_mach_o_read_section_32, bfd_mach_o_read_section_64)
(bfd_mach_o_read_section): Remove offset argument.
(bfd_mach_o_read_dylinker): Remove bfd_seek call.
(bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib)
(bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints)
(bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab)
(bfd_mach_o_read_symtab, bfd_mach_o_read_uuid)
(bfd_mach_o_read_linkedit, bfd_mach_o_read_str)
(bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min)
(bfd_mach_o_read_encryption_info): Likewise.
(bfd_mach_o_read_encryption_info_64): New function.
(bfd_mach_o_read_main, bfd_mach_o_read_source_version)
(bfd_mach_o_read_segment): Remove call to bfd_seek.
(bfd_mach_o_read_command): Use hdr_offset in bfd_seek.
Handle BFD_MACH_O_LC_LINKER_OPTIMIZATION_HINT,
BFD_MACH_O_LC_ENCRYPTION_INFO_64, BFD_MACH_O_LC_VERSION_MIN_WATCHOS.
(bfd_mach_o_header_p): Add hdr_off argument.
(bfd_mach_o_gen_object_p, bfd_mach_o_gen_core_p): Adjust calls.
(bfd_mach_o_fat_archive_p): Renames.
(bfd_mach_o_fat_openr_next_archived_file): Renames.
(bfd_mach_o_close_and_cleanup): Remove useless code.
(bfd_mach_o_close_and_cleanup): Define.
* mach-o-x86-64.c (bfd_mach_o_x86_64_object_p)
(bfd_mach_o_x86_64_core_p): Adjust calls.
* mach-o-target.c: Move defines for archive from mach-o.c.
Remove check on TARGET_ARCHIVE.
* mach-o-i386.c (bfd_mach_o_i386_object_p)
(bfd_mach_o_i386_core_p): Adjust calls.
Diffstat (limited to 'bfd/mach-o-target.c')
-rw-r--r-- | bfd/mach-o-target.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index 3f3e455..3915dc0 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -61,6 +61,17 @@ #define bfd_mach_o_get_dynamic_symtab_upper_bound bfd_mach_o_get_symtab_upper_bound #define bfd_mach_o_canonicalize_dynamic_symtab bfd_mach_o_canonicalize_symtab +/* For Mach-O special archives. */ +#define bfd_mach_o_read_ar_hdr _bfd_noarchive_read_ar_hdr +#define bfd_mach_o_write_ar_hdr _bfd_noarchive_write_ar_hdr +#define bfd_mach_o_slurp_armap _bfd_noarchive_slurp_armap +#define bfd_mach_o_slurp_extended_name_table _bfd_noarchive_slurp_extended_name_table +#define bfd_mach_o_construct_extended_name_table _bfd_noarchive_construct_extended_name_table +#define bfd_mach_o_truncate_arname _bfd_noarchive_truncate_arname +#define bfd_mach_o_write_armap _bfd_noarchive_write_armap +#define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index +#define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp + #define TARGET_NAME_BACKEND XCONCAT2(TARGET_NAME,_backend) #endif /* MACH_O_TARGET_COMMON_DEFINED */ @@ -89,10 +100,6 @@ #error TARGET_PAGESIZE must be defined #endif -#if ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN)) -#error Mach-O fat files must always be big-endian. -#endif /* ((TARGET_ARCHIVE) && (! TARGET_BIG_ENDIAN)) */ - static const bfd_mach_o_backend_data TARGET_NAME_BACKEND = { TARGET_ARCHITECTURE, |