Fix compile time warnings & asupport more than 999 symbols

This commit is contained in:
Nick Clifton 1999-12-07 21:26:51 +00:00
parent f7a999632f
commit 5e220199b9
2 changed files with 33 additions and 26 deletions

View file

@ -1,3 +1,8 @@
1999-12-07 H . J . Lu hjl@valinux.com
* readelf.c: Fix compile time warnings. Support more than 999
symbols.
1999-12-03 Nick Clifton <nickc@cygnus.com> 1999-12-03 Nick Clifton <nickc@cygnus.com>
* readelf.c (enum print_mode): New type. * readelf.c (enum print_mode): New type.

View file

@ -405,12 +405,12 @@ print_vma (vma, mode)
switch (mode) switch (mode)
{ {
case FULL_HEX: printf ("0x"); /* drop through */ case FULL_HEX: printf ("0x"); /* drop through */
case LONG_HEX: printf ("%08.8lx", vma); break; case LONG_HEX: printf ("%8.8lx", (unsigned long) vma); break;
case PREFIX_HEX: printf ("0x"); /* drop through */ case PREFIX_HEX: printf ("0x"); /* drop through */
case HEX: printf ("%lx", vma); break; case HEX: printf ("%lx", (unsigned long) vma); break;
case DEC: printf ("%ld", vma); break; case DEC: printf ("%ld", (unsigned long) vma); break;
case DEC_5: printf ("%5ld", vma); break; case DEC_5: printf ("%5ld", (long) vma); break;
case UNSIGNED: printf ("%lu", vma); break; case UNSIGNED: printf ("%lu", (unsigned long) vma); break;
} }
} }
#ifdef BFD64 #ifdef BFD64
@ -2514,7 +2514,7 @@ process_section_headers (file)
{ {
putchar (' '); putchar (' ');
print_vma (section->sh_addr, LONG_HEX); print_vma (section->sh_addr, LONG_HEX);
printf (" %08.8lx", section->sh_offset); printf (" %8.8lx", section->sh_offset);
printf ("\n "); printf ("\n ");
print_vma (section->sh_size, LONG_HEX); print_vma (section->sh_size, LONG_HEX);
printf (" "); printf (" ");
@ -2746,23 +2746,24 @@ dynamic_segment_parisc_val (entry)
static struct static struct
{ {
long int bit; long int bit;
const char *str; const char * str;
} flags[] = }
{ flags[] =
{ DT_HP_DEBUG_PRIVATE, "HP_DEBUG_PRIVATE" }, {
{ DT_HP_DEBUG_CALLBACK, "HP_DEBUG_CALLBACK" }, { DT_HP_DEBUG_PRIVATE, "HP_DEBUG_PRIVATE" },
{ DT_HP_DEBUG_CALLBACK_BOR, "HP_DEBUG_CALLBACK_BOR" }, { DT_HP_DEBUG_CALLBACK, "HP_DEBUG_CALLBACK" },
{ DT_HP_NO_ENVVAR, "HP_NO_ENVVAR" }, { DT_HP_DEBUG_CALLBACK_BOR, "HP_DEBUG_CALLBACK_BOR" },
{ DT_HP_BIND_NOW, "HP_BIND_NOW" }, { DT_HP_NO_ENVVAR, "HP_NO_ENVVAR" },
{ DT_HP_BIND_NONFATAL, "HP_BIND_NONFATAL" }, { DT_HP_BIND_NOW, "HP_BIND_NOW" },
{ DT_HP_BIND_VERBOSE, "HP_BIND_VERBOSE" }, { DT_HP_BIND_NONFATAL, "HP_BIND_NONFATAL" },
{ DT_HP_BIND_RESTRICTED, "HP_BIND_RESTRICTED" }, { DT_HP_BIND_VERBOSE, "HP_BIND_VERBOSE" },
{ DT_HP_BIND_SYMBOLIC, "HP_BIND_SYMBOLIC" }, { DT_HP_BIND_RESTRICTED, "HP_BIND_RESTRICTED" },
{ DT_HP_RPATH_FIRST, "HP_RPATH_FIRST" }, { DT_HP_BIND_SYMBOLIC, "HP_BIND_SYMBOLIC" },
{ DT_HP_BIND_DEPTH_FIRST, "HP_BIND_DEPTH_FIRST" } { DT_HP_RPATH_FIRST, "HP_RPATH_FIRST" },
}; { DT_HP_BIND_DEPTH_FIRST, "HP_BIND_DEPTH_FIRST" }
};
int first = 1; int first = 1;
int cnt; size_t cnt;
bfd_vma val = entry->d_un.d_val; bfd_vma val = entry->d_un.d_val;
for (cnt = 0; cnt < sizeof (flags) / sizeof (flags[0]); ++cnt) for (cnt = 0; cnt < sizeof (flags) / sizeof (flags[0]); ++cnt)
@ -2774,6 +2775,7 @@ dynamic_segment_parisc_val (entry)
first = 0; first = 0;
val ^= flags[cnt].bit; val ^= flags[cnt].bit;
} }
if (val != 0 || first) if (val != 0 || first)
{ {
if (! first) if (! first)
@ -3981,7 +3983,7 @@ process_symbol_table (file)
char nb [4]; char nb [4];
char nc [4]; char nc [4];
int nbuckets = 0; int nbuckets = 0;
int nchains; int nchains = 0;
int * buckets = NULL; int * buckets = NULL;
int * chains = NULL; int * chains = NULL;
@ -4080,9 +4082,9 @@ process_symbol_table (file)
SECTION_NAME (section), SECTION_NAME (section),
(unsigned long) (section->sh_size / section->sh_entsize)); (unsigned long) (section->sh_size / section->sh_entsize));
if (is_32bit_elf) if (is_32bit_elf)
printf (_(" Num: Value Size Type Bind Ot Ndx Name\n")); printf (_(" Num: Value Size Type Bind Ot Ndx Name\n"));
else else
printf (_(" Num: Value Size Type Bind Ot Ndx Name\n")); printf (_(" Num: Value Size Type Bind Ot Ndx Name\n"));
symtab = GET_ELF_SYMBOLS (file, section->sh_offset, symtab = GET_ELF_SYMBOLS (file, section->sh_offset,
section->sh_size / section->sh_entsize); section->sh_size / section->sh_entsize);
@ -4105,7 +4107,7 @@ process_symbol_table (file)
si < section->sh_size / section->sh_entsize; si < section->sh_size / section->sh_entsize;
si ++, psym ++) si ++, psym ++)
{ {
printf (" %3d: ", si); printf ("%6d: ", si);
print_vma (psym->st_value, LONG_HEX); print_vma (psym->st_value, LONG_HEX);
putchar (' '); putchar (' ');
print_vma (psym->st_size, DEC_5); print_vma (psym->st_size, DEC_5);