Mach-O: disp dyld environment command in objdump -P load.
authorTristan Gingold <tristan.gingold@adacore.com>
Wed, 26 Mar 2014 09:40:49 +0000 (10:40 +0100)
committerTristan Gingold <tristan.gingold@adacore.com>
Thu, 27 Mar 2014 11:01:58 +0000 (12:01 +0100)
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
bfd/mach-o.c
binutils/ChangeLog
binutils/od-macho.c

index 54b783417e5dd134b63efc20b5eee17f92b1097d..a7ca2d08f4456bb8a5e2926b8b3654a79563d691 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-27  Tristan Gingold  <gingold@adacore.com>
+
+       * 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  <gingold@adacore.com>
 
        * mach-o.h (bfd_mach_o_get_base_address): New prototype.
index 8e8842bdb24109ea1ab97bb150ac70c7278a0520..ebaa6c7852a9ac59104a76f901905ccd7fd53889 100644 (file)
@@ -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;
index 975979dcb2b833fa5a1a8703092d8586fd6f4e31..c69ba99e75267409ba9d932ff3e13159c7c51a0e 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-27  Tristan Gingold  <gingold@adacore.com>
+
+       * 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  <gingold@adacore.com>
 
        * od-macho.c (OPT_FUNCTION_STARTS): New macro.
index 4733e873a64ea1792d195084434424138dbb5486..80bf5c25d3757f725501b87f5d212acfb2a03ead 100644 (file)
@@ -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