diff options
author | Tristan Gingold <tristan.gingold@adacore.com> | 2014-03-26 15:01:53 +0100 |
---|---|---|
committer | Tristan Gingold <tristan.gingold@adacore.com> | 2014-04-02 15:03:51 +0200 |
commit | 7a79c51466c30188d49d03d3e3593c87e5a3345e (patch) | |
tree | ba47b17425271ba5074065034c29bd37f8055c02 /bfd/mach-o.h | |
parent | 5979d6b69b20a8355ea94b75fad97415fce4788c (diff) | |
download | gdb-7a79c51466c30188d49d03d3e3593c87e5a3345e.zip gdb-7a79c51466c30188d49d03d3e3593c87e5a3345e.tar.gz gdb-7a79c51466c30188d49d03d3e3593c87e5a3345e.tar.bz2 |
mach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.
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.
Diffstat (limited to 'bfd/mach-o.h')
-rw-r--r-- | bfd/mach-o.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/bfd/mach-o.h b/bfd/mach-o.h index 4418b92..629459b 100644 --- a/bfd/mach-o.h +++ b/bfd/mach-o.h @@ -375,6 +375,27 @@ bfd_mach_o_dysymtab_command; #define BFD_MACH_O_INDIRECT_SYMBOL_ABS 0x40000000 #define BFD_MACH_O_INDIRECT_SYMBOL_SIZE 4 +/* For LC_TWOLEVEL_HINTS. */ + +typedef struct bfd_mach_o_twolevel_hints_command +{ + /* Offset to the hint table. */ + unsigned int offset; + + /* Number of entries in the table. */ + unsigned int nhints; +} +bfd_mach_o_twolevel_hints_command; + +/* For LC_PREBIND_CKSUM. */ + +typedef struct bfd_mach_o_prebind_cksum_command +{ + /* Checksum or zero. */ + unsigned int cksum; +} +bfd_mach_o_prebind_cksum_command; + /* For LC_THREAD or LC_UNIXTHREAD. */ typedef struct bfd_mach_o_thread_flavour @@ -421,9 +442,12 @@ bfd_mach_o_dylib_command; typedef struct bfd_mach_o_prebound_dylib_command { - unsigned long name; /* Library's path name. */ - unsigned long nmodules; /* Number of modules in library. */ - unsigned long linked_modules; /* Bit vector of linked modules. */ + unsigned int name_offset; /* Library's path name. */ + unsigned int nmodules; /* Number of modules in library. */ + unsigned int linked_modules_offset; /* Bit vector of linked modules. */ + + char *name_str; + unsigned char *linked_modules; } bfd_mach_o_prebound_dylib_command; @@ -535,6 +559,8 @@ typedef struct bfd_mach_o_load_command bfd_mach_o_dylib_command dylib; bfd_mach_o_dylinker_command dylinker; bfd_mach_o_prebound_dylib_command prebound_dylib; + bfd_mach_o_prebind_cksum_command prebind_cksum; + bfd_mach_o_twolevel_hints_command twolevel_hints; bfd_mach_o_uuid_command uuid; bfd_mach_o_linkedit_command linkedit; bfd_mach_o_str_command str; |