aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-05-29 10:51:14 +0000
committerNick Clifton <nickc@redhat.com>1999-05-29 10:51:14 +0000
commitab5e779453ef98198abfc1f0b6ae1033601548ea (patch)
tree8a653e63f1976bd2ece009c13c22ce62d8fe7303
parent661e4995b2be313b44100bb23152e86f25685f5e (diff)
downloadgdb-ab5e779453ef98198abfc1f0b6ae1033601548ea.zip
gdb-ab5e779453ef98198abfc1f0b6ae1033601548ea.tar.gz
gdb-ab5e779453ef98198abfc1f0b6ae1033601548ea.tar.bz2
Display unknown values detected in ELF program header.
-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"),