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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [binutils/] [od-xcoff.c] - Diff between revs 148 and 163

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 148 Rev 163
Line 457... Line 457...
      non_fatal (_("cannot read auxhdr"));
      non_fatal (_("cannot read auxhdr"));
      return;
      return;
    }
    }
 
 
  magic = bfd_h_get_16 (abfd, auxhdr.magic);
  magic = bfd_h_get_16 (abfd, auxhdr.magic);
  printf (_("  o_mflag (magic): 0x%04x 0%04o\n"), magic, magic);
  /* We don't translate these strings as they are fields name.  */
  printf (_("  o_vstamp:        0x%04x\n"),
  printf ("  o_mflag (magic): 0x%04x 0%04o\n", magic, magic);
 
  printf ("  o_vstamp:        0x%04x\n",
          (unsigned short)bfd_h_get_16 (abfd, auxhdr.vstamp));
          (unsigned short)bfd_h_get_16 (abfd, auxhdr.vstamp));
  printf (_("  o_tsize:         0x%08x\n"),
  printf ("  o_tsize:         0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.tsize));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.tsize));
  printf (_("  o_dsize:         0x%08x\n"),
  printf ("  o_dsize:         0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.dsize));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.dsize));
  printf (_("  o_entry:         0x%08x\n"),
  printf ("  o_entry:         0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.entry));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.entry));
  printf (_("  o_text_start:    0x%08x\n"),
  printf ("  o_text_start:    0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.text_start));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.text_start));
  printf (_("  o_data_start:    0x%08x\n"),
  printf ("  o_data_start:    0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.data_start));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.data_start));
  if (sz == offsetof (AOUTHDR, o_toc))
  if (sz == offsetof (AOUTHDR, o_toc))
    return;
    return;
  printf (_("  o_toc:           0x%08x\n"),
  printf ("  o_toc:           0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_toc));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_toc));
  printf (_("  o_snentry:       0x%04x\n"),
  printf ("  o_snentry:       0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snentry));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snentry));
  printf (_("  o_sntext:        0x%04x\n"),
  printf ("  o_sntext:        0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sntext));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sntext));
  printf (_("  o_sndata:        0x%04x\n"),
  printf ("  o_sndata:        0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sndata));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sndata));
  printf (_("  o_sntoc:         0x%04x\n"),
  printf ("  o_sntoc:         0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sntoc));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_sntoc));
  printf (_("  o_snloader:      0x%04x\n"),
  printf ("  o_snloader:      0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snloader));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snloader));
  printf (_("  o_snbss:         0x%04x\n"),
  printf ("  o_snbss:         0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snbss));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_snbss));
  printf (_("  o_algntext:      %u\n"),
  printf ("  o_algntext:      %u\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_algntext));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_algntext));
  printf (_("  o_algndata:      %u\n"),
  printf ("  o_algndata:      %u\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_algndata));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_algndata));
  printf (_("  o_modtype:       0x%04x"),
  printf ("  o_modtype:       0x%04x",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_modtype));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_modtype));
  if (ISPRINT (auxhdr.o_modtype[0]) && ISPRINT (auxhdr.o_modtype[1]))
  if (ISPRINT (auxhdr.o_modtype[0]) && ISPRINT (auxhdr.o_modtype[1]))
    printf (" (%c%c)", auxhdr.o_modtype[0], auxhdr.o_modtype[1]);
    printf (" (%c%c)", auxhdr.o_modtype[0], auxhdr.o_modtype[1]);
  putchar ('\n');
  putchar ('\n');
  printf (_("  o_cputype:       0x%04x\n"),
  printf ("  o_cputype:       0x%04x\n",
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_cputype));
          (unsigned int)bfd_h_get_16 (abfd, auxhdr.o_cputype));
  printf (_("  o_maxstack:      0x%08x\n"),
  printf ("  o_maxstack:      0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_maxstack));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_maxstack));
  printf (_("  o_maxdata:       0x%08x\n"),
  printf ("  o_maxdata:       0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_maxdata));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_maxdata));
#if 0
#if 0
  printf (_("  o_debugger:      0x%08x\n"),
  printf ("  o_debugger:      0x%08x\n",
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_debugger));
          (unsigned int)bfd_h_get_32 (abfd, auxhdr.o_debugger));
#endif
#endif
}
}
 
 
/* Dump the sections header.  */
/* Dump the sections header.  */
Line 529... Line 530...
  if (bfd_seek (abfd, off, SEEK_SET) != 0)
  if (bfd_seek (abfd, off, SEEK_SET) != 0)
    {
    {
      non_fatal (_("cannot read section header"));
      non_fatal (_("cannot read section header"));
      return;
      return;
    }
    }
  printf (_(" # Name     paddr    vaddr    size     scnptr   relptr   lnnoptr  nrel  nlnno\n"));
  /* We don't translate this string as it consists in fields name.  */
 
  printf (" # Name     paddr    vaddr    size     scnptr   relptr   lnnoptr  nrel  nlnno\n");
  for (i = 0; i < data->nscns; i++)
  for (i = 0; i < data->nscns; i++)
    {
    {
      struct external_scnhdr scn;
      struct external_scnhdr scn;
      unsigned int flags;
      unsigned int flags;
 
 
Line 541... Line 543...
        {
        {
          non_fatal (_("cannot read section header"));
          non_fatal (_("cannot read section header"));
          return;
          return;
        }
        }
      flags = bfd_h_get_32 (abfd, scn.s_flags);
      flags = bfd_h_get_32 (abfd, scn.s_flags);
      printf (_("%2d %-8.8s %08x %08x %08x %08x %08x %08x "
      printf ("%2d %-8.8s %08x %08x %08x %08x %08x %08x %-5d %-5d\n",
                "%-5d %-5d\n"),
 
              i + 1, scn.s_name,
              i + 1, scn.s_name,
              (unsigned int)bfd_h_get_32 (abfd, scn.s_paddr),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_paddr),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_vaddr),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_vaddr),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_size),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_size),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_scnptr),
              (unsigned int)bfd_h_get_32 (abfd, scn.s_scnptr),
Line 745... Line 746...
    {
    {
      printf (_(":\n  No symbols\n"));
      printf (_(":\n  No symbols\n"));
      return;
      return;
    }
    }
 
 
  /* Read string table.  */
  /* Read strings table.  */
  if (data->strings_size == 0)
  if (data->strings_size == 0)
    printf (_(" (no strings):\n"));
    printf (_(" (no strings):\n"));
  else
  else
    printf (_(" (strings size: %08x):\n"), data->strings_size);
    printf (_(" (strings size: %08x):\n"), data->strings_size);
 
 
Line 762... Line 763...
      size = bfd_get_section_size (debugsec);
      size = bfd_get_section_size (debugsec);
      debug = (char *) xmalloc (size);
      debug = (char *) xmalloc (size);
      bfd_get_section_contents (abfd, debugsec, debug, 0, size);
      bfd_get_section_contents (abfd, debugsec, debug, 0, size);
    }
    }
 
 
 
  /* Translators: 'sc' is for storage class, 'off' for offset.  */
  printf (_("  # sc         value    section  type aux name/off\n"));
  printf (_("  # sc         value    section  type aux name/off\n"));
  for (i = 0; i < data->nsyms; i++)
  for (i = 0; i < data->nsyms; i++)
    {
    {
      union xcoff32_symbol *s = &data->syms[i];
      union xcoff32_symbol *s = &data->syms[i];
      int j;
      int j;
Line 813... Line 815...
 
 
          printf (" %3u ", i + 1);
          printf (" %3u ", i + 1);
          switch (s->sym.sclass)
          switch (s->sym.sclass)
            {
            {
            case C_STAT:
            case C_STAT:
 
              /* Section length, number of relocs and line number.  */
              printf (_("  scnlen: %08x  nreloc: %-6u  nlinno: %-6u\n"),
              printf (_("  scnlen: %08x  nreloc: %-6u  nlinno: %-6u\n"),
                      (unsigned)bfd_h_get_32 (abfd, aux->x_scn.x_scnlen),
                      (unsigned)bfd_h_get_32 (abfd, aux->x_scn.x_scnlen),
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nreloc),
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nreloc),
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nlinno));
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nlinno));
              break;
              break;
            case C_DWARF:
            case C_DWARF:
 
              /* Section length and number of relocs.  */
              printf (_("  scnlen: %08x  nreloc: %-6u\n"),
              printf (_("  scnlen: %08x  nreloc: %-6u\n"),
                      (unsigned)bfd_h_get_32 (abfd, aux->x_scn.x_scnlen),
                      (unsigned)bfd_h_get_32 (abfd, aux->x_scn.x_scnlen),
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nreloc));
                      (unsigned)bfd_h_get_16 (abfd, aux->x_scn.x_nreloc));
              break;
              break;
            case C_EXT:
            case C_EXT:
            case C_WEAKEXT:
            case C_WEAKEXT:
            case C_HIDEXT:
            case C_HIDEXT:
              if (j == 0 && s->sym.numaux > 1)
              if (j == 0 && s->sym.numaux > 1)
                {
                {
                  /* Function aux entry.  */
                  /* Function aux entry  (Do not translate).  */
                  printf (_("  exptr: %08x fsize: %08x lnnoptr: %08x endndx: %u\n"),
                  printf ("  exptr: %08x fsize: %08x lnnoptr: %08x endndx: %u\n",
                          (unsigned)bfd_h_get_32 (abfd, aux->x_sym.x_tagndx),
                          (unsigned)bfd_h_get_32 (abfd, aux->x_sym.x_tagndx),
                          (unsigned)bfd_h_get_32
                          (unsigned)bfd_h_get_32
                            (abfd, aux->x_sym.x_misc.x_fsize),
                            (abfd, aux->x_sym.x_misc.x_fsize),
                          (unsigned)bfd_h_get_32
                          (unsigned)bfd_h_get_32
                            (abfd, aux->x_sym.x_fcnary.x_fcn.x_lnnoptr),
                            (abfd, aux->x_sym.x_fcnary.x_fcn.x_lnnoptr),
Line 848... Line 852...
 
 
                  smtyp = bfd_h_get_8 (abfd, aux->x_csect.x_smtyp);
                  smtyp = bfd_h_get_8 (abfd, aux->x_csect.x_smtyp);
                  scnlen = bfd_h_get_32 (abfd, aux->x_csect.x_scnlen);
                  scnlen = bfd_h_get_32 (abfd, aux->x_csect.x_scnlen);
 
 
                  if (smtyp == XTY_LD)
                  if (smtyp == XTY_LD)
                    printf (_("  scnsym: %-8u"), scnlen);
                    printf ("  scnsym: %-8u", scnlen);
                  else
                  else
                    printf (_("  scnlen: %08x"), scnlen);
                    printf ("  scnlen: %08x", scnlen);
                  printf (_(" h: parm=%08x sn=%04x al: 2**%u"),
                  printf (" h: parm=%08x sn=%04x al: 2**%u",
                          (unsigned)bfd_h_get_32 (abfd, aux->x_csect.x_parmhash),
                          (unsigned)bfd_h_get_32 (abfd, aux->x_csect.x_parmhash),
                          (unsigned)bfd_h_get_16 (abfd, aux->x_csect.x_snhash),
                          (unsigned)bfd_h_get_16 (abfd, aux->x_csect.x_snhash),
                          SMTYP_ALIGN (smtyp));
                          SMTYP_ALIGN (smtyp));
                  printf (_(" typ: "));
                  printf (" typ: ");
                  dump_value (smtyp_xlat, SMTYP_SMTYP (smtyp), 2);
                  dump_value (smtyp_xlat, SMTYP_SMTYP (smtyp), 2);
                  printf (_(" cl: "));
                  printf (" cl: ");
                  dump_value
                  dump_value
                    (smclas_xlat,
                    (smclas_xlat,
                     (unsigned)bfd_h_get_8 (abfd, aux->x_csect.x_smclas), 6);
                     (unsigned)bfd_h_get_8 (abfd, aux->x_csect.x_smclas), 6);
                  putchar ('\n');
                  putchar ('\n');
                }
                }
              else
              else
 
                /* Do not translate - generic field name.  */
                printf ("aux\n");
                printf ("aux\n");
              break;
              break;
            case C_FILE:
            case C_FILE:
              {
              {
                unsigned int off;
                unsigned int off;
 
 
                printf (_(" ftype: %02x "),
                printf (" ftype: %02x ",
                        (unsigned)bfd_h_get_8 (abfd, aux->x_file.x_ftype));
                        (unsigned)bfd_h_get_8 (abfd, aux->x_file.x_ftype));
                if (aux->x_file.x_n.x_fname[0] != 0)
                if (aux->x_file.x_n.x_fname[0] != 0)
                  printf (_("fname: %.14s"), aux->x_file.x_n.x_fname);
                  printf ("fname: %.14s", aux->x_file.x_n.x_fname);
                else
                else
                  {
                  {
                    off = (unsigned)bfd_h_get_32
                    off = (unsigned)bfd_h_get_32
                      (abfd, aux->x_file.x_n.x_n.x_offset);
                      (abfd, aux->x_file.x_n.x_n.x_offset);
                    if (data->strings != NULL && off < data->strings_size)
                    if (data->strings != NULL && off < data->strings_size)
                      printf (_(" %s"), data->strings + off);
                      printf (" %s", data->strings + off);
                    else
                    else
                      printf (_("offset: %08x"), off);
                      printf (_("offset: %08x"), off);
                  }
                  }
                putchar ('\n');
                putchar ('\n');
              }
              }
              break;
              break;
            case C_BLOCK:
            case C_BLOCK:
            case C_FCN:
            case C_FCN:
              printf (_("  lnno: %u\n"),
              printf ("  lnno: %u\n",
                      (unsigned)bfd_h_get_16
                      (unsigned)bfd_h_get_16
                      (abfd, aux->x_sym.x_misc.x_lnsz.x_lnno));
                      (abfd, aux->x_sym.x_misc.x_lnsz.x_lnno));
              break;
              break;
            default:
            default:
 
              /* Do not translate - generic field name.  */
              printf ("aux\n");
              printf ("aux\n");
              break;
              break;
            }
            }
        }
        }
 
 
Line 929... Line 935...
      if (bfd_seek (abfd, sect->relptr, SEEK_SET) != 0)
      if (bfd_seek (abfd, sect->relptr, SEEK_SET) != 0)
        {
        {
          non_fatal (_("cannot read relocations"));
          non_fatal (_("cannot read relocations"));
          continue;
          continue;
        }
        }
      printf (_("vaddr    sgn mod sz type  symndx symbol\n"));
      /* Do not translate: fields name.  */
 
      printf ("vaddr    sgn mod sz type  symndx symbol\n");
      for (j = 0; j < nrel; j++)
      for (j = 0; j < nrel; j++)
        {
        {
          struct external_reloc rel;
          struct external_reloc rel;
          unsigned char rsize;
          unsigned char rsize;
          unsigned int symndx;
          unsigned int symndx;
Line 942... Line 949...
            {
            {
              non_fatal (_("cannot read relocation entry"));
              non_fatal (_("cannot read relocation entry"));
              return;
              return;
            }
            }
          rsize = bfd_h_get_8 (abfd, rel.r_size);
          rsize = bfd_h_get_8 (abfd, rel.r_size);
          printf (_("%08x  %c   %c  %-2u "),
          printf ("%08x  %c   %c  %-2u ",
                  (unsigned int)bfd_h_get_32 (abfd, rel.r_vaddr),
                  (unsigned int)bfd_h_get_32 (abfd, rel.r_vaddr),
                  rsize & 0x80 ? 'S' : 'U',
                  rsize & 0x80 ? 'S' : 'U',
                  rsize & 0x40 ? 'm' : ' ',
                  rsize & 0x40 ? 'm' : ' ',
                  (rsize & 0x3f) + 1);
                  (rsize & 0x3f) + 1);
          dump_value (rtype_xlat, bfd_h_get_8 (abfd, rel.r_type), 6);
          dump_value (rtype_xlat, bfd_h_get_8 (abfd, rel.r_type), 6);
Line 984... Line 991...
      if (bfd_seek (abfd, sect->lnnoptr, SEEK_SET) != 0)
      if (bfd_seek (abfd, sect->lnnoptr, SEEK_SET) != 0)
        {
        {
          non_fatal (_("cannot read line numbers"));
          non_fatal (_("cannot read line numbers"));
          continue;
          continue;
        }
        }
 
      /* Line number, symbol index and physical address.  */
      printf (_("lineno  symndx/paddr\n"));
      printf (_("lineno  symndx/paddr\n"));
      for (j = 0; j < nlnno; j++)
      for (j = 0; j < nlnno; j++)
        {
        {
          struct external_lineno ln;
          struct external_lineno ln;
          unsigned int no;
          unsigned int no;
Line 996... Line 1004...
            {
            {
              non_fatal (_("cannot read line number entry"));
              non_fatal (_("cannot read line number entry"));
              return;
              return;
            }
            }
          no = bfd_h_get_16 (abfd, ln.l_lnno);
          no = bfd_h_get_16 (abfd, ln.l_lnno);
          printf (_(" %-6u "), no);
          printf (" %-6u ", no);
          if (no == 0)
          if (no == 0)
            {
            {
              unsigned int symndx = bfd_h_get_32 (abfd, ln.l_addr.l_symndx);
              unsigned int symndx = bfd_h_get_32 (abfd, ln.l_addr.l_symndx);
              xcoff32_print_symbol (data, symndx);
              xcoff32_print_symbol (data, symndx);
            }
            }
Line 1061... Line 1069...
    }
    }
  ndsyms = bfd_h_get_32 (abfd, lhdr->l_nsyms);
  ndsyms = bfd_h_get_32 (abfd, lhdr->l_nsyms);
  printf (_("  nbr symbols:       %u\n"), ndsyms);
  printf (_("  nbr symbols:       %u\n"), ndsyms);
  ndrel = bfd_h_get_32 (abfd, lhdr->l_nreloc);
  ndrel = bfd_h_get_32 (abfd, lhdr->l_nreloc);
  printf (_("  nbr relocs:        %u\n"), ndrel);
  printf (_("  nbr relocs:        %u\n"), ndrel);
 
  /* Import string table length.  */
  printf (_("  import strtab len: %u\n"),
  printf (_("  import strtab len: %u\n"),
          (unsigned) bfd_h_get_32 (abfd, lhdr->l_istlen));
          (unsigned) bfd_h_get_32 (abfd, lhdr->l_istlen));
  nimpid = bfd_h_get_32 (abfd, lhdr->l_nimpid);
  nimpid = bfd_h_get_32 (abfd, lhdr->l_nimpid);
  printf (_("  nbr import files:  %u\n"), nimpid);
  printf (_("  nbr import files:  %u\n"), nimpid);
  impoff = bfd_h_get_32 (abfd, lhdr->l_impoff);
  impoff = bfd_h_get_32 (abfd, lhdr->l_impoff);
Line 1074... Line 1083...
  stoff = bfd_h_get_32 (abfd, lhdr->l_stoff);
  stoff = bfd_h_get_32 (abfd, lhdr->l_stoff);
  printf (_("  string table off:  %u\n"), stoff);
  printf (_("  string table off:  %u\n"), stoff);
 
 
  ldsym = (struct external_ldsym *)(ldr_data + sizeof (*lhdr));
  ldsym = (struct external_ldsym *)(ldr_data + sizeof (*lhdr));
  printf (_("Dynamic symbols:\n"));
  printf (_("Dynamic symbols:\n"));
  printf (_("     # value     sc IFEW ty class file  pa name\n"));
  /* Do not translate: field names.  */
 
  printf ("     # value     sc IFEW ty class file  pa name\n");
  for (i = 0; i < ndsyms; i++, ldsym++)
  for (i = 0; i < ndsyms; i++, ldsym++)
    {
    {
      unsigned char smtype;
      unsigned char smtype;
 
 
      printf (_("  %4u %08x %3u "), i,
      printf (_("  %4u %08x %3u "), i,
Line 1109... Line 1119...
        }
        }
      putchar ('\n');
      putchar ('\n');
    }
    }
 
 
  printf (_("Dynamic relocs:\n"));
  printf (_("Dynamic relocs:\n"));
  printf (_("  vaddr    sec    sz typ   sym\n"));
  /* Do not translate fields name.  */
 
  printf ("  vaddr    sec    sz typ   sym\n");
  ldrel = (struct external_ldrel *)(ldr_data + sizeof (*lhdr)
  ldrel = (struct external_ldrel *)(ldr_data + sizeof (*lhdr)
                                    + ndsyms * sizeof (*ldsym));
                                    + ndsyms * sizeof (*ldsym));
  for (i = 0; i < ndrel; i++, ldrel++)
  for (i = 0; i < ndrel; i++, ldrel++)
    {
    {
      unsigned int rsize;
      unsigned int rsize;
Line 1121... Line 1132...
      unsigned int symndx;
      unsigned int symndx;
 
 
      rsize = bfd_h_get_8 (abfd, ldrel->l_rtype + 0);
      rsize = bfd_h_get_8 (abfd, ldrel->l_rtype + 0);
      rtype = bfd_h_get_8 (abfd, ldrel->l_rtype + 1);
      rtype = bfd_h_get_8 (abfd, ldrel->l_rtype + 1);
 
 
      printf (_("  %08x %3u %c%c %2u "),
      printf ("  %08x %3u %c%c %2u ",
              (unsigned)bfd_h_get_32 (abfd, ldrel->l_vaddr),
              (unsigned)bfd_h_get_32 (abfd, ldrel->l_vaddr),
              (unsigned)bfd_h_get_16 (abfd, ldrel->l_rsecnm),
              (unsigned)bfd_h_get_16 (abfd, ldrel->l_rsecnm),
              rsize & 0x80 ? 'S' : 'U',
              rsize & 0x80 ? 'S' : 'U',
              rsize & 0x40 ? 'm' : ' ',
              rsize & 0x40 ? 'm' : ' ',
              (rsize & 0x3f) + 1);
              (rsize & 0x3f) + 1);
      dump_value (rtype_xlat, rtype, 6);
      dump_value (rtype_xlat, rtype, 6);
      symndx = bfd_h_get_32 (abfd, ldrel->l_symndx);
      symndx = bfd_h_get_32 (abfd, ldrel->l_symndx);
      switch (symndx)
      switch (symndx)
        {
        {
        case 0:
        case 0:
          printf (_(".text"));
          printf (".text");
          break;
          break;
        case 1:
        case 1:
          printf (_(".data"));
          printf (".data");
          break;
          break;
        case 2:
        case 2:
          printf (_(".bss"));
          printf (".bss");
          break;
          break;
        default:
        default:
          printf (_("%u"), symndx - 3);
          printf ("%u", symndx - 3);
          break;
          break;
        }
        }
      putchar ('\n');
      putchar ('\n');
    }
    }
 
 
Line 1188... Line 1199...
  excp_data = (bfd_byte *) xmalloc (size);
  excp_data = (bfd_byte *) xmalloc (size);
  bfd_get_section_contents (abfd, sec, excp_data, 0, size);
  bfd_get_section_contents (abfd, sec, excp_data, 0, size);
  exceptab = (struct external_exceptab *)excp_data;
  exceptab = (struct external_exceptab *)excp_data;
 
 
  printf (_("Exception table:\n"));
  printf (_("Exception table:\n"));
  printf (_("lang reason sym/addr\n"));
  /* Do not translate fields name.  */
 
  printf ("lang reason sym/addr\n");
  for (i = 0; i * sizeof (*exceptab) < size; i++, exceptab++)
  for (i = 0; i * sizeof (*exceptab) < size; i++, exceptab++)
    {
    {
      unsigned int reason;
      unsigned int reason;
      unsigned int addr;
      unsigned int addr;
 
 
      addr = bfd_get_32 (abfd, exceptab->e_addr.e_paddr);
      addr = bfd_get_32 (abfd, exceptab->e_addr.e_paddr);
      reason = bfd_get_8 (abfd, exceptab->e_reason);
      reason = bfd_get_8 (abfd, exceptab->e_reason);
      printf (_("  %02x     %02x "),
      printf ("  %02x     %02x ",
              (unsigned) bfd_get_8 (abfd, exceptab->e_lang), reason);
              (unsigned) bfd_get_8 (abfd, exceptab->e_lang), reason);
      if (reason == 0)
      if (reason == 0)
        xcoff32_print_symbol (data, addr);
        xcoff32_print_symbol (data, addr);
      else
      else
        printf (_("@%08x"), addr);
        printf ("@%08x", addr);
      putchar ('\n');
      putchar ('\n');
    }
    }
  free (excp_data);
  free (excp_data);
}
}
 
 
Line 1229... Line 1241...
  size = bfd_get_section_size (sec);
  size = bfd_get_section_size (sec);
  data = (bfd_byte *) xmalloc (size);
  data = (bfd_byte *) xmalloc (size);
  bfd_get_section_contents (abfd, sec, data, 0, size);
  bfd_get_section_contents (abfd, sec, data, 0, size);
 
 
  printf (_("Type-check section:\n"));
  printf (_("Type-check section:\n"));
  printf (_("offset    len  lang-id general-hash language-hash\n"));
  /* Do not translate field names.  */
 
  printf ("offset    len  lang-id general-hash language-hash\n");
  for (i = 0; i < size;)
  for (i = 0; i < size;)
    {
    {
      unsigned int len;
      unsigned int len;
 
 
      len = bfd_get_16 (abfd, data + i);
      len = bfd_get_16 (abfd, data + i);
Line 1291... Line 1304...
          goto truncated;
          goto truncated;
 
 
        tb1 = bfd_get_32 (abfd, text + i + 4);
        tb1 = bfd_get_32 (abfd, text + i + 4);
        tb2 = bfd_get_32 (abfd, text + i + 8);
        tb2 = bfd_get_32 (abfd, text + i + 8);
        off = i + 12;
        off = i + 12;
        printf (_(" version: %u, lang: %u, global_link: %u, is_eprol: %u, has_tboff: %u, int_proc: %u\n"),
        printf (" version: %u, lang: %u, global_link: %u, is_eprol: %u, has_tboff: %u, int_proc: %u\n",
                (tb1 >> 24) & 0xff,
                (tb1 >> 24) & 0xff,
                (tb1 >> 16) & 0xff,
                (tb1 >> 16) & 0xff,
                (tb1 >> 15) & 1,
                (tb1 >> 15) & 1,
                (tb1 >> 14) & 1,
                (tb1 >> 14) & 1,
                (tb1 >> 13) & 1,
                (tb1 >> 13) & 1,
                (tb1 >> 12) & 1);
                (tb1 >> 12) & 1);
        printf (_(" has_ctl: %u, tocless: %u, fp_pres: %u, log_abort: %u, int_hndl: %u\n"),
        printf (" has_ctl: %u, tocless: %u, fp_pres: %u, log_abort: %u, int_hndl: %u\n",
                (tb1 >> 11) & 1,
                (tb1 >> 11) & 1,
                (tb1 >> 10) & 1,
                (tb1 >> 10) & 1,
                (tb1 >> 9) & 1,
                (tb1 >> 9) & 1,
                (tb1 >> 8) & 1,
                (tb1 >> 8) & 1,
                (tb1 >> 7) & 1);
                (tb1 >> 7) & 1);
        printf (_(" name_pres: %u, uses_alloca: %u, cl_dis_inv: %u, saves_cr: %u, saves_lr: %u\n"),
        printf (" name_pres: %u, uses_alloca: %u, cl_dis_inv: %u, saves_cr: %u, saves_lr: %u\n",
                (tb1 >> 6) & 1,
                (tb1 >> 6) & 1,
                (tb1 >> 5) & 1,
                (tb1 >> 5) & 1,
                (tb1 >> 2) & 7,
                (tb1 >> 2) & 7,
                (tb1 >> 1) & 1,
                (tb1 >> 1) & 1,
                (tb1 >> 0) & 1);
                (tb1 >> 0) & 1);
        printf (_(" stores_bc: %u, fixup: %u, fpr_saved: %-2u, spare3: %u, gpr_saved: %-2u\n"),
        printf (" stores_bc: %u, fixup: %u, fpr_saved: %-2u, spare3: %u, gpr_saved: %-2u\n",
                (tb2 >> 31) & 1,
                (tb2 >> 31) & 1,
                (tb2 >> 30) & 1,
                (tb2 >> 30) & 1,
                (tb2 >> 24) & 63,
                (tb2 >> 24) & 63,
                (tb2 >> 22) & 3,
                (tb2 >> 22) & 3,
                (tb2 >> 16) & 63);
                (tb2 >> 16) & 63);
        printf (_(" fixparms: %-3u  floatparms: %-3u  parm_on_stk: %u\n"),
        printf (" fixparms: %-3u  floatparms: %-3u  parm_on_stk: %u\n",
                (tb2 >> 8) & 0xff,
                (tb2 >> 8) & 0xff,
                (tb2 >> 1) & 0x7f,
                (tb2 >> 1) & 0x7f,
                (tb2 >> 0) & 1);
                (tb2 >> 0) & 1);
 
 
        if (((tb2 >> 1) & 0x7fff) != 0)
        if (((tb2 >> 1) & 0x7fff) != 0)
Line 1329... Line 1342...
 
 
            if (off >= text_size)
            if (off >= text_size)
              goto truncated;
              goto truncated;
            parminfo = bfd_get_32 (abfd, text + off);
            parminfo = bfd_get_32 (abfd, text + off);
            off += 4;
            off += 4;
            printf (_(" parminfo: 0x%08x\n"), parminfo);
            printf (" parminfo: 0x%08x\n", parminfo);
          }
          }
 
 
        if ((tb1 >> 13) & 1)
        if ((tb1 >> 13) & 1)
          {
          {
            unsigned int tboff;
            unsigned int tboff;
 
 
            if (off >= text_size)
            if (off >= text_size)
              goto truncated;
              goto truncated;
            tboff = bfd_get_32 (abfd, text + off);
            tboff = bfd_get_32 (abfd, text + off);
            off += 4;
            off += 4;
            printf (_(" tb_offset: 0x%08x (start=0x%08x)\n"),
            printf (" tb_offset: 0x%08x (start=0x%08x)\n",
                    tboff, text_start + i - tboff);
                    tboff, text_start + i - tboff);
          }
          }
        if ((tb1 >> 7) & 1)
        if ((tb1 >> 7) & 1)
          {
          {
            unsigned int hand_mask;
            unsigned int hand_mask;
 
 
            if (off >= text_size)
            if (off >= text_size)
              goto truncated;
              goto truncated;
            hand_mask = bfd_get_32 (abfd, text + off);
            hand_mask = bfd_get_32 (abfd, text + off);
            off += 4;
            off += 4;
            printf (_(" hand_mask_offset: 0x%08x\n"), hand_mask);
            printf (" hand_mask_offset: 0x%08x\n", hand_mask);
          }
          }
        if ((tb1 >> 11) & 1)
        if ((tb1 >> 11) & 1)
          {
          {
            unsigned int ctl_info;
            unsigned int ctl_info;
            unsigned int j;
            unsigned int j;
Line 1367... Line 1380...
            printf (_(" number of CTL anchors: %u\n"), ctl_info);
            printf (_(" number of CTL anchors: %u\n"), ctl_info);
            for (j = 0; j < ctl_info; j++)
            for (j = 0; j < ctl_info; j++)
              {
              {
                if (off >= text_size)
                if (off >= text_size)
                  goto truncated;
                  goto truncated;
                printf (_("  CTL[%u]: %08x\n"),
                printf ("  CTL[%u]: %08x\n",
                          j, (unsigned)bfd_get_32 (abfd, text + off));
                          j, (unsigned)bfd_get_32 (abfd, text + off));
                off += 4;
                off += 4;
              }
              }
          }
          }
        if ((tb1 >> 6) & 1)
        if ((tb1 >> 6) & 1)
Line 1399... Line 1412...
          }
          }
        if ((tb1 >> 5) & 1)
        if ((tb1 >> 5) & 1)
          {
          {
            if (off >= text_size)
            if (off >= text_size)
              goto truncated;
              goto truncated;
            printf (_(" alloca reg: %u\n"),
            printf (" alloca reg: %u\n",
                    (unsigned) bfd_get_8 (abfd, text + off));
                    (unsigned) bfd_get_8 (abfd, text + off));
            off++;
            off++;
          }
          }
        printf (_(" (end of tags at %08x)\n"), text_start + off);
        printf (_(" (end of tags at %08x)\n"), text_start + off);
        return;
        return;

powered by: WebSVN 2.1.0

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