h->filetype,
bfd_mach_o_get_name (bfd_mach_o_filetype_name, h->filetype));
printf (_(" ncmds : %08lx (%lu)\n"), h->ncmds, h->ncmds);
- printf (_(" sizeofcmds: %08lx\n"), h->sizeofcmds);
+ printf (_(" sizeofcmds: %08lx (%lu)\n"), h->sizeofcmds, h->sizeofcmds);
printf (_(" flags : %08lx ("), h->flags);
bfd_mach_o_print_flags (bfd_mach_o_header_flags_name, h->flags);
fputs (_(")\n"), stdout);
bfd_mach_o_segment_command *seg = &cmd->command.segment;
bfd_mach_o_section *sec;
- printf (" name: %s\n", *seg->segname ? seg->segname : "*none*");
- printf (" vmaddr: ");
+ printf (" name: %16s", *seg->segname ? seg->segname : "*none*");
+ printf (" nsects: %lu", seg->nsects);
+ printf (" flags: %lx", seg->flags);
+ printf (" initprot: ");
+ disp_segment_prot (seg->initprot);
+ printf (" maxprot: ");
+ disp_segment_prot (seg->maxprot);
+ printf ("\n");
+ printf (" vmaddr: ");
printf_vma (seg->vmaddr);
printf (" vmsize: ");
printf_vma (seg->vmsize);
printf ("\n");
- printf (" fileoff: ");
+ printf (" fileoff: ");
printf_vma (seg->fileoff);
printf (" filesize: ");
printf_vma ((bfd_vma)seg->filesize);
printf (" endoff: ");
printf_vma ((bfd_vma)(seg->fileoff + seg->filesize));
printf ("\n");
- printf (" nsects: %lu", seg->nsects);
- printf (" flags: %lx", seg->flags);
- printf (" initprot: ");
- disp_segment_prot (seg->initprot);
- printf (" maxprot: ");
- disp_segment_prot (seg->maxprot);
- printf ("\n");
for (sec = seg->sect_head; sec != NULL; sec = sec->next)
dump_section_header (abfd, sec);
}
{
bfd_mach_o_dyld_info_command *info = &cmd->command.dyld_info;
- printf (" rebase: off: 0x%08x size: %-8u\n",
- info->rebase_off, info->rebase_size);
- printf (" bind: off: 0x%08x size: %-8u\n",
- info->bind_off, info->bind_size);
- printf (" weak bind: off: 0x%08x size: %-8u\n",
- info->weak_bind_off, info->weak_bind_size);
- printf (" lazy bind: off: 0x%08x size: %-8u\n",
- info->lazy_bind_off, info->lazy_bind_size);
- printf (" export: off: 0x%08x size: %-8u\n",
- info->export_off, info->export_size);
+ printf (" rebase: off: 0x%08x size: %-8u (endoff: 0x%08x)\n",
+ info->rebase_off, info->rebase_size,
+ info->rebase_off + info->rebase_size);
+ printf (" bind: off: 0x%08x size: %-8u (endoff: 0x%08x)\n",
+ info->bind_off, info->bind_size,
+ info->bind_off + info->bind_size);
+ printf (" weak bind: off: 0x%08x size: %-8u (endoff: 0x%08x)\n",
+ info->weak_bind_off, info->weak_bind_size,
+ info->weak_bind_off + info->weak_bind_size);
+ printf (" lazy bind: off: 0x%08x size: %-8u (endoff: 0x%08x)\n",
+ info->lazy_bind_off, info->lazy_bind_size,
+ info->lazy_bind_off + info->lazy_bind_size);
+ printf (" export: off: 0x%08x size: %-8u (endoff: 0x%08x)\n",
+ info->export_off, info->export_size,
+ info->export_off + info->export_size);
}
static void
static void
dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd,
- bfd_boolean verbose)
+ unsigned int idx, bfd_boolean verbose)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
const char *cmd_name;
cmd_name = bfd_mach_o_get_name_or_null
(bfd_mach_o_load_command_name, cmd->type);
- printf ("Load command ");
+ printf ("Load command #%-2u (size: %3u, offset: %4u): ",
+ idx, cmd->len, cmd->offset);
if (cmd_name == NULL)
- printf ("0x%02x:", cmd->type);
+ printf ("0x%02x\n", cmd->type);
else
- printf ("%s:", cmd_name);
+ printf ("%s\n", cmd_name);
switch (cmd->type)
{
bfd_mach_o_uuid_command *uuid = &cmd->command.uuid;
unsigned int j;
+ printf (" ");
for (j = 0; j < sizeof (uuid->uuid); j ++)
printf (" %02x", uuid->uuid[j]);
putchar ('\n');
case BFD_MACH_O_LC_LOAD_UPWARD_DYLIB:
{
bfd_mach_o_dylib_command *dylib = &cmd->command.dylib;
- printf (" %s\n", dylib->name_str);
+ printf (" name: %s\n", dylib->name_str);
printf (" time stamp: 0x%08lx\n",
dylib->timestamp);
printf (" current version: 0x%08lx\n",
break;
case BFD_MACH_O_LC_LOAD_DYLINKER:
case BFD_MACH_O_LC_ID_DYLINKER:
- printf (" %s\n", cmd->command.dylinker.name_str);
+ 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);
+ printf (" %s\n", cmd->command.dylinker.name_str);
break;
case BFD_MACH_O_LC_SYMTAB:
{
bfd_mach_o_symtab_command *symtab = &cmd->command.symtab;
- printf ("\n"
- " symoff: 0x%08x nsyms: %8u (endoff: 0x%08x)\n",
+ printf (" symoff: 0x%08x nsyms: %8u (endoff: 0x%08x)\n",
symtab->symoff, symtab->nsyms,
symtab->symoff + symtab->nsyms
* (mdata->header.version == 2
break;
}
case BFD_MACH_O_LC_DYSYMTAB:
- putchar ('\n');
dump_dysymtab (abfd, cmd, verbose);
break;
case BFD_MACH_O_LC_LOADFVMLIB:
case BFD_MACH_O_LC_IDFVMLIB:
{
bfd_mach_o_fvmlib_command *fvmlib = &cmd->command.fvmlib;
- printf (" %s\n", fvmlib->name_str);
+ printf (" fvmlib: %s\n", fvmlib->name_str);
printf (" minor version: 0x%08x\n", fvmlib->minor_version);
printf (" header address: 0x%08x\n", fvmlib->header_addr);
}
{
bfd_mach_o_linkedit_command *linkedit = &cmd->command.linkedit;
printf
- ("\n"
- " dataoff: 0x%08lx datasize: 0x%08lx (endoff: 0x%08lx)\n",
+ (" dataoff: 0x%08lx datasize: 0x%08lx (endoff: 0x%08lx)\n",
linkedit->dataoff, linkedit->datasize,
linkedit->dataoff + linkedit->datasize);
case BFD_MACH_O_LC_RPATH:
{
bfd_mach_o_str_command *str = &cmd->command.str;
- printf (" %s\n", str->str);
+ printf (" %s\n", str->str);
break;
}
case BFD_MACH_O_LC_THREAD:
bfd_mach_o_encryption_info_command *cryp =
&cmd->command.encryption_info;
printf
- ("\n"
- " cryptoff: 0x%08x cryptsize: 0x%08x (endoff 0x%08x)"
+ (" cryptoff: 0x%08x cryptsize: 0x%08x (endoff 0x%08x)"
" cryptid: %u\n",
cryp->cryptoff, cryp->cryptsize,
cryp->cryptoff + cryp->cryptsize,
}
break;
case BFD_MACH_O_LC_DYLD_INFO:
- putchar ('\n');
dump_dyld_info (abfd, cmd);
break;
case BFD_MACH_O_LC_VERSION_MIN_MACOSX:
{
bfd_mach_o_version_min_command *ver = &cmd->command.version_min;
- printf (" %u.%u.%u\n", ver->rel, ver->maj, ver->min);
+ printf (" %u.%u.%u\n", ver->rel, ver->maj, ver->min);
}
break;
case BFD_MACH_O_LC_SOURCE_VERSION:
{
bfd_mach_o_source_version_command *version =
&cmd->command.source_version;
- printf ("\n"
- " version a.b.c.d.e: %u.%u.%u.%u.%u\n",
+ printf (" version a.b.c.d.e: %u.%u.%u.%u.%u\n",
version->a, version->b, version->c, version->d, version->e);
break;
}
unsigned int j;
unsigned int last;
- printf (" %s\n", pbdy->name_str);
+ printf (" dylib: %s\n", pbdy->name_str);
printf (" nmodules: %u\n", pbdy->nmodules);
printf (" linked modules (at %u): ",
pbdy->linked_modules_offset - cmd->offset);
case BFD_MACH_O_LC_PREBIND_CKSUM:
{
bfd_mach_o_prebind_cksum_command *cksum = &cmd->command.prebind_cksum;
- printf (" 0x%08x\n", cksum->cksum);
+ printf (" 0x%08x\n", cksum->cksum);
break;
}
case BFD_MACH_O_LC_TWOLEVEL_HINTS:
bfd_mach_o_twolevel_hints_command *hints =
&cmd->command.twolevel_hints;
- printf ("\n"
- " table offset: 0x%08x nbr hints: %u\n",
+ printf (" table offset: 0x%08x nbr hints: %u\n",
hints->offset, hints->nhints);
if (verbose)
dump_twolevel_hints (abfd, hints);
case BFD_MACH_O_LC_MAIN:
{
bfd_mach_o_main_command *entry = &cmd->command.main;
- printf ("\n"
- " entry offset: ");
+ printf (" entry offset: ");
printf_uint64 (entry->entryoff);
printf ("\n"
" stack size: ");
break;
}
default:
- putchar ('\n');
- printf (" offset: 0x%08lx\n", (unsigned long)cmd->offset);
- printf (" size: 0x%08lx\n", (unsigned long)cmd->len);
break;
}
putchar ('\n');
bfd_mach_o_load_command *cmd = &mdata->commands[i];
if (cmd32 == 0)
- dump_load_command (abfd, cmd, FALSE);
+ dump_load_command (abfd, cmd, i, FALSE);
else if (cmd->type == cmd32 || cmd->type == cmd64)
- dump_load_command (abfd, cmd, TRUE);
+ dump_load_command (abfd, cmd, i, TRUE);
}
}