case DT_FEATURE_1:	return "FEATURE_1";
case DT_FEATURE:	return "FEATURE";
static const char *       get_segment_type            PARAMS ((unsigned long));static const char *       get_mips_section_type_name  PARAMS ((unsigned int));static const char *       get_parisc_section_type_name PARAMS ((unsigned int));static const char *       get_section_type_name       PARAMS ((unsigned int));static const char *       get_symbol_binding          PARAMS ((unsigned int));static const char *       get_symbol_type             PARAMS ((unsigned int));static const char *       get_symbol_visibility       PARAMS ((unsigned int));static const char *       get_symbol_index_type       PARAMS ((unsigned int));static const char *       get_dynamic_flags 	      PARAMS ((bfd_vma));static void               usage                       PARAMS ((void));static void               parse_args                  PARAMS ((int, char **));static int                process_file_header         PARAMS ((void));static int                process_program_headers     PARAMS ((FILE *));static int                process_section_headers     PARAMS ((FILE *));static void               dynamic_segment_mips_val    PARAMS ((Elf_Internal_Dyn *));static void               dynamic_segment_parisc_val  PARAMS ((Elf_Internal_Dyn *));static int                process_dynamic_segment     PARAMS ((FILE *));static int                process_symbol_table        PARAMS ((FILE *));static int                process_section_contents    PARAMS ((FILE *));static void               process_file                PARAMS ((char *));static int                process_relocs              PARAMS ((FILE *));static int                process_version_sections    PARAMS ((FILE *));static char *             get_ver_flags               PARAMS ((unsigned int));static int                get_32bit_section_headers   PARAMS ((FILE *));static int                get_64bit_section_headers   PARAMS ((FILE *));static int		  get_32bit_program_headers   PARAMS ((FILE *, Elf_Internal_Phdr *));static int		  get_64bit_program_headers   PARAMS ((FILE *, Elf_Internal_Phdr *));static int                get_file_header             PARAMS ((FILE *));static Elf_Internal_Sym * get_32bit_elf_symbols       PARAMS ((FILE *, unsigned long, unsigned long));static Elf_Internal_Sym * get_64bit_elf_symbols       PARAMS ((FILE *, unsigned long, unsigned long));static int *              get_dynamic_data            PARAMS ((FILE *, unsigned int));static int                get_32bit_dynamic_segment   PARAMS ((FILE *));static int                get_64bit_dynamic_segment   PARAMS ((FILE *));#ifdef SUPPORT_DISASSEMBLYstatic int 	          disassemble_section         PARAMS ((Elf32_Internal_Shdr *, FILE *));#endifstatic int 	          dump_section                PARAMS ((Elf32_Internal_Shdr *, FILE *));static int 	          display_debug_section       PARAMS ((Elf32_Internal_Shdr *, FILE *));static int                display_debug_info          PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *));static int                display_debug_not_supported PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *));static int                display_debug_lines         PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *));static int                display_debug_abbrev        PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *));static int                display_debug_aranges       PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *));static unsigned char *    process_abbrev_section      PARAMS ((unsigned char *, unsigned char *));static unsigned long      read_leb128                 PARAMS ((unsigned char *, int *, int));static int                process_extended_line_op    PARAMS ((unsigned char *, int, int));static void               reset_state_machine         PARAMS ((int));static char *             get_TAG_name                PARAMS ((unsigned long));static char *             get_AT_name                 PARAMS ((unsigned long));static char *             get_FORM_name               PARAMS ((unsigned long));static void               free_abbrevs                PARAMS ((void));static void               add_abbrev                  PARAMS ((unsigned long, unsigned long, int));static void               add_abbrev_attr             PARAMS ((unsigned long, unsigned long));static unsigned char *    read_and_display_attr       PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long));static unsigned char *    display_block               PARAMS ((unsigned char *, unsigned long));static void               decode_location_expression  PARAMS ((unsigned char *, unsigned int));static void		  request_dump                PARAMS ((unsigned int, char));static const char *       get_elf_class               PARAMS ((unsigned char));static const char *       get_data_encoding           PARAMS ((unsigned char));static const char *       get_osabi_name              PARAMS ((unsigned char));static int		  guess_is_rela               PARAMS ((unsigned long));static char * 		  get_note_type		         PARAMS ((unsigned int));static int		  process_note		         PARAMS ((Elf32_Internal_Note *));static int		  process_corefile_note_segment  PARAMS ((FILE *, bfd_vma, bfd_vma));static int		  process_corefile_note_segments PARAMS ((FILE *));static int 		  process_corefile_contents	 PARAMS ((FILE *));typedef int Elf32_Word;#ifndef TRUE#define TRUE     1#define FALSE    0#endif#define UNKNOWN -1#define SECTION_NAME(X) 	(string_table + (X)->sh_name)#define DT_VERSIONTAGIDX(tag)	(DT_VERNEEDNUM - (tag))	/* Reverse order! */#define BYTE_GET(field) 	byte_get (field, sizeof (field))/* If we can support a 64 bit data type then BFD64 should be defined   and sizeof (bfd_vma) == 8.  In this case when translating from an   external 8 byte field to an internal field, we can assume that the   internal field is also 8 bytes wide and so we can extact all the data.   If, however, BFD64 is not defined, then we must assume that the   internal data structure only has 4 byte wide fields that are the   equivalent of the 8 byte wide external counterparts, and so we must   truncate the data.  */#ifdef  BFD64#define BYTE_GET8(field) 	byte_get (field, -8)#else#define BYTE_GET8(field) 	byte_get (field, 8)#endif#define NUM_ELEM(array) 	(sizeof (array) / sizeof ((array)[0]))#define GET_DATA_ALLOC(offset, size, var, type, reason)			\  if (fseek (file, offset, SEEK_SET))					\    {									\      error (_("Unable to seek to start of %s at %x\n"), reason, offset); \      return 0;								\    }									\									\  var = (type) malloc (size);						\									\  if (var == NULL)							\    {									\      error (_("Out of memory allocating %d bytes for %s\n"), size, reason); \      return 0;								\    } 									\ 									\  if (fread (var, size, 1, file) != 1) 					\    { 									\      error (_("Unable to read in %d bytes of %s\n"), size, reason); 	\      free (var); 							\      var = NULL;							\      return 0; 							\    }#define GET_DATA(offset, var, reason) 					\  if (fseek (file, offset, SEEK_SET))					\    { 									\      error (_("Unable to seek to %x for %s\n"), offset, reason);	\      return 0;								\    }									\  else if (fread (& var, sizeof (var), 1, file) != 1)			\    {									\      error (_("Unable to read data at %x for %s\n"), offset, reason);	\      return 0;								\    }#define GET_ELF_SYMBOLS(file, offset, size)			\  (is_32bit_elf ? get_32bit_elf_symbols (file, offset, size)	\   : get_64bit_elf_symbols (file, offset, size))#ifdef ANSI_PROTOTYPESstatic voiderror (const char * message, ...){  va_list args;  fprintf (stderr, _("%s: Error: "), program_name);  va_start (args, message);  vfprintf (stderr, message, args);  va_end (args);  return;}static voidwarn (const char * message, ...){  va_list args;  fprintf (stderr, _("%s: Warning: "), program_name);  va_start (args, message);  vfprintf (stderr, message, args);  va_end (args);  return;}#elsestatic voiderror (va_alist)     va_dcl{  char * message;  va_list args;  fprintf (stderr, _("%s: Error: "), program_name);  va_start (args);  message = va_arg (args, char *);  vfprintf (stderr, message, args);  va_end (args);  return;}static voidwarn (va_alist)     va_dcl{  char * message;  va_list args;  fprintf (stderr, _("%s: Warning: "), program_name);  va_start (args);  message = va_arg (args, char *);  vfprintf (stderr, message, args);  va_end (args);  return;}#endifstatic bfd_vmabyte_get_little_endian (field, size)     unsigned char * field;     int             size;{  switch (size)    {    case 1:      return * field;    case 2:      return  ((unsigned int) (field [0]))	|    (((unsigned int) (field [1])) << 8);    case 8:      /* We want to extract data from an 8 byte wide field and	 place it into a 4 byte wide field.  Since this is a little	 endian source we can juts use the 4 byte extraction code.  */      /* Fall through.  */    case 4:      return  ((unsigned long) (field [0]))	|    (((unsigned long) (field [1])) << 8)	|    (((unsigned long) (field [2])) << 16)	|    (((unsigned long) (field [3])) << 24);#ifdef BFD64    case -8:      /* This is a special case, generated by the BYTE_GET8 macro.	 It means that we are loading an 8 byte value from a field	 in an external structure into an 8 byte value in a field	 in an internal strcuture.  */      return  ((bfd_vma) (field [0]))	|    (((bfd_vma) (field [1])) << 8)	|    (((bfd_vma) (field [2])) << 16)	|    (((bfd_vma) (field [3])) << 24)	|    (((bfd_vma) (field [4])) << 32)	|    (((bfd_vma) (field [5])) << 40)	|    (((bfd_vma) (field [6])) << 48)	|    (((bfd_vma) (field [7])) << 56);#endif    default:      error (_("Unhandled data length: %d\n"), size);      abort ();    }}/* Print a VMA value.  */static voidprint_vma (vma, mode)     bfd_vma vma;     print_mode mode;{#ifdef BFD64  if (is_32bit_elf)#endif    {      switch (mode)	{	case FULL_HEX: printf ("0x"); /* drop through */	case LONG_HEX: printf ("%8.8lx", (unsigned long) vma); break;	case PREFIX_HEX: printf ("0x"); /* drop through */	case HEX: printf ("%lx", (unsigned long) vma); break;	case DEC: printf ("%ld", (unsigned long) vma); break;	case DEC_5: printf ("%5ld", (long) vma); break;	case UNSIGNED: printf ("%lu", (unsigned long) vma); break;	}    }#ifdef BFD64  else    {      switch (mode)	{	case FULL_HEX:	  printf ("0x");	  /* drop through */	  	case LONG_HEX:	  printf_vma (vma);	  break;	  	case PREFIX_HEX:	  printf ("0x");	  /* drop through */	  	case HEX:#if BFD_HOST_64BIT_LONG	  printf ("%lx", vma);#else	  if (_bfd_int64_high (vma))	    printf ("%lx%lx", _bfd_int64_high (vma), _bfd_int64_low (vma));	  else	    printf ("%lx", _bfd_int64_low (vma));#endif	  break;	case DEC:#if BFD_HOST_64BIT_LONG	  printf ("%ld", vma);#else	  if (_bfd_int64_high (vma))	    /* ugg */	    printf ("++%ld", _bfd_int64_low (vma));	  else	    printf ("%ld", _bfd_int64_low (vma));#endif	  	  break;	case DEC_5:#if BFD_HOST_64BIT_LONG	  printf ("%5ld", vma);#else	  if (_bfd_int64_high (vma))	    /* ugg */	    printf ("++%ld", _bfd_int64_low (vma));	  else	    printf ("%5ld", _bfd_int64_low (vma));#endif	  	  break;	  	case UNSIGNED:#if BFD_HOST_64BIT_LONG	  printf ("%lu", vma);#else	  	  if (_bfd_int64_high (vma))	    /* ugg */	    printf ("++%lu", _bfd_int64_low (vma));	  else	    printf ("%lu", _bfd_int64_low (vma));#endif	  break;	}    }#endif}static bfd_vmabyte_get_big_endian (field, size)     unsigned char * field;     int             size;{  switch (size)    {    case 1:      return * field;    case 2:      return ((unsigned int) (field [1])) | (((int) (field [0])) << 8);    case 4:      return ((unsigned long) (field [3]))	|   (((unsigned long) (field [2])) << 8)	|   (((unsigned long) (field [1])) << 16)	|   (((unsigned long) (field [0])) << 24);    case 8:      /* Although we are extracing data from an 8 byte wide field, we	 are returning only 4 bytes of data.  */      return ((unsigned long) (field [7]))	|   (((unsigned long) (field [6])) << 8)	|   (((unsigned long) (field [5])) << 16)	|   (((unsigned long) (field [4])) << 24);#ifdef BFD64    case -8:      /* This is a special case, generated by the BYTE_GET8 macro.	 It means that we are loading an 8 byte value from a field	 in an external structure into an 8 byte value in a field	 in an internal strcuture.  */      return ((bfd_vma) (field [7]))	|   (((bfd_vma) (field [6])) << 8)	|   (((bfd_vma) (field [5])) << 16)	|   (((bfd_vma) (field [4])) << 24)	|   (((bfd_vma) (field [3])) << 32)	|   (((bfd_vma) (field [2])) << 40)	|   (((bfd_vma) (field [1])) << 48)	|   (((bfd_vma) (field [0])) << 56);#endif    default:      error (_("Unhandled data length: %d\n"), size);      abort ();    }}/* Guess the relocation sized based on the sized commonly used by the specific machine.  */static intguess_is_rela (e_machine)     unsigned long e_machine;{  switch (e_machine)    {      /* Targets that use REL relocations.  */    case EM_ARM:    case EM_386:    case EM_486:    case EM_960:    case EM_CYGNUS_M32R:    case EM_CYGNUS_D10V:    case EM_MIPS:    case EM_MIPS_RS4_BE:      return FALSE;      /* Targets that use RELA relocations.  */    case EM_68K:    case EM_SPARC32PLUS:    case EM_SPARCV9:    case EM_SPARC:    case EM_PPC:    case EM_CYGNUS_V850:    case EM_CYGNUS_D30V:    case EM_CYGNUS_MN10200:    case EM_CYGNUS_MN10300:    case EM_CYGNUS_FR30:    case EM_SH:    case EM_ALPHA:    case EM_MCORE:      return TRUE;    case EM_MMA:    case EM_PCP:    case EM_NCPU:    case EM_NDR1:    case EM_STARCORE:    case EM_ME16:    case EM_ST100:    case EM_TINYJ:    case EM_FX66:    case EM_ST9PLUS:    case EM_ST7:    case EM_68HC16:    case EM_68HC11:    case EM_68HC08:    case EM_68HC05:    case EM_SVX:    case EM_ST19:    case EM_VAX:    default:      warn (_("Don't know about relocations on this machine architecture\n"));      return FALSE;    }}/* Display the contents of the relocation data found at the specified offset.  */static intdump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)     FILE *             file;     unsigned long      rel_offset;     unsigned long      rel_size;     Elf_Internal_Sym * symtab;     unsigned long      nsyms;     char *             strtab;     int                is_rela;{  unsigned int        i;  Elf_Internal_Rel *  rels;  Elf_Internal_Rela * relas;  if (is_rela == UNKNOWN)    is_rela = guess_is_rela (elf_header.e_machine);  if (is_rela)    {      if (is_32bit_elf)	{	  Elf32_External_Rela * erelas;	  GET_DATA_ALLOC (rel_offset, rel_size, erelas,			  Elf32_External_Rela *, "relocs");	  rel_size = rel_size / sizeof (Elf32_External_Rela);	  relas = (Elf_Internal_Rela *)	    malloc (rel_size * sizeof (Elf_Internal_Rela));	  if (relas == NULL)	    {	      error(_("out of memory parsing relocs"));	      return 0;	    }	  for (i = 0; i < rel_size; i++)	    {	      relas[i].r_offset = BYTE_GET (erelas[i].r_offset);	      relas[i].r_info   = BYTE_GET (erelas[i].r_info);	      relas[i].r_addend = BYTE_GET (erelas[i].r_addend);	    }	  free (erelas);	  rels = (Elf_Internal_Rel *) relas;	}      else	{	  Elf64_External_Rela * erelas;	  GET_DATA_ALLOC (rel_offset, rel_size, erelas,			  Elf64_External_Rela *, "relocs");	  rel_size = rel_size / sizeof (Elf64_External_Rela);	  relas = (Elf_Internal_Rela *)	    malloc (rel_size * sizeof (Elf_Internal_Rela));	  if (relas == NULL)	    {	      error(_("out of memory parsing relocs"));	      return 0;	    }	  for (i = 0; i < rel_size; i++)	    {	      relas[i].r_offset = BYTE_GET8 (erelas[i].r_offset);	      relas[i].r_info   = BYTE_GET8 (erelas[i].r_info);	      relas[i].r_addend = BYTE_GET8 (erelas[i].r_addend);	    }	  free (erelas);	  rels = (Elf_Internal_Rel *) relas;	}    }  else    {      if (is_32bit_elf)	{	  Elf32_External_Rel * erels;	  GET_DATA_ALLOC (rel_offset, rel_size, erels,			  Elf32_External_Rel *, "relocs");	  rel_size = rel_size / sizeof (Elf32_External_Rel);	  rels = (Elf_Internal_Rel *)	    malloc (rel_size * sizeof (Elf_Internal_Rel));	  if (rels == NULL)	    {	      error(_("out of memory parsing relocs"));	      return 0;	    }	  for (i = 0; i < rel_size; i++)	    {	      rels[i].r_offset = BYTE_GET (erels[i].r_offset);	      rels[i].r_info   = BYTE_GET (erels[i].r_info);	    }	  free (erels);	  relas = (Elf_Internal_Rela *) rels;	}      else	{	  Elf64_External_Rel * erels;	  GET_DATA_ALLOC (rel_offset, rel_size, erels,			  Elf64_External_Rel *, "relocs");	  rel_size = rel_size / sizeof (Elf64_External_Rel);	  rels = (Elf_Internal_Rel *)	    malloc (rel_size * sizeof (Elf_Internal_Rel));	  if (rels == NULL)	    {	      error(_("out of memory parsing relocs"));	      return 0;	    }	  for (i = 0; i < rel_size; i++)	    {	      rels[i].r_offset = BYTE_GET8 (erels[i].r_offset);	      rels[i].r_info   = BYTE_GET8 (erels[i].r_info);	    }	  free (erels);	  relas = (Elf_Internal_Rela *) rels;	}    }  if (is_rela)    printf      (_("  Offset    Info  Type            Symbol's Value  Symbol's Name          Addend\n"));  else    printf      (_("  Offset    Info  Type            Symbol's Value  Symbol's Name\n"));  for (i = 0; i < rel_size; i++)    {      const char * rtype;      bfd_vma      offset;      bfd_vma      info;      bfd_vma      symtab_index;      bfd_vma      type;      if (is_rela)	{	  offset = relas [i].r_offset;	  info   = relas [i].r_info;	}      else	{	  offset = rels [i].r_offset;	  info   = rels [i].r_info;	}      if (is_32bit_elf)	{	  type         = ELF32_R_TYPE (info);	  symtab_index = ELF32_R_SYM  (info);	}      else	{	  if (elf_header.e_machine == EM_SPARCV9)	    type       = ELF64_R_TYPE_ID (info);	  else	    type       = ELF64_R_TYPE (info);	  /* The #ifdef BFD64 below is to prevent a compile time warning.	     We know that if we do not have a 64 bit data type that we	     will never execute this code anyway.  */#ifdef BFD64	  symtab_index = ELF64_R_SYM  (info);#endif	}#ifdef _bfd_int64_low      printf ("  %8.8lx  %5.5lx ", _bfd_int64_low (offset), _bfd_int64_low (info));#else      printf ("  %8.8lx  %5.5lx ", offset, info);#endif      switch (elf_header.e_machine)	{	default:	  rtype = NULL;	  break;	case EM_CYGNUS_M32R:	  rtype = elf_m32r_reloc_type (type);	  break;	case EM_386:	case EM_486:	  rtype = elf_i386_reloc_type (type);	  break;	case EM_68K:	  rtype = elf_m68k_reloc_type (type);	  break;	case EM_960:	  rtype = elf_i960_reloc_type (type);	  break;	case EM_AVR:	  rtype = elf_avr_reloc_type (type);	  break;	case EM_OLD_SPARCV9:	case EM_SPARC32PLUS:	case EM_SPARCV9:	case EM_SPARC:	  rtype = elf_sparc_reloc_type (type);	  break;	case EM_CYGNUS_V850:	  rtype = v850_reloc_type (type);	  break;	case EM_CYGNUS_D10V:	  rtype = elf_d10v_reloc_type (type);	  break;	case EM_CYGNUS_D30V:	  rtype = elf_d30v_reloc_type (type);	  break;	case EM_SH:	  rtype = elf_sh_reloc_type (type);	  break;	case EM_CYGNUS_MN10300:	  rtype = elf_mn10300_reloc_type (type);	  break;	case EM_CYGNUS_MN10200:	  rtype = elf_mn10200_reloc_type (type);	  break;	case EM_CYGNUS_FR30:	  rtype = elf_fr30_reloc_type (type);	  break;	case EM_MCORE:	  rtype = elf_mcore_reloc_type (type);	  break;	case EM_PPC:	  rtype = elf_ppc_reloc_type (type);	  break;	case EM_MIPS:	case EM_MIPS_RS4_BE:	  rtype = elf_mips_reloc_type (type);	  break;	case EM_ALPHA:	  rtype = elf_alpha_reloc_type (type);	  break;	case EM_ARM:	  rtype = elf_arm_reloc_type (type);	  break;	case EM_CYGNUS_ARC:	  rtype = elf_arc_reloc_type (type);	  break;	case EM_PARISC:	  rtype = elf_hppa_reloc_type (type);	  break;	case EM_PJ:	  rtype = elf_pj_reloc_type (type);	  break;	}      if (rtype == NULL)#ifdef _bfd_int64_low	printf (_("unrecognised: %-7lx"), _bfd_int64_low (type));#else	printf (_("unrecognised: %-7lx"), type);#endif      else	printf ("%-21.21s", rtype);      if (symtab_index)	{	  if (symtab != NULL)	    {	      if (symtab_index >= nsyms)		printf (" bad symbol index: %08lx", (unsigned long) symtab_index);	      else		{		  Elf_Internal_Sym * psym;		  psym = symtab + symtab_index;		  printf (" ");		  print_vma (psym->st_value, LONG_HEX);		  printf ("  ");		  if (psym->st_name == 0)		    printf ("%-25.25s",			    SECTION_NAME (section_headers + psym->st_shndx));		  else if (strtab == NULL)		    printf (_("<string table index %3ld>"), psym->st_name);		  else		    printf ("%-25.25s", strtab + psym->st_name);		  if (is_rela)		    printf (" + %lx", (unsigned long) relas [i].r_addend);		}	    }	}      else if (is_rela)	{	  printf ("%*c", is_32bit_elf ? 34 : 26, ' ');	  print_vma (relas[i].r_addend, LONG_HEX);	}      if (elf_header.e_machine == EM_SPARCV9	  && !strcmp (rtype, "R_SPARC_OLO10"))	printf (" + %lx", (unsigned long) ELF64_R_TYPE_DATA (info));      putchar ('\n');    }  free (relas);  return 1;}static const char *get_mips_dynamic_type (type)     unsigned long type;{  switch (type)    {    case DT_MIPS_RLD_VERSION: return "MIPS_RLD_VERSION";    case DT_MIPS_TIME_STAMP: return "MIPS_TIME_STAMP";    case DT_MIPS_ICHECKSUM: return "MIPS_ICHECKSUM";    case DT_MIPS_IVERSION: return "MIPS_IVERSION";    case DT_MIPS_FLAGS: return "MIPS_FLAGS";    case DT_MIPS_BASE_ADDRESS: return "MIPS_BASE_ADDRESS";    case DT_MIPS_MSYM: return "MIPS_MSYM";    case DT_MIPS_CONFLICT: return "MIPS_CONFLICT";    case DT_MIPS_LIBLIST: return "MIPS_LIBLIST";    case DT_MIPS_LOCAL_GOTNO: return "MIPS_LOCAL_GOTNO";    case DT_MIPS_CONFLICTNO: return "MIPS_CONFLICTNO";    case DT_MIPS_LIBLISTNO: return "MIPS_LIBLISTNO";    case DT_MIPS_SYMTABNO: return "MIPS_SYMTABNO";    case DT_MIPS_UNREFEXTNO: return "MIPS_UNREFEXTNO";    case DT_MIPS_GOTSYM: return "MIPS_GOTSYM";    case DT_MIPS_HIPAGENO: return "MIPS_HIPAGENO";    case DT_MIPS_RLD_MAP: return "MIPS_RLD_MAP";    case DT_MIPS_DELTA_CLASS: return "MIPS_DELTA_CLASS";    case DT_MIPS_DELTA_CLASS_NO: return "MIPS_DELTA_CLASS_NO";    case DT_MIPS_DELTA_INSTANCE: return "MIPS_DELTA_INSTANCE";    case DT_MIPS_DELTA_INSTANCE_NO: return "MIPS_DELTA_INSTANCE_NO";    case DT_MIPS_DELTA_RELOC: return "MIPS_DELTA_RELOC";    case DT_MIPS_DELTA_RELOC_NO: return "MIPS_DELTA_RELOC_NO";    case DT_MIPS_DELTA_SYM: return "MIPS_DELTA_SYM";    case DT_MIPS_DELTA_SYM_NO: return "MIPS_DELTA_SYM_NO";    case DT_MIPS_DELTA_CLASSSYM: return "MIPS_DELTA_CLASSSYM";    case DT_MIPS_DELTA_CLASSSYM_NO: return "MIPS_DELTA_CLASSSYM_NO";    case DT_MIPS_CXX_FLAGS: return "MIPS_CXX_FLAGS";    case DT_MIPS_PIXIE_INIT: return "MIPS_PIXIE_INIT";    case DT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB";    case DT_MIPS_LOCALPAGE_GOTIDX: return "MIPS_LOCALPAGE_GOTIDX";    case DT_MIPS_LOCAL_GOTIDX: return "MIPS_LOCAL_GOTIDX";    case DT_MIPS_HIDDEN_GOTIDX: return "MIPS_HIDDEN_GOTIDX";    case DT_MIPS_PROTECTED_GOTIDX: return "MIPS_PROTECTED_GOTIDX";    case DT_MIPS_OPTIONS: return "MIPS_OPTIONS";    case DT_MIPS_INTERFACE: return "MIPS_INTERFACE";    case DT_MIPS_DYNSTR_ALIGN: return "MIPS_DYNSTR_ALIGN";    case DT_MIPS_INTERFACE_SIZE: return "MIPS_INTERFACE_SIZE";    case DT_MIPS_RLD_TEXT_RESOLVE_ADDR: return "MIPS_RLD_TEXT_RESOLVE_ADDR";    case DT_MIPS_PERF_SUFFIX: return "MIPS_PERF_SUFFIX";    case DT_MIPS_COMPACT_SIZE: return "MIPS_COMPACT_SIZE";    case DT_MIPS_GP_VALUE: return "MIPS_GP_VALUE";    case DT_MIPS_AUX_DYNAMIC: return "MIPS_AUX_DYNAMIC";    default:      return NULL;    }}static const char *get_sparc64_dynamic_type (type)     unsigned long type;{  switch (type)    {    case DT_SPARC_REGISTER: return "SPARC_REGISTER";    default:      return NULL;    }}static const char *get_parisc_dynamic_type (type)     unsigned long type;{  switch (type)    {    case DT_HP_LOAD_MAP:	return "HP_LOAD_MAP";    case DT_HP_DLD_FLAGS:	return "HP_DLD_FLAGS";    case DT_HP_DLD_HOOK:	return "HP_DLD_HOOK";    case DT_HP_UX10_INIT:	return "HP_UX10_INIT";    case DT_HP_UX10_INITSZ:	return "HP_UX10_INITSZ";    case DT_HP_PREINIT:		return "HP_PREINIT";    case DT_HP_PREINITSZ:	return "HP_PREINITSZ";    case DT_HP_NEEDED:		return "HP_NEEDED";    case DT_HP_TIME_STAMP:	return "HP_TIME_STAMP";    case DT_HP_CHECKSUM:	return "HP_CHECKSUM";    case DT_HP_GST_SIZE:	return "HP_GST_SIZE";    case DT_HP_GST_VERSION:	return "HP_GST_VERSION";    case DT_HP_GST_HASHVAL:	return "HP_GST_HASHVAL";    default:      return NULL;    }}static const char *get_dynamic_type (type)     unsigned long type;{  static char buff [32];  switch (type)    {    case DT_NULL:	return "NULL";    case DT_NEEDED:	return "NEEDED";    case DT_PLTRELSZ:	return "PLTRELSZ";    case DT_PLTGOT:	return "PLTGOT";    case DT_HASH:	return "HASH";    case DT_STRTAB:	return "STRTAB";    case DT_SYMTAB:	return "SYMTAB";    case DT_RELA:	return "RELA";    case DT_RELASZ:	return "RELASZ";    case DT_RELAENT:	return "RELAENT";    case DT_STRSZ:	return "STRSZ";    case DT_SYMENT:	return "SYMENT";    case DT_INIT:	return "INIT";    case DT_FINI:	return "FINI";    case DT_SONAME:	return "SONAME";    case DT_RPATH:	return "RPATH";    case DT_SYMBOLIC:	return "SYMBOLIC";    case DT_REL:	return "REL";    case DT_RELSZ:	return "RELSZ";    case DT_RELENT:	return "RELENT";    case DT_PLTREL:	return "PLTREL";    case DT_DEBUG:	return "DEBUG";    case DT_TEXTREL:	return "TEXTREL";    case DT_JMPREL:	return "JMPREL";    case DT_BIND_NOW:   return "BIND_NOW";    case DT_INIT_ARRAY: return "INIT_ARRAY";    case DT_FINI_ARRAY: return "FINI_ARRAY";    case DT_INIT_ARRAYSZ: return "INIT_ARRAYSZ";    case DT_FINI_ARRAYSZ: return "FINI_ARRAYSZ";    case DT_RUNPATH:    return "RUNPATH";    case DT_FLAGS:      return "FLAGS";    case DT_PREINIT_ARRAY: return "PREINIT_ARRAY";    case DT_PREINIT_ARRAYSZ: return "PREINIT_ARRAYSZ";    case DT_PLTPADSZ:	return "PLTPADSZ";    case DT_MOVEENT:	return "MOVEENT";    case DT_MOVESZ:	return "MOVESZ";    case DT_FEATURE_1:	return "FEATURE_1";    case DT_POSFLAG_1:	return "POSFLAG_1";    case DT_SYMINSZ:	return "SYMINSZ";    case DT_SYMINENT:	return "SYMINENT"; /* aka VALRNGHI */    case DT_ADDRRNGLO:  return "ADDRRNGLO";    case DT_SYMINFO:	return "SYMINFO"; /* aka ADDRRNGHI */    case DT_VERSYM:	return "VERSYM";    case DT_RELACOUNT:	return "RELACOUNT";    case DT_RELCOUNT:	return "RELCOUNT";    case DT_FLAGS_1:	return "FLAGS_1";    case DT_VERDEF:	return "VERDEF";    case DT_VERDEFNUM:	return "VERDEFNUM";    case DT_VERNEED:	return "VERNEED";    case DT_VERNEEDNUM:	return "VERNEEDNUM";    case DT_AUXILIARY:	return "AUXILARY";    case DT_USED:	return "USED";    case DT_FILTER:	return "FILTER";    default:      if ((type >= DT_LOPROC) && (type <= DT_HIPROC))	{	  const char * result;	  switch (elf_header.e_machine)	    {	    case EM_MIPS:	    case EM_MIPS_RS4_BE:	      result = get_mips_dynamic_type (type);	      break;	    case EM_SPARCV9:	      result = get_sparc64_dynamic_type (type);	      break;	    default:	      result = NULL;	      break;	    }	  if (result != NULL)	    return result;	  sprintf (buff, _("Processor Specific: %lx"), type);	}      else if ((type >= DT_LOOS) && (type <= DT_HIOS))	{	  const char * result;	  switch (elf_header.e_machine)	    {	    case EM_PARISC:	      result = get_parisc_dynamic_type (type);	      break;	    default:	      result = NULL;	      break;	    }	  if (result != NULL)	    return result;	  sprintf (buff, _("Operating System specific: %lx"), type);	}      else	sprintf (buff, _("<unknown>: %lx"), type);      return buff;    }}static char *get_file_type (e_type)     unsigned e_type;{  static char buff [32];  switch (e_type)    {    case ET_NONE:	return _("NONE (None)");    case ET_REL:	return _("REL (Relocatable file)");    case ET_EXEC:       return _("EXEC (Executable file)");    case ET_DYN:        return _("DYN (Shared object file)");    case ET_CORE:       return _("CORE (Core file)");    default:      if ((e_type >= ET_LOPROC) && (e_type <= ET_HIPROC))	sprintf (buff, _("Processor Specific: (%x)"), e_type);      else if ((e_type >= ET_LOOS) && (e_type <= ET_HIOS))	sprintf (buff, _("OS Specific: (%x)"), e_type);      else	sprintf (buff, _("<unknown>: %x"), e_type);      return buff;    }}static char *get_machine_name (e_machine)     unsigned e_machine;{  static char buff [64]; /* XXX */  switch (e_machine)    {    case EM_NONE:        	return _("None");    case EM_M32:         	return "WE32100";    case EM_SPARC:       	return "Sparc";    case EM_386:         	return "Intel 80386";    case EM_68K:         	return "MC68000";    case EM_88K:         	return "MC88000";    case EM_486:         	return "Intel 80486";    case EM_860:         	return "Intel 80860";    case EM_MIPS:        	return "MIPS R3000";    case EM_S370:        	return "IBM System/370";    case EM_MIPS_RS4_BE: 	return "MIPS R4000 big-endian";    case EM_OLD_SPARCV9:	return "Sparc v9 (old)";    case EM_PARISC:      	return "HPPA";    case EM_PPC_OLD:		return "Power PC (old)";    case EM_SPARC32PLUS: 	return "Sparc v8+" ;    case EM_960:         	return "Intel 90860";    case EM_PPC:         	return "PowerPC";    case EM_V800:         	return "NEC V800";    case EM_FR20:         	return "Fujitsu FR20";    case EM_RH32:         	return "TRW RH32";    case EM_MCORE:	        return "MCORE";    case EM_ARM:	 	return "ARM";    case EM_OLD_ALPHA:	 	return "Digital Alpha (old)";    case EM_SH:		 	return "Hitachi SH";    case EM_SPARCV9:     	return "Sparc v9";    case EM_TRICORE:    	return "Siemens Tricore";    case EM_ARC:		return "Argonaut RISC Core";    case EM_H8_300:		return "Hitachi H8/300";    case EM_H8_300H:		return "Hitachi H8/300H";    case EM_H8S:		return "Hitachi H8S";    case EM_H8_500:		return "Hitachi H8/500";    case EM_IA_64:		return "Intel IA-64";    case EM_MIPS_X:		return "Stanford MIPS-X";    case EM_COLDFIRE:		return "Motorola Coldfire";    case EM_68HC12:		return "Motorola M68HC12";    case EM_ALPHA:       	return "Alpha";    case EM_CYGNUS_D10V:        return "d10v";    case EM_CYGNUS_D30V:        return "d30v";    case EM_CYGNUS_ARC:		return "Arc";    case EM_CYGNUS_M32R:	return "Mitsubishi M32r";    case EM_CYGNUS_V850:	return "NEC v850";    case EM_CYGNUS_MN10300:	return "mn10300";    case EM_CYGNUS_MN10200:	return "mn10200";    case EM_CYGNUS_FR30:	return "Fujitsu FR30";    case EM_PJ:                 return "picoJava";    case EM_MMA:      		return "Fujitsu Multimedia Accelerator";    case EM_PCP:      		return "Siemens PCP";    case EM_NCPU:     		return "Sony nCPU embedded RISC processor";    case EM_NDR1:     		return "Denso NDR1 microprocesspr";    case EM_STARCORE: 		return "Motorola Star*Core processor";    case EM_ME16:     		return "Toyota ME16 processor";    case EM_ST100:    		return "STMicroelectronics ST100 processor";    case EM_TINYJ:    		return "Advanced Logic Corp. TinyJ embedded processor";    case EM_FX66:     		return "Siemens FX66 microcontroller";    case EM_ST9PLUS:  		return "STMicroelectronics ST9+ 8/16 bit microcontroller";    case EM_ST7:      		return "STMicroelectronics ST7 8-bit microcontroller";    case EM_68HC16:   		return "Motorola MC68HC16 Microcontroller";    case EM_68HC11:   		return "Motorola MC68HC11 Microcontroller";    case EM_68HC08:   		return "Motorola MC68HC08 Microcontroller";    case EM_68HC05:   		return "Motorola MC68HC05 Microcontroller";    case EM_SVX:      		return "Silicon Graphics SVx";    case EM_ST19:     		return "STMicroelectronics ST19 8-bit microcontroller";    case EM_VAX:      		return "Digital VAX";    default:      sprintf (buff, _("<unknown>: %x"), e_machine);      return buff;    }}static char *get_machine_flags (e_flags, e_machine)     unsigned e_flags;     unsigned e_machine;{  static char buf [1024];  buf[0] = '\0';    if (e_flags)    {      switch (e_machine)	{	default:	  break;        case EM_68K:          if (e_flags & EF_CPU32)            strcat (buf, ", cpu32");          break;	case EM_PPC:	  if (e_flags & EF_PPC_EMB)	    strcat (buf, ", emb");	  if (e_flags & EF_PPC_RELOCATABLE)	    strcat (buf, ", relocatable");	  if (e_flags & EF_PPC_RELOCATABLE_LIB)	    strcat (buf, ", relocatable-lib");	  break;	case EM_CYGNUS_V850:	  switch (e_flags & EF_V850_ARCH)	    {	    case E_V850E_ARCH:	      strcat (buf, ", v850e");	      break;	    case E_V850EA_ARCH:	      strcat (buf, ", v850ea");	      break;	    case E_V850_ARCH:	      strcat (buf, ", v850");	      break;	    default:	      strcat (buf, ", unknown v850 architecture variant");	      break;	    }	  break;	case EM_CYGNUS_M32R:	  if ((e_flags & EF_M32R_ARCH) == E_M32R_ARCH)	    strcat (buf, ", m32r");	  break;	case EM_MIPS:	case EM_MIPS_RS4_BE:	  if (e_flags & EF_MIPS_NOREORDER)	    strcat (buf, ", noreorder");	  if (e_flags & EF_MIPS_PIC)	    strcat (buf, ", pic");	  if (e_flags & EF_MIPS_CPIC)	    strcat (buf, ", cpic");	  if (e_flags & EF_MIPS_ABI2)	    strcat (buf, ", abi2");	  if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1)	    strcat (buf, ", mips1");	  if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2)	    strcat (buf, ", mips2");	  if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3)	    strcat (buf, ", mips3");	  if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)	    strcat (buf, ", mips4");	  break;	case EM_SPARCV9:	  if (e_flags & EF_SPARC_32PLUS)	    strcat (buf, ", v8+");	  if (e_flags & EF_SPARC_SUN_US1)	    strcat (buf, ", ultrasparcI");	  if (e_flags & EF_SPARC_SUN_US3)	    strcat (buf, ", ultrasparcIII");	  if (e_flags & EF_SPARC_HAL_R1)	    strcat (buf, ", halr1");	  if (e_flags & EF_SPARC_LEDATA)	    strcat (buf, ", ledata");	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_TSO)	    strcat (buf, ", tso");	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_PSO)	    strcat (buf, ", pso");	  if ((e_flags & EF_SPARCV9_MM) == EF_SPARCV9_RMO)	    strcat (buf, ", rmo");	  break;	case EM_PARISC:	  switch (e_flags & EF_PARISC_ARCH)	    {	    case EFA_PARISC_1_0:	      strcpy (buf, ", PA-RISC 1.0");	      break;	    case EFA_PARISC_1_1:	      strcpy (buf, ", PA-RISC 1.1");	      break;	    case EFA_PARISC_2_0:	      strcpy (buf, ", PA-RISC 2.0");	      break;	    default:	      break;	    }	  if (e_flags & EF_PARISC_TRAPNIL)	    strcat (buf, ", trapnil");	  if (e_flags & EF_PARISC_EXT)	    strcat (buf, ", ext");	  if (e_flags & EF_PARISC_LSB)	    strcat (buf, ", lsb");	  if (e_flags & EF_PARISC_WIDE)	    strcat (buf, ", wide");	  if (e_flags & EF_PARISC_NO_KABP)	    strcat (buf, ", no kabp");	  if (e_flags & EF_PARISC_LAZYSWAP)	    strcat (buf, ", lazyswap");	  break;	  	case EM_PJ:	  if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS)	    strcat (buf, ", new calling convention");	  if ((e_flags & EF_PICOJAVA_GNUCALLS) == EF_PICOJAVA_GNUCALLS)	    strcat (buf, ", gnu calling convention");	  break;	}    }  return buf;}static const char *get_mips_segment_type (type)     unsigned long type;{  switch (type)    {    case PT_MIPS_REGINFO:      return "REGINFO";    case PT_MIPS_RTPROC:      return "RTPROC";    case PT_MIPS_OPTIONS:      return "OPTIONS";    default:      break;    }  return NULL;}static const char *get_parisc_segment_type (type)     unsigned long type;{  switch (type)    {    case PT_HP_TLS:		return "HP_TLS";    case PT_HP_CORE_NONE:	return "HP_CORE_NONE";    case PT_HP_CORE_VERSION:	return "HP_CORE_VERSION";    case PT_HP_CORE_KERNEL:	return "HP_CORE_KERNEL";    case PT_HP_CORE_COMM:	return "HP_CORE_COMM";    case PT_HP_CORE_PROC:	return "HP_CORE_PROC";    case PT_HP_CORE_LOADABLE:	return "HP_CORE_LOADABLE";    case PT_HP_CORE_STACK:	return "HP_CORE_STACK";    case PT_HP_CORE_SHM:	return "HP_CORE_SHM";    case PT_HP_CORE_MMF:	return "HP_CORE_MMF";    case PT_HP_PARALLEL:	return "HP_PARALLEL";    case PT_HP_FASTBIND:	return "HP_FASTBIND";    case PT_PARISC_ARCHEXT:	return "PARISC_ARCHEXT";    case PT_PARISC_UNWIND:	return "PARISC_UNWIND";    default:      break;    }  return NULL;}static const char *get_segment_type (p_type)     unsigned long p_type;{  static char buff [32];  switch (p_type)    {    case PT_NULL:       return "NULL";    case PT_LOAD:       return "LOAD";    case PT_DYNAMIC:	return "DYNAMIC";    case PT_INTERP:     return "INTERP";    case PT_NOTE:       return "NOTE";    case PT_SHLIB:      return "SHLIB";    case PT_PHDR:       return "PHDR";    default:      if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))	{	  const char * result;	  switch (elf_header.e_machine)	    {	    case EM_MIPS:	    case EM_MIPS_RS4_BE:	      result = get_mips_segment_type (p_type);	      break;	    case EM_PARISC:	      result = get_parisc_segment_type (p_type);	      break;	    default:	      result = NULL;	      break;	    }	  if (result != NULL)	    return result;	  sprintf (buff, "LOPROC+%lx", p_type - PT_LOPROC);	}      else if ((p_type >= PT_LOOS) && (p_type <= PT_HIOS))	{	  const char * result;	  switch (elf_header.e_machine)	    {	    case EM_PARISC:	      result = get_parisc_segment_type (p_type);	      break;	    default:	      result = NULL;	      break;	    }	  if (result != NULL)	    return result;	  sprintf (buff, "LOOS+%lx", p_type - PT_LOOS);	}      else	sprintf (buff, _("<unknown>: %lx"), p_type);      return buff;    }}