gas: remove use of PTR
[binutils-gdb.git] / binutils / od-macho.c
index 1c75c5dbccba41638cd83c7f0046a0396bf5c0f2..56d448ac3bd8d4bd9a962ca128b65bcbd5c2149b 100644 (file)
@@ -1,5 +1,5 @@
 /* od-macho.c -- dump information about an Mach-O object file.
-   Copyright (C) 2011-2019 Free Software Foundation, Inc.
+   Copyright (C) 2011-2022 Free Software Foundation, Inc.
    Written by Tristan Gingold, Adacore.
 
    This file is part of GNU Binutils.
@@ -214,6 +214,8 @@ static const bfd_mach_o_xlat_name bfd_mach_o_load_command_name[] =
   { "version_min_watchos", BFD_MACH_O_LC_VERSION_MIN_WATCHOS},
   { "note", BFD_MACH_O_LC_NOTE},
   { "build_version", BFD_MACH_O_LC_BUILD_VERSION},
+  { "exports_trie", BFD_MACH_O_LC_DYLD_EXPORTS_TRIE},
+  { "chained_fixups", BFD_MACH_O_LC_DYLD_CHAINED_FIXUPS},
   { NULL, 0}
 };
 
@@ -462,7 +464,7 @@ dump_segment (bfd *abfd ATTRIBUTE_UNUSED, bfd_mach_o_load_command *cmd)
 }
 
 static void
-dump_dysymtab (bfd *abfd, bfd_mach_o_load_command *cmd, bfd_boolean verbose)
+dump_dysymtab (bfd *abfd, bfd_mach_o_load_command *cmd, bool verbose)
 {
   bfd_mach_o_dysymtab_command *dysymtab = &cmd->command.dysymtab;
   bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
@@ -654,7 +656,7 @@ dump_dysymtab (bfd *abfd, bfd_mach_o_load_command *cmd, bfd_boolean verbose)
 
 }
 
-static bfd_boolean
+static bool
 load_and_dump (bfd *abfd, ufile_ptr off, unsigned int len,
               void (*dump)(bfd *abfd, unsigned char *buf, unsigned int len,
                            ufile_ptr off))
@@ -662,7 +664,7 @@ load_and_dump (bfd *abfd, ufile_ptr off, unsigned int len,
   unsigned char *buf;
 
   if (len == 0)
-    return TRUE;
+    return true;
 
   buf = xmalloc (len);
 
@@ -670,10 +672,10 @@ load_and_dump (bfd *abfd, ufile_ptr off, unsigned int len,
       && bfd_bread (buf, len, abfd) == len)
     dump (abfd, buf, len, off);
   else
-    return FALSE;
+    return false;
 
   free (buf);
-  return TRUE;
+  return true;
 }
 
 static const bfd_mach_o_xlat_name bfd_mach_o_dyld_rebase_type_name[] =
@@ -966,7 +968,7 @@ dump_dyld_info_export (bfd *abfd, unsigned char *buf, unsigned int len,
 
 static void
 dump_dyld_info (bfd *abfd, bfd_mach_o_load_command *cmd,
-               bfd_boolean verbose)
+               bool verbose)
 {
   bfd_mach_o_dyld_info_command *dinfo = &cmd->command.dyld_info;
 
@@ -1525,7 +1527,7 @@ dump_build_version (bfd *abfd, bfd_mach_o_load_command *cmd)
 
 static void
 dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd,
-                   unsigned int idx, bfd_boolean verbose)
+                   unsigned int idx, bool verbose)
 {
   bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
   const char *cmd_name;
@@ -1610,6 +1612,8 @@ dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd,
     case BFD_MACH_O_LC_FUNCTION_STARTS:
     case BFD_MACH_O_LC_DATA_IN_CODE:
     case BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS:
+    case BFD_MACH_O_LC_DYLD_EXPORTS_TRIE:
+    case BFD_MACH_O_LC_DYLD_CHAINED_FIXUPS:
       {
         bfd_mach_o_linkedit_command *linkedit = &cmd->command.linkedit;
         printf
@@ -1765,9 +1769,9 @@ dump_load_commands (bfd *abfd, unsigned int cmd32, unsigned int cmd64)
   for (cmd = mdata->first_command, i = 0; cmd != NULL; cmd = cmd->next, i++)
     {
       if (cmd32 == 0)
-        dump_load_command (abfd, cmd, i, FALSE);
+        dump_load_command (abfd, cmd, i, false);
       else if (cmd->type == cmd32 || cmd->type == cmd64)
-        dump_load_command (abfd, cmd, i, TRUE);
+        dump_load_command (abfd, cmd, i, true);
     }
 }
 
@@ -2011,7 +2015,7 @@ dump_obj_compact_unwind (bfd *abfd,
 
          putchar (' ');
          printf_uint64 (bfd_get_64 (abfd, e->start));
-         printf (" %08lx", bfd_get_32 (abfd, e->length));
+         printf (" %08lx", (unsigned long)bfd_get_32 (abfd, e->length));
          putchar (' ');
          printf_uint64 (bfd_get_64 (abfd, e->personality));
          putchar (' ');