if (do_dynamic) { if (entry->d_tag == DT_AUXILIARY) printf (_("Auxiliary library")); else printf (_("Filter library"));
case DT_CONFIG: case DT_DEPAUDIT: case DT_AUDIT: if (do_dynamic) { switch (entry->d_tag) { case DT_AUXILIARY: printf (_("Auxiliary library")); break;  case DT_FILTER: printf (_("Filter library")); break;  case DT_CONFIG: printf (_("Configuration file")); break;  case DT_DEPAUDIT: printf (_("Dependency audit library")); break;  case DT_AUDIT: printf (_("Audit library")); break; }
process_dynamic_segment (file)     FILE * file;{  Elf_Internal_Dyn * entry;  bfd_size_type      i;  if (dynamic_size == 0)    {      if (do_dynamic)	printf (_("\nThere is no dynamic segment in this file.\n"));      return 1;    }  if (is_32bit_elf)    {      if (! get_32bit_dynamic_segment (file))	return 0;    }  else if (! get_64bit_dynamic_segment (file))    return 0;  /* Find the appropriate symbol table.  */  if (dynamic_symbols == NULL)    {      for (i = 0, entry = dynamic_segment;	   i < dynamic_size;	   ++i, ++ entry)	{	  unsigned long        offset;	  if (entry->d_tag != DT_SYMTAB)	    continue;	  dynamic_info[DT_SYMTAB] = entry->d_un.d_val;	  /* Since we do not know how big the symbol table is,	     we default to reading in the entire file (!) and	     processing that.  This is overkill, I know, but it	     should work. */	  offset = entry->d_un.d_val - loadaddr;	  if (fseek (file, 0, SEEK_END))	    error (_("Unable to seek to end of file!"));	  if (is_32bit_elf)	    num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf32_External_Sym);	  else	    num_dynamic_syms = (ftell (file) - offset) / sizeof (Elf64_External_Sym);	  if (num_dynamic_syms < 1)	    {	      error (_("Unable to determine the number of symbols to load\n"));	      continue;	    }	  dynamic_symbols = GET_ELF_SYMBOLS (file, offset, num_dynamic_syms);	}    }  /* Similarly find a string table.  */  if (dynamic_strings == NULL)    {      for (i = 0, entry = dynamic_segment;	   i < dynamic_size;	   ++i, ++ entry)	{	  unsigned long offset;	  long          str_tab_len;	  if (entry->d_tag != DT_STRTAB)	    continue;	  dynamic_info[DT_STRTAB] = entry->d_un.d_val;	  /* Since we do not know how big the string table is,	     we default to reading in the entire file (!) and	     processing that.  This is overkill, I know, but it	     should work. */	  offset = entry->d_un.d_val - loadaddr;	  if (fseek (file, 0, SEEK_END))	    error (_("Unable to seek to end of file\n"));	  str_tab_len = ftell (file) - offset;	  if (str_tab_len < 1)	    {	      error		(_("Unable to determine the length of the dynamic string table\n"));	      continue;	    }	  GET_DATA_ALLOC (offset, str_tab_len, dynamic_strings, char *,			  "dynamic string table");	  break;	}    }  /* And find the syminfo section if available.  */  if (dynamic_syminfo == NULL)    {      unsigned int syminsz = 0;      for (i = 0, entry = dynamic_segment;	   i < dynamic_size;	   ++i, ++ entry)	{	  if (entry->d_tag == DT_SYMINENT)	    {	      /* Note: these braces are necessary to avoid a syntax		 error from the SunOS4 C compiler.  */	      assert (sizeof (Elf_External_Syminfo) == entry->d_un.d_val);	    }	  else if (entry->d_tag == DT_SYMINSZ)	    syminsz = entry->d_un.d_val;	  else if (entry->d_tag == DT_SYMINFO)	    dynamic_syminfo_offset = entry->d_un.d_val - loadaddr;	}      if (dynamic_syminfo_offset != 0 && syminsz != 0)	{	  Elf_External_Syminfo * extsyminfo;	  Elf_Internal_Syminfo * syminfo;	  /* There is a syminfo section.  Read the data.  */	  GET_DATA_ALLOC (dynamic_syminfo_offset, syminsz, extsyminfo,			  Elf_External_Syminfo *, "symbol information");	  dynamic_syminfo = (Elf_Internal_Syminfo *) malloc (syminsz);	  if (dynamic_syminfo == NULL)	    {	      error (_("Out of memory\n"));	      return 0;	    }	  dynamic_syminfo_nent = syminsz / sizeof (Elf_External_Syminfo);	  for (i = 0, syminfo = dynamic_syminfo; i < dynamic_syminfo_nent;	       ++i, ++syminfo)	    {	      syminfo->si_boundto = BYTE_GET (extsyminfo[i].si_boundto);	      syminfo->si_flags = BYTE_GET (extsyminfo[i].si_flags);	    }	  free (extsyminfo);	}    }  if (do_dynamic && dynamic_addr)    printf (_("\nDynamic segment at offset 0x%x contains %ld entries:\n"),	    dynamic_addr, (long) dynamic_size);  if (do_dynamic)    printf (_("  Tag        Type                         Name/Value\n"));  for (i = 0, entry = dynamic_segment;       i < dynamic_size;       i++, entry ++)    {      if (do_dynamic)	{	  const char *dtype;	  putchar (' ');	  print_vma (entry->d_tag, FULL_HEX);	  dtype = get_dynamic_type (entry->d_tag);	  printf (" (%s)%*s", dtype,		  ((is_32bit_elf ? 27 : 19)		   - (int) strlen (dtype)),		  " ");	}      switch (entry->d_tag)	{	case DT_FLAGS:	  if (do_dynamic)	    printf ("%s", get_dynamic_flags (entry->d_un.d_val));	  break;	  	case DT_AUXILIARY:	case DT_FILTER:	  if (do_dynamic)	    {	      if (entry->d_tag == DT_AUXILIARY)		printf (_("Auxiliary library"));	      else		printf (_("Filter library"));	      if (dynamic_strings)		printf (": [%s]\n", dynamic_strings + entry->d_un.d_val);	      else		{		  printf (": ");		  print_vma (entry->d_un.d_val, PREFIX_HEX);		  putchar ('\n');		}	    }	  break;	case DT_FEATURE_1:	  if (do_dynamic)	    {	      printf (_("Flags:"));	      if (entry->d_un.d_val == 0)		printf (_(" None\n"));	      else		{		  unsigned long int val = entry->d_un.d_val;		  if (val & DTF_1_PARINIT)		    {		      printf (" PARINIT");		      val ^= DTF_1_PARINIT;		    }		  if (val != 0)		    printf (" %lx", val);		  puts ("");		}	    }	  break;	case DT_POSFLAG_1:	  if (do_dynamic)	    {	      printf (_("Flags:"));	      if (entry->d_un.d_val == 0)		printf (_(" None\n"));	      else		{		  unsigned long int val = entry->d_un.d_val;		  if (val & DF_P1_LAZYLOAD)		    {		      printf (" LAZYLOAD");		      val ^= DF_P1_LAZYLOAD;		    }		  if (val & DF_P1_GROUPPERM)		    {		      printf (" GROUPPERM");		      val ^= DF_P1_GROUPPERM;		    }		  if (val != 0)		    printf (" %lx", val);		  puts ("");		}	    }	  break;	case DT_FLAGS_1:	  if (do_dynamic)	    {	      printf (_("Flags:"));	      if (entry->d_un.d_val == 0)		printf (_(" None\n"));	      else		{		  unsigned long int val = entry->d_un.d_val;		  if (val & DF_1_NOW)		    {		      printf (" NOW");		      val ^= DF_1_NOW;		    }		  if (val & DF_1_GLOBAL)		    {		      printf (" GLOBAL");		      val ^= DF_1_GLOBAL;		    }		  if (val & DF_1_GROUP)		    {		      printf (" GROUP");		      val ^= DF_1_GROUP;		    }		  if (val & DF_1_NODELETE)		    {		      printf (" NODELETE");		      val ^= DF_1_NODELETE;		    }		  if (val & DF_1_LOADFLTR)		    {		      printf (" LOADFLTR");		      val ^= DF_1_LOADFLTR;		    }		  if (val & DF_1_INITFIRST)		    {		      printf (" INITFIRST");		      val ^= DF_1_INITFIRST;		    }		  if (val & DF_1_NOOPEN)		    {		      printf (" NOOPEN");		      val ^= DF_1_NOOPEN;		    }		  if (val & DF_1_ORIGIN)		    {		      printf (" ORIGIN");		      val ^= DF_1_ORIGIN;		    }		  if (val & DF_1_DIRECT)		    {		      printf (" DIRECT");		      val ^= DF_1_DIRECT;		    }		  if (val & DF_1_TRANS)		    {		      printf (" TRANS");		      val ^= DF_1_TRANS;		    }		  if (val & DF_1_INTERPOSE)		    {		      printf (" INTERPOSE");		      val ^= DF_1_INTERPOSE;		    }		  if (val != 0)		    printf (" %lx", val);		  puts ("");		}	    }	  break;	case DT_PLTREL:	  if (do_dynamic)	    puts (get_dynamic_type (entry->d_un.d_val));	  break;	case DT_NULL	:	case DT_NEEDED	:	case DT_PLTGOT	:	case DT_HASH	:	case DT_STRTAB	:	case DT_SYMTAB	:	case DT_RELA	:	case DT_INIT	:	case DT_FINI	:	case DT_SONAME	:	case DT_RPATH	:	case DT_SYMBOLIC:	case DT_REL	:	case DT_DEBUG	:	case DT_TEXTREL	:	case DT_JMPREL	:	  dynamic_info[entry->d_tag] = entry->d_un.d_val;	  if (do_dynamic)	    {	      char * name;	      if (dynamic_strings == NULL)		name = NULL;	      else		name = dynamic_strings + entry->d_un.d_val;	      if (name)		{		  switch (entry->d_tag)		    {		    case DT_NEEDED:		      printf (_("Shared library: [%s]"), name);		      if (strcmp (name, program_interpreter) == 0)			printf (_(" program interpreter"));		      break;		    case DT_SONAME:		      printf (_("Library soname: [%s]"), name);		      break;		    case DT_RPATH:		      printf (_("Library rpath: [%s]"), name);		      break;		    default:		      print_vma (entry->d_un.d_val, PREFIX_HEX);		      break;		    }		}	      else		print_vma (entry->d_un.d_val, PREFIX_HEX);	      putchar ('\n');	    }	  break;	case DT_PLTRELSZ:	case DT_RELASZ	:	case DT_STRSZ	:	case DT_RELSZ	:	case DT_RELAENT	:	case DT_SYMENT	:	case DT_RELENT	:	case DT_PLTPADSZ:	case DT_MOVEENT	:	case DT_MOVESZ	:	case DT_INIT_ARRAYSZ:	case DT_FINI_ARRAYSZ:	  if (do_dynamic)	    {	      print_vma (entry->d_un.d_val, UNSIGNED);	      printf (" (bytes)\n");	    }	  break;	case DT_VERDEFNUM:	case DT_VERNEEDNUM:	case DT_RELACOUNT:	case DT_RELCOUNT:	  if (do_dynamic)	    {	      print_vma (entry->d_un.d_val, UNSIGNED);	      putchar ('\n');	    }	  break;	case DT_SYMINSZ:	case DT_SYMINENT:	case DT_SYMINFO:	case DT_USED:	case DT_INIT_ARRAY:	case DT_FINI_ARRAY:	  if (do_dynamic)	    {	      if (dynamic_strings != NULL && entry->d_tag == DT_USED)		{		  char * name;		  name = dynamic_strings + entry->d_un.d_val;		  if (* name)		    {		      printf (_("Not needed object: [%s]\n"), name);		      break;		    }		}	      print_vma (entry->d_un.d_val, PREFIX_HEX);	      putchar ('\n');	    }	  break;	case DT_BIND_NOW:	  /* The value of this entry is ignored.  */	  break;	default:	  if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM))	    version_info [DT_VERSIONTAGIDX (entry->d_tag)] =	      entry->d_un.d_val;	  if (do_dynamic)	    {	      switch (elf_header.e_machine)		{		case EM_MIPS:		case EM_MIPS_RS4_BE:		  dynamic_segment_mips_val (entry);		  break;		case EM_PARISC:		  dynamic_segment_parisc_val (entry);		  break;		default:		  print_vma (entry->d_un.d_val, PREFIX_HEX);		  putchar ('\n');		}	    }	  break;	}    }  return 1;}