From 10be66a4910d39b508002eea2056783e3430af40 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 26 Mar 2014 10:40:49 +0100 Subject: Mach-O: disp dyld environment command in objdump -P load. bfd/ * mach-o.c (bfd_mach_o_read_dylinker): Remove assert. (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT. binutils/ * od-macho.c (dump_load_command): Display value for BFD_MACH_O_LC_DYLD_ENVIRONMENT. Handle BFD_MACH_O_LC_DATA_IN_CODE and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS. --- bfd/ChangeLog | 5 +++++ bfd/mach-o.c | 4 +--- binutils/ChangeLog | 6 ++++++ binutils/od-macho.c | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 54b7834..a7ca2d0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2014-03-27 Tristan Gingold + * mach-o.c (bfd_mach_o_read_dylinker): Remove assert. + (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT. + +2014-03-27 Tristan Gingold + * mach-o.h (bfd_mach_o_get_base_address): New prototype. * mach-o.c (bfd_mach_o_write_symtab) (bfd_mach_o_write_contents) diff --git a/bfd/mach-o.c b/bfd/mach-o.c index 8e8842b..ebaa6c7 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -3149,9 +3149,6 @@ bfd_mach_o_read_dylinker (bfd *abfd, bfd_mach_o_load_command *command) struct mach_o_str_command_external raw; unsigned int nameoff; - BFD_ASSERT ((command->type == BFD_MACH_O_LC_ID_DYLINKER) - || (command->type == BFD_MACH_O_LC_LOAD_DYLINKER)); - if (bfd_seek (abfd, command->offset + BFD_MACH_O_LC_SIZE, SEEK_SET) != 0 || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw)) return -1; @@ -3845,6 +3842,7 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command) break; case BFD_MACH_O_LC_LOAD_DYLINKER: case BFD_MACH_O_LC_ID_DYLINKER: + case BFD_MACH_O_LC_DYLD_ENVIRONMENT: if (bfd_mach_o_read_dylinker (abfd, command) != 0) return -1; break; diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 975979d..c69ba99 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,11 @@ 2014-03-27 Tristan Gingold + * od-macho.c (dump_load_command): Display value for + BFD_MACH_O_LC_DYLD_ENVIRONMENT. Handle BFD_MACH_O_LC_DATA_IN_CODE + and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS. + +2014-03-27 Tristan Gingold + * od-macho.c (OPT_FUNCTION_STARTS): New macro. (options): Add entry for function_starts. (mach_o_help): Ditto. diff --git a/binutils/od-macho.c b/binutils/od-macho.c index 4733e87..80bf5c2 100644 --- a/binutils/od-macho.c +++ b/binutils/od-macho.c @@ -1026,6 +1026,10 @@ dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd, case BFD_MACH_O_LC_ID_DYLINKER: printf (" %s\n", cmd->command.dylinker.name_str); break; + case BFD_MACH_O_LC_DYLD_ENVIRONMENT: + putchar ('\n'); + printf (" %s\n", cmd->command.dylinker.name_str); + break; case BFD_MACH_O_LC_SYMTAB: { bfd_mach_o_symtab_command *symtab = &cmd->command.symtab; @@ -1056,6 +1060,8 @@ dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd, case BFD_MACH_O_LC_CODE_SIGNATURE: case BFD_MACH_O_LC_SEGMENT_SPLIT_INFO: case BFD_MACH_O_LC_FUNCTION_STARTS: + case BFD_MACH_O_LC_DATA_IN_CODE: + case BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS: { bfd_mach_o_linkedit_command *linkedit = &cmd->command.linkedit; printf -- cgit v1.1