OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [binutils/] [coffdump.c] - Diff between revs 15 and 163

Only display areas with differences | Details | Blame | View Log

Rev 15 Rev 163
/* Coff file dumper.
/* Coff file dumper.
   Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
   Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
   2011 Free Software Foundation, Inc.
   2011 Free Software Foundation, Inc.
 
 
   This file is part of GNU Binutils.
   This file is part of GNU Binutils.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or (at
   the Free Software Foundation; either version 3 of the License, or (at
   your option) any later version.
   your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */
   MA 02110-1301, USA.  */
 
 
 
 
/* Written by Steve Chamberlain <sac@cygnus.com>
/* Written by Steve Chamberlain <sac@cygnus.com>
 
 
   This module reads a type tree generated by coffgrok and prints
   This module reads a type tree generated by coffgrok and prints
   it out so we can test the grokker.  */
   it out so we can test the grokker.  */
 
 
#include "sysdep.h"
#include "sysdep.h"
#include "bfd.h"
#include "bfd.h"
#include "bfd_stdint.h"
#include "bfd_stdint.h"
#include "libiberty.h"
#include "libiberty.h"
#include "bucomm.h"
#include "bucomm.h"
 
 
#include "coffgrok.h"
#include "coffgrok.h"
#include "getopt.h"
#include "getopt.h"
 
 
static int atnl;
static int atnl;
 
 
static void tab (int);
static void tab (int);
static void nl (void);
static void nl (void);
static void dump_coff_lines (struct coff_line *);
static void dump_coff_lines (struct coff_line *);
static void dump_coff_type (struct coff_type *);
static void dump_coff_type (struct coff_type *);
static void dump_coff_where (struct coff_where *);
static void dump_coff_where (struct coff_where *);
static void dump_coff_visible (struct coff_visible *);
static void dump_coff_visible (struct coff_visible *);
static void dump_coff_scope (struct coff_scope *);
static void dump_coff_scope (struct coff_scope *);
static void dump_coff_sfile (struct coff_sfile *);
static void dump_coff_sfile (struct coff_sfile *);
static void dump_coff_section (struct coff_section *);
static void dump_coff_section (struct coff_section *);
static void show_usage (FILE *, int);
static void show_usage (FILE *, int);
extern int main (int, char **);
extern int main (int, char **);
 
 
static void
static void
tab (int x)
tab (int x)
{
{
  static int indent;
  static int indent;
  int i;
  int i;
 
 
  if (atnl)
  if (atnl)
    {
    {
      if (x < 0)
      if (x < 0)
        {
        {
          printf (")");
          printf (")");
          indent += x;
          indent += x;
 
 
          return;
          return;
        }
        }
      else
      else
        {
        {
          printf ("\n");
          printf ("\n");
          atnl = 0;
          atnl = 0;
        }
        }
    }
    }
 
 
  if (x == -1)
  if (x == -1)
    {
    {
      for (i = 0; i < indent; i++)
      for (i = 0; i < indent; i++)
        printf ("   ");
        printf ("   ");
 
 
      indent += x;
      indent += x;
      printf (")");
      printf (")");
      return;
      return;
    }
    }
 
 
  indent += x;
  indent += x;
 
 
  for (i = 0; i < indent; i++)
  for (i = 0; i < indent; i++)
    printf ("   ");
    printf ("   ");
 
 
  if (x)
  if (x)
    {
    {
      printf ("(");
      printf ("(");
    }
    }
}
}
 
 
static void
static void
nl (void)
nl (void)
{
{
  atnl = 1;
  atnl = 1;
}
}
 
 
static void
static void
dump_coff_lines (struct coff_line *p)
dump_coff_lines (struct coff_line *p)
{
{
  int i;
  int i;
  int online = 0;
  int online = 0;
 
 
  tab (1);
  tab (1);
  printf (_("#lines %d "),p->nlines);
  printf (_("#lines %d "),p->nlines);
 
 
  for (i = 0; i < p->nlines; i++)
  for (i = 0; i < p->nlines; i++)
    {
    {
      printf ("(%d 0x%x)", p->lines[i], p->addresses[i]);
      printf ("(%d 0x%x)", p->lines[i], p->addresses[i]);
 
 
      online++;
      online++;
 
 
      if (online > 6)
      if (online > 6)
        {
        {
          nl ();
          nl ();
          tab (0);
          tab (0);
          online = 0;
          online = 0;
        }
        }
    }
    }
  nl ();
  nl ();
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_type (struct coff_type *p)
dump_coff_type (struct coff_type *p)
{
{
  tab (1);
  tab (1);
  printf ("size %d ", p->size);
  printf (_("size %d "), p->size);
 
 
  switch (p->type)
  switch (p->type)
    {
    {
    case coff_secdef_type:
    case coff_secdef_type:
      printf ("section definition at %x size %x\n",
      printf (_("section definition at %x size %x\n"),
              p->u.asecdef.address,
              p->u.asecdef.address,
              p->u.asecdef.size);
              p->u.asecdef.size);
      nl ();
      nl ();
      break;
      break;
    case coff_pointer_type:
    case coff_pointer_type:
      printf ("pointer to");
      printf (_("pointer to"));
      nl ();
      nl ();
      dump_coff_type (p->u.pointer.points_to);
      dump_coff_type (p->u.pointer.points_to);
      break;
      break;
    case coff_array_type:
    case coff_array_type:
      printf ("array [%d] of", p->u.array.dim);
      printf (_("array [%d] of"), p->u.array.dim);
      nl ();
      nl ();
      dump_coff_type (p->u.array.array_of);
      dump_coff_type (p->u.array.array_of);
      break;
      break;
    case coff_function_type:
    case coff_function_type:
      printf ("function returning");
      printf (_("function returning"));
      nl ();
      nl ();
      dump_coff_type (p->u.function.function_returns);
      dump_coff_type (p->u.function.function_returns);
      dump_coff_lines (p->u.function.lines);
      dump_coff_lines (p->u.function.lines);
      printf ("arguments");
      printf (_("arguments"));
      nl ();
      nl ();
      dump_coff_scope (p->u.function.parameters);
      dump_coff_scope (p->u.function.parameters);
      tab (0);
      tab (0);
      printf ("code");
      printf (_("code"));
      nl ();
      nl ();
      dump_coff_scope (p->u.function.code);
      dump_coff_scope (p->u.function.code);
      tab(0);
      tab(0);
      break;
      break;
    case coff_structdef_type:
    case coff_structdef_type:
      printf ("structure definition");
      printf (_("structure definition"));
      nl ();
      nl ();
      dump_coff_scope (p->u.astructdef.elements);
      dump_coff_scope (p->u.astructdef.elements);
      break;
      break;
    case coff_structref_type:
    case coff_structref_type:
      if (!p->u.aenumref.ref)
      if (!p->u.aenumref.ref)
        printf ("structure ref to UNKNOWN struct");
        printf (_("structure ref to UNKNOWN struct"));
      else
      else
        printf ("structure ref to %s", p->u.aenumref.ref->name);
        printf (_("structure ref to %s"), p->u.aenumref.ref->name);
      break;
      break;
    case coff_enumref_type:
    case coff_enumref_type:
      printf ("enum ref to %s", p->u.astructref.ref->name);
      printf (_("enum ref to %s"), p->u.astructref.ref->name);
      break;
      break;
    case coff_enumdef_type:
    case coff_enumdef_type:
      printf ("enum definition");
      printf (_("enum definition"));
      nl ();
      nl ();
      dump_coff_scope (p->u.aenumdef.elements);
      dump_coff_scope (p->u.aenumdef.elements);
      break;
      break;
    case coff_basic_type:
    case coff_basic_type:
      switch (p->u.basic)
      switch (p->u.basic)
        {
        {
        case T_NULL:
        case T_NULL:
          printf ("NULL");
          printf ("NULL");
          break;
          break;
        case T_VOID:
        case T_VOID:
          printf ("VOID");
          printf ("VOID");
          break;
          break;
        case T_CHAR:
        case T_CHAR:
          printf ("CHAR");
          printf ("CHAR");
          break;
          break;
        case T_SHORT:
        case T_SHORT:
          printf ("SHORT");
          printf ("SHORT");
          break;
          break;
        case T_INT:
        case T_INT:
          printf ("INT ");
          printf ("INT ");
          break;
          break;
        case T_LONG:
        case T_LONG:
          printf ("LONG");
          printf ("LONG");
          break;
          break;
        case T_FLOAT:
        case T_FLOAT:
          printf ("FLOAT");
          printf ("FLOAT");
          break;
          break;
        case T_DOUBLE:
        case T_DOUBLE:
          printf ("DOUBLE");
          printf ("DOUBLE");
          break;
          break;
        case T_STRUCT:
        case T_STRUCT:
          printf ("STRUCT");
          printf ("STRUCT");
          break;
          break;
        case T_UNION:
        case T_UNION:
          printf ("UNION");
          printf ("UNION");
          break;
          break;
        case T_ENUM:
        case T_ENUM:
          printf ("ENUM");
          printf ("ENUM");
          break;
          break;
        case T_MOE:
        case T_MOE:
          printf ("MOE ");
          printf ("MOE ");
          break;
          break;
        case T_UCHAR:
        case T_UCHAR:
          printf ("UCHAR");
          printf ("UCHAR");
          break;
          break;
        case T_USHORT:
        case T_USHORT:
          printf ("USHORT");
          printf ("USHORT");
          break;
          break;
        case T_UINT:
        case T_UINT:
          printf ("UINT");
          printf ("UINT");
          break;
          break;
        case T_ULONG:
        case T_ULONG:
          printf ("ULONG");
          printf ("ULONG");
          break;
          break;
        case T_LNGDBL:
        case T_LNGDBL:
          printf ("LNGDBL");
          printf ("LNGDBL");
          break;
          break;
        default:
        default:
          abort ();
          abort ();
        }
        }
    }
    }
  nl ();
  nl ();
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_where (struct coff_where *p)
dump_coff_where (struct coff_where *p)
{
{
  tab (1);
  tab (1);
  switch (p->where)
  switch (p->where)
    {
    {
    case coff_where_stack:
    case coff_where_stack:
      printf ("Stack offset %x", p->offset);
      printf (_("Stack offset %x"), p->offset);
      break;
      break;
    case coff_where_memory:
    case coff_where_memory:
      printf ("Memory section %s+%x", p->section->name, p->offset);
      printf (_("Memory section %s+%x"), p->section->name, p->offset);
      break;
      break;
    case coff_where_register:
    case coff_where_register:
      printf ("Register %d", p->offset);
      printf (_("Register %d"), p->offset);
      break;
      break;
    case coff_where_member_of_struct:
    case coff_where_member_of_struct:
      printf ("Struct Member offset %x", p->offset);
      printf (_("Struct Member offset %x"), p->offset);
      break;
      break;
    case coff_where_member_of_enum:
    case coff_where_member_of_enum:
      printf ("Enum Member offset %x", p->offset);
      printf (_("Enum Member offset %x"), p->offset);
      break;
      break;
    case coff_where_unknown:
    case coff_where_unknown:
      printf ("Undefined symbol");
      printf (_("Undefined symbol"));
      break;
      break;
    case coff_where_strtag:
    case coff_where_strtag:
      printf ("STRTAG");
      printf ("STRTAG");
    case coff_where_entag:
    case coff_where_entag:
      printf ("ENTAG");
      printf ("ENTAG");
      break;
      break;
    case coff_where_typedef:
    case coff_where_typedef:
      printf ("TYPEDEF");
      printf ("TYPEDEF");
      break;
      break;
    default:
    default:
      abort ();
      abort ();
    }
    }
  nl ();
  nl ();
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_visible (struct coff_visible *p)
dump_coff_visible (struct coff_visible *p)
{
{
  tab (1);
  tab (1);
  switch (p->type)
  switch (p->type)
    {
    {
    case coff_vis_ext_def:
    case coff_vis_ext_def:
      printf ("coff_vis_ext_def");
      printf ("coff_vis_ext_def");
      break;
      break;
    case coff_vis_ext_ref:
    case coff_vis_ext_ref:
      printf ("coff_vis_ext_ref");
      printf ("coff_vis_ext_ref");
      break;
      break;
    case coff_vis_int_def:
    case coff_vis_int_def:
      printf ("coff_vis_int_def");
      printf ("coff_vis_int_def");
      break;
      break;
    case coff_vis_common:
    case coff_vis_common:
      printf ("coff_vis_common");
      printf ("coff_vis_common");
      break;
      break;
    case coff_vis_auto:
    case coff_vis_auto:
      printf ("coff_vis_auto");
      printf ("coff_vis_auto");
      break;
      break;
    case coff_vis_autoparam:
    case coff_vis_autoparam:
      printf ("coff_vis_autoparam");
      printf ("coff_vis_autoparam");
      break;
      break;
    case coff_vis_regparam:
    case coff_vis_regparam:
      printf ("coff_vis_regparam");
      printf ("coff_vis_regparam");
      break;
      break;
    case coff_vis_register:
    case coff_vis_register:
      printf ("coff_vis_register");
      printf ("coff_vis_register");
      break;
      break;
    case coff_vis_tag:
    case coff_vis_tag:
      printf ("coff_vis_tag");
      printf ("coff_vis_tag");
      break;
      break;
    case coff_vis_member_of_struct:
    case coff_vis_member_of_struct:
      printf ("coff_vis_member_of_struct");
      printf ("coff_vis_member_of_struct");
      break;
      break;
    case coff_vis_member_of_enum:
    case coff_vis_member_of_enum:
      printf ("coff_vis_member_of_enum");
      printf ("coff_vis_member_of_enum");
      break;
      break;
    default:
    default:
      abort ();
      abort ();
    }
    }
  nl ();
  nl ();
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_symbol (struct coff_symbol *p)
dump_coff_symbol (struct coff_symbol *p)
{
{
  tab (1);
  tab (1);
  printf ("List of symbols");
  printf (_("List of symbols"));
  nl ();
  nl ();
 
 
  while (p)
  while (p)
    {
    {
      tab (1);
      tab (1);
      tab (1);
      tab (1);
      printf ("Symbol  %s, tag %d, number %d", p->name, p->tag, p->number);
      printf (_("Symbol  %s, tag %d, number %d"), p->name, p->tag, p->number);
      nl ();
      nl ();
      tab (-1);
      tab (-1);
      tab (1);
      tab (1);
      printf ("Type");
      printf (_("Type"));
      nl ();
      nl ();
      dump_coff_type (p->type);
      dump_coff_type (p->type);
      tab (-1);
      tab (-1);
      tab (1);
      tab (1);
      printf ("Where");
      printf (_("Where"));
      dump_coff_where (p->where);
      dump_coff_where (p->where);
      tab (-1);
      tab (-1);
      tab (1);
      tab (1);
      printf ("Visible");
      printf (_("Visible"));
      dump_coff_visible (p->visible);
      dump_coff_visible (p->visible);
      tab (-1);
      tab (-1);
      p = p->next;
      p = p->next;
      tab (-1);
      tab (-1);
    }
    }
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_scope (struct coff_scope *p)
dump_coff_scope (struct coff_scope *p)
{
{
  if (p)
  if (p)
    {
    {
      tab (1);
      tab (1);
      printf ("List of blocks %" BFD_VMA_FMT "x ",(bfd_vma) (uintptr_t) p);
      printf ("%s %" BFD_VMA_FMT "x ",
 
              _("List of blocks "), (bfd_vma) (uintptr_t) p);
 
 
      if (p->sec)
      if (p->sec)
        printf( "  %s %x..%x",  p->sec->name,p->offset, p->offset + p->size -1);
        printf( "  %s %x..%x",  p->sec->name,p->offset, p->offset + p->size -1);
 
 
      nl ();
      nl ();
      tab (0);
      tab (0);
      printf ("*****************");
      printf ("*****************");
      nl ();
      nl ();
 
 
      while (p)
      while (p)
        {
        {
          tab (0);
          tab (0);
          printf ("vars %d", p->nvars);
          printf (_("vars %d"), p->nvars);
          nl ();
          nl ();
          dump_coff_symbol (p->vars_head);
          dump_coff_symbol (p->vars_head);
          printf ("blocks");
          printf (_("blocks"));
          nl ();
          nl ();
          dump_coff_scope (p->list_head);
          dump_coff_scope (p->list_head);
          nl ();
          nl ();
          p = p->next;
          p = p->next;
        }
        }
 
 
      tab (0);
      tab (0);
      printf ("*****************");
      printf ("*****************");
      nl ();
      nl ();
      tab (-1);
      tab (-1);
    }
    }
}
}
 
 
static void
static void
dump_coff_sfile (struct coff_sfile *p)
dump_coff_sfile (struct coff_sfile *p)
{
{
  tab (1);
  tab (1);
  printf ("List of source files");
  printf (_("List of source files"));
  nl ();
  nl ();
 
 
  while (p)
  while (p)
    {
    {
      tab (0);
      tab (0);
      printf ("Source file %s", p->name);
      printf (_("Source file %s"), p->name);
      nl ();
      nl ();
      dump_coff_scope (p->scope);
      dump_coff_scope (p->scope);
      p = p->next;
      p = p->next;
    }
    }
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
dump_coff_section (struct coff_section *ptr)
dump_coff_section (struct coff_section *ptr)
{
{
  int i;
  int i;
 
 
  tab (1);
  tab (1);
  printf ("section %s %d %d address %x size %x number %d nrelocs %d",
  printf (_("section %s %d %d address %x size %x number %d nrelocs %d"),
          ptr->name, ptr->code, ptr->data, ptr->address,ptr->size,
          ptr->name, ptr->code, ptr->data, ptr->address,ptr->size,
          ptr->number, ptr->nrelocs);
          ptr->number, ptr->nrelocs);
  nl ();
  nl ();
 
 
  for (i = 0; i < ptr->nrelocs; i++)
  for (i = 0; i < ptr->nrelocs; i++)
    {
    {
      tab (0);
      tab (0);
      printf ("(%x %s %x)",
      printf ("(%x %s %x)",
              ptr->relocs[i].offset,
              ptr->relocs[i].offset,
              ptr->relocs[i].symbol->name,
              ptr->relocs[i].symbol->name,
              ptr->relocs[i].addend);
              ptr->relocs[i].addend);
      nl ();
      nl ();
    }
    }
 
 
  tab (-1);
  tab (-1);
}
}
 
 
static void
static void
coff_dump (struct coff_ofile *ptr)
coff_dump (struct coff_ofile *ptr)
{
{
  int i;
  int i;
 
 
  printf ("Coff dump");
  printf ("Coff dump");
  nl ();
  nl ();
  printf ("#sources %d", ptr->nsources);
  printf (_("#sources %d"), ptr->nsources);
  nl ();
  nl ();
  dump_coff_sfile (ptr->source_head);
  dump_coff_sfile (ptr->source_head);
 
 
  for (i = 0; i < ptr->nsections; i++)
  for (i = 0; i < ptr->nsections; i++)
    dump_coff_section (ptr->sections + i);
    dump_coff_section (ptr->sections + i);
}
}
 
 
char * program_name;
char * program_name;
 
 
static void
static void
show_usage (FILE *file, int status)
show_usage (FILE *file, int status)
{
{
  fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name);
  fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name);
  fprintf (file, _(" Print a human readable interpretation of a COFF object file\n"));
  fprintf (file, _(" Print a human readable interpretation of a COFF object file\n"));
  fprintf (file, _(" The options are:\n\
  fprintf (file, _(" The options are:\n\
  @<file>                Read options from <file>\n\
  @<file>                Read options from <file>\n\
  -h --help              Display this information\n\
  -h --help              Display this information\n\
  -v --version           Display the program's version\n\
  -v --version           Display the program's version\n\
\n"));
\n"));
 
 
  if (REPORT_BUGS_TO[0] && status == 0)
  if (REPORT_BUGS_TO[0] && status == 0)
    fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
    fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
 
 
  exit (status);
  exit (status);
}
}
 
 
int
int
main (int ac, char **av)
main (int ac, char **av)
{
{
  bfd *abfd;
  bfd *abfd;
  struct coff_ofile *tree;
  struct coff_ofile *tree;
  char **matching;
  char **matching;
  char *input_file = NULL;
  char *input_file = NULL;
  int opt;
  int opt;
  static struct option long_options[] =
  static struct option long_options[] =
    {
    {
      { "help", no_argument, 0, 'h' },
      { "help", no_argument, 0, 'h' },
      { "version", no_argument, 0, 'V' },
      { "version", no_argument, 0, 'V' },
      { NULL, no_argument, 0, 0 }
      { NULL, no_argument, 0, 0 }
    };
    };
 
 
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
  setlocale (LC_MESSAGES, "");
  setlocale (LC_MESSAGES, "");
#endif
#endif
#if defined (HAVE_SETLOCALE)
#if defined (HAVE_SETLOCALE)
  setlocale (LC_CTYPE, "");
  setlocale (LC_CTYPE, "");
#endif
#endif
  bindtextdomain (PACKAGE, LOCALEDIR);
  bindtextdomain (PACKAGE, LOCALEDIR);
  textdomain (PACKAGE);
  textdomain (PACKAGE);
 
 
  program_name = av[0];
  program_name = av[0];
  xmalloc_set_program_name (program_name);
  xmalloc_set_program_name (program_name);
 
 
  expandargv (&ac, &av);
  expandargv (&ac, &av);
 
 
  while ((opt = getopt_long (ac, av, "HhVv", long_options,
  while ((opt = getopt_long (ac, av, "HhVv", long_options,
                             (int *) NULL))
                             (int *) NULL))
         != EOF)
         != EOF)
    {
    {
      switch (opt)
      switch (opt)
        {
        {
        case 'H':
        case 'H':
        case 'h':
        case 'h':
          show_usage (stdout, 0);
          show_usage (stdout, 0);
          break;
          break;
        case 'v':
        case 'v':
        case 'V':
        case 'V':
          print_version ("coffdump");
          print_version ("coffdump");
          exit (0);
          exit (0);
        case 0:
        case 0:
          break;
          break;
        default:
        default:
          show_usage (stderr, 1);
          show_usage (stderr, 1);
          break;
          break;
        }
        }
    }
    }
 
 
  if (optind < ac)
  if (optind < ac)
    {
    {
      input_file = av[optind];
      input_file = av[optind];
    }
    }
 
 
  if (!input_file)
  if (!input_file)
    fatal (_("no input file specified"));
    fatal (_("no input file specified"));
 
 
  abfd = bfd_openr (input_file, 0);
  abfd = bfd_openr (input_file, 0);
 
 
  if (!abfd)
  if (!abfd)
    bfd_fatal (input_file);
    bfd_fatal (input_file);
 
 
  if (! bfd_check_format_matches (abfd, bfd_object, &matching))
  if (! bfd_check_format_matches (abfd, bfd_object, &matching))
    {
    {
      bfd_nonfatal (input_file);
      bfd_nonfatal (input_file);
 
 
      if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
      if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
        {
        {
          list_matching_formats (matching);
          list_matching_formats (matching);
          free (matching);
          free (matching);
        }
        }
      exit (1);
      exit (1);
    }
    }
 
 
  tree = coff_grok (abfd);
  tree = coff_grok (abfd);
 
 
  coff_dump (tree);
  coff_dump (tree);
  printf ("\n");
  printf ("\n");
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.