aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/readelf.c21
2 files changed, 24 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b2f5e3c..58f9416 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,12 @@
1999-05-29 Nick Clifton <nickc@cygnus.com>
+ * readelf.c (get_elf_class): Display unknown class number.
+ (get_data_encoding): Display unknown encoding number.
+ (get_osabi_name): Display unknown ABI number.
+ (process_file_header): Display unknown version number.
+
+1999-05-29 Nick Clifton <nickc@cygnus.com>
+
* readelf.c (dump_relocations): Fix typo.
1999-05-28 Nick Clifton <nickc@cygnus.com>
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 394bf79..6419e6a 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -1353,12 +1353,16 @@ static const char *
get_elf_class (elf_class)
unsigned char elf_class;
{
+ static char buff [32];
+
switch (elf_class)
{
case ELFCLASSNONE: return _("none");
case ELFCLASS32: return _("ELF32");
case ELFCLASS64: return _("ELF64");
- default: return _("<unknown>");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), elf_class);
+ return buff;
}
}
@@ -1366,12 +1370,16 @@ static const char *
get_data_encoding (encoding)
unsigned char encoding;
{
+ static char buff [32];
+
switch (encoding)
{
case ELFDATANONE: return _("none");
case ELFDATA2LSB: return _("2's complement, little endian");
case ELFDATA2MSB: return _("2's complement, big endian");
- default: return _("<unknown>");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), encoding);
+ return buff;
}
}
@@ -1379,12 +1387,16 @@ static const char *
get_osabi_name (osabi)
unsigned char osabi;
{
+ static char buff [32];
+
switch (osabi)
{
case ELFOSABI_SYSV: return _("UNIX - System V");
case ELFOSABI_HPUX: return _("UNIX - HP-UX");
case ELFOSABI_STANDALONE: return _("Standalone App");
- default: return _("<unknown>");
+ default:
+ sprintf (buff, _("<unknown: %lx>"), osabi);
+ return buff;
}
}
@@ -1418,7 +1430,8 @@ process_file_header ()
printf (_(" Version: %d %s\n"),
elf_header.e_ident [EI_VERSION],
elf_header.e_ident [EI_VERSION] == EV_CURRENT ? "(current)" :
- elf_header.e_ident [EI_VERSION] != EV_NONE ? "<unknown>" : "");
+ elf_header.e_ident [EI_VERSION] != EV_NONE ? "<unknown: %lx>" : "",
+ elf_header.e_ident [EI_VERSION]);
printf (_(" OS/ABI: %s\n"),
get_osabi_name (elf_header.e_ident [EI_OSABI]));
printf (_(" ABI Version: %d\n"),