1999-09-15 Ulrich Drepper <drepper@cygnus.com>
* readelf.c (dynamic_segment_parisc_val): Print 0 for DLD_FLAGS if the value is zero. (process_symbol_table): Don't print histogram if hash table is empty. 1999-09-15 Ulrich Drepper <drepper@cygnus.com> * readelf.c (get_parisc_dynamic_type): Handle DT_HP_GST_* values. 1999-09-02 Ulrich Drepper <drepper@cygnus.com> * readelf.c (get_symbol_type): Add support for HPUX and PARISC specific symbol types. * readelf.c: Add HPUX and PARISC extensions to dynamic and program header table printing. * readelf.c (get_machine_flags): Add handling of PARISC.
This commit is contained in:
parent
3fce499807
commit
103f02d372
2 changed files with 405 additions and 177 deletions
|
@ -1,3 +1,23 @@
|
|||
1999-09-15 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* readelf.c (dynamic_segment_parisc_val): Print 0 for DLD_FLAGS if
|
||||
the value is zero.
|
||||
(process_symbol_table): Don't print histogram if hash table is empty.
|
||||
|
||||
1999-09-15 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* readelf.c (get_parisc_dynamic_type): Handle DT_HP_GST_* values.
|
||||
|
||||
1999-09-02 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* readelf.c (get_symbol_type): Add support for HPUX and PARISC
|
||||
specific symbol types.
|
||||
|
||||
* readelf.c: Add HPUX and PARISC extensions to dynamic and program
|
||||
header table printing.
|
||||
|
||||
* readelf.c (get_machine_flags): Add handling of PARISC.
|
||||
|
||||
1999-09-29 Mumit Khan <khan@xraylith.wisc.edu>
|
||||
|
||||
* dlltool.c (scan_drectve_symbols): Handle type tags in exported
|
||||
|
|
|
@ -132,14 +132,17 @@ static bfd_vma byte_get_little_endian PARAMS ((unsigned char *,
|
|||
static bfd_vma byte_get_big_endian PARAMS ((unsigned char *, int));
|
||||
static const char * get_mips_dynamic_type PARAMS ((unsigned long));
|
||||
static const char * get_sparc64_dynamic_type PARAMS ((unsigned long));
|
||||
static const char * get_parisc_dynamic_type PARAMS ((unsigned long));
|
||||
static const char * get_dynamic_type PARAMS ((unsigned long));
|
||||
static int dump_relocations PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, unsigned long, char *, int));
|
||||
static char * get_file_type PARAMS ((unsigned));
|
||||
static char * get_machine_name PARAMS ((unsigned));
|
||||
static char * get_machine_flags PARAMS ((unsigned, unsigned));
|
||||
static const char * get_mips_segment_type PARAMS ((unsigned long));
|
||||
static const char * get_parisc_segment_type PARAMS ((unsigned long));
|
||||
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 char * get_symbol_binding PARAMS ((unsigned int));
|
||||
static char * get_symbol_type PARAMS ((unsigned int));
|
||||
|
@ -149,6 +152,7 @@ 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 *));
|
||||
|
@ -864,6 +868,30 @@ get_sparc64_dynamic_type (type)
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
@ -952,7 +980,24 @@ get_dynamic_type (type)
|
|||
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);
|
||||
|
||||
|
@ -1152,6 +1197,34 @@ get_machine_flags (e_flags, e_machine)
|
|||
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");
|
||||
|
||||
case EM_PJ:
|
||||
if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS)
|
||||
strcat (buf, ", new calling convention");
|
||||
|
@ -1184,6 +1257,33 @@ get_mips_segment_type (type)
|
|||
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;
|
||||
|
@ -1211,6 +1311,9 @@ get_segment_type (p_type)
|
|||
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;
|
||||
|
@ -1222,7 +1325,24 @@ get_segment_type (p_type)
|
|||
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);
|
||||
|
||||
|
@ -1281,6 +1401,21 @@ get_mips_section_type_name (sh_type)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_parisc_section_type_name (sh_type)
|
||||
unsigned int sh_type;
|
||||
{
|
||||
switch (sh_type)
|
||||
{
|
||||
case SHT_PARISC_EXT: return "PARISC_EXT";
|
||||
case SHT_PARISC_UNWIND: return "PARISC_UNWIND";
|
||||
case SHT_PARISC_DOC: return "PARISC_DOC";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_section_type_name (sh_type)
|
||||
unsigned int sh_type;
|
||||
|
@ -1320,6 +1455,9 @@ get_section_type_name (sh_type)
|
|||
case EM_MIPS_RS4_BE:
|
||||
result = get_mips_section_type_name (sh_type);
|
||||
break;
|
||||
case EM_PARISC:
|
||||
result = get_parisc_section_type_name (sh_type);
|
||||
break;
|
||||
default:
|
||||
result = NULL;
|
||||
break;
|
||||
|
@ -1844,7 +1982,7 @@ process_program_headers (file)
|
|||
{
|
||||
if (do_segments)
|
||||
{
|
||||
printf (" %-11.11s ", get_segment_type (segment->p_type));
|
||||
printf (" %-14.14s ", get_segment_type (segment->p_type));
|
||||
printf ("0x%6.6lx ", (unsigned long) segment->p_offset);
|
||||
printf ("0x%8.8lx ", (unsigned long) segment->p_vaddr);
|
||||
printf ("0x%8.8lx ", (unsigned long) segment->p_paddr);
|
||||
|
@ -2434,6 +2572,57 @@ dynamic_segment_mips_val (entry)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dynamic_segment_parisc_val (entry)
|
||||
Elf_Internal_Dyn * entry;
|
||||
{
|
||||
switch (entry->d_tag)
|
||||
{
|
||||
case DT_HP_DLD_FLAGS:
|
||||
{
|
||||
static struct
|
||||
{
|
||||
long int bit;
|
||||
const char *str;
|
||||
} flags[] =
|
||||
{
|
||||
{ DT_HP_DEBUG_PRIVATE, "HP_DEBUG_PRIVATE" },
|
||||
{ DT_HP_DEBUG_CALLBACK, "HP_DEBUG_CALLBACK" },
|
||||
{ DT_HP_DEBUG_CALLBACK_BOR, "HP_DEBUG_CALLBACK_BOR" },
|
||||
{ DT_HP_NO_ENVVAR, "HP_NO_ENVVAR" },
|
||||
{ DT_HP_BIND_NOW, "HP_BIND_NOW" },
|
||||
{ DT_HP_BIND_NONFATAL, "HP_BIND_NONFATAL" },
|
||||
{ DT_HP_BIND_VERBOSE, "HP_BIND_VERBOSE" },
|
||||
{ DT_HP_BIND_RESTRICTED, "HP_BIND_RESTRICTED" },
|
||||
{ DT_HP_BIND_SYMBOLIC, "HP_BIND_SYMBOLIC" },
|
||||
{ DT_HP_RPATH_FIRST, "HP_RPATH_FIRST" },
|
||||
{ DT_HP_BIND_DEPTH_FIRST, "HP_BIND_DEPTH_FIRST" }
|
||||
};
|
||||
int first = 1;
|
||||
int cnt;
|
||||
long int val = entry->d_un.d_val;
|
||||
|
||||
for (cnt = 0; cnt < sizeof (flags) / sizeof (flags[0]); ++cnt)
|
||||
if (val & flags[cnt].bit)
|
||||
{
|
||||
if (! first)
|
||||
putchar (' ');
|
||||
fputs (flags[cnt].str, stdout);
|
||||
first = 0;
|
||||
val ^= flags[cnt].bit;
|
||||
}
|
||||
if (val != 0 || first)
|
||||
printf ("%s%#lx", first ? "" : " ", val);
|
||||
puts ("");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("%#lx\n", (long) entry->d_un.d_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
get_32bit_dynamic_segment (file)
|
||||
FILE * file;
|
||||
|
@ -2947,6 +3136,9 @@ process_dynamic_segment (file)
|
|||
case EM_MIPS_RS4_BE:
|
||||
dynamic_segment_mips_val (entry);
|
||||
break;
|
||||
case EM_PARISC:
|
||||
dynamic_segment_parisc_val (entry);
|
||||
break;
|
||||
default:
|
||||
printf ("%#lx\n", (long) entry->d_un.d_ptr);
|
||||
}
|
||||
|
@ -3473,9 +3665,9 @@ get_symbol_binding (binding)
|
|||
|
||||
switch (binding)
|
||||
{
|
||||
case STB_LOCAL: return _("LOCAL");
|
||||
case STB_GLOBAL: return _("GLOBAL");
|
||||
case STB_WEAK: return _("WEAK");
|
||||
case STB_LOCAL: return "LOCAL";
|
||||
case STB_GLOBAL: return "GLOBAL";
|
||||
case STB_WEAK: return "WEAK";
|
||||
default:
|
||||
if (binding >= STB_LOPROC && binding <= STB_HIPROC)
|
||||
sprintf (buff, _("<processor specific>: %d"), binding);
|
||||
|
@ -3495,24 +3687,37 @@ get_symbol_type (type)
|
|||
|
||||
switch (type)
|
||||
{
|
||||
case STT_NOTYPE: return _("NOTYPE");
|
||||
case STT_OBJECT: return _("OBJECT");
|
||||
case STT_FUNC: return _("FUNC");
|
||||
case STT_SECTION: return _("SECTION");
|
||||
case STT_FILE: return _("FILE");
|
||||
case STT_NOTYPE: return "NOTYPE";
|
||||
case STT_OBJECT: return "OBJECT";
|
||||
case STT_FUNC: return "FUNC";
|
||||
case STT_SECTION: return "SECTION";
|
||||
case STT_FILE: return "FILE";
|
||||
default:
|
||||
if (type >= STT_LOPROC && type <= STT_HIPROC)
|
||||
{
|
||||
if (elf_header.e_machine == EM_ARM && type == STT_ARM_TFUNC)
|
||||
return _("THUMB_FUNC");
|
||||
return "THUMB_FUNC";
|
||||
|
||||
if (elf_header.e_machine == EM_SPARCV9 && type == STT_REGISTER)
|
||||
return _("REGISTER");
|
||||
return "REGISTER";
|
||||
|
||||
if (elf_header.e_machine == EM_PARISC && type == STT_PARISC_MILLI)
|
||||
return "PARISC_MILLI";
|
||||
|
||||
sprintf (buff, _("<processor specific>: %d"), type);
|
||||
}
|
||||
else if (type >= STT_LOOS && type <= STT_HIOS)
|
||||
{
|
||||
if (elf_header.e_machine == EM_PARISC)
|
||||
{
|
||||
if (type == STT_HP_OPAQUE)
|
||||
return "HP_OPAQUE";
|
||||
if (type == STT_HP_STUB)
|
||||
return "HP_STUB";
|
||||
}
|
||||
|
||||
sprintf (buff, _("<OS specific>: %d"), type);
|
||||
}
|
||||
else
|
||||
sprintf (buff, _("<unknown>: %d"), type);
|
||||
return buff;
|
||||
|
@ -3901,8 +4106,10 @@ process_symbol_table (file)
|
|||
}
|
||||
|
||||
for (hn = 0; hn < nbuckets; ++hn)
|
||||
++ counts [lengths [hn]];
|
||||
++counts[lengths [hn]];
|
||||
|
||||
if (nbuckets > 0)
|
||||
{
|
||||
printf (" 0 %-10d (%5.1f%%)\n",
|
||||
counts[0], (counts[0] * 100.0) / nbuckets);
|
||||
for (si = 1; si <= maxlength; ++si)
|
||||
|
@ -3912,6 +4119,7 @@ process_symbol_table (file)
|
|||
si, counts[si], (counts[si] * 100.0) / nbuckets,
|
||||
(nzero_counts * 100.0) / nsyms);
|
||||
}
|
||||
}
|
||||
|
||||
free (counts);
|
||||
free (lengths);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue