summaryrefslogtreecommitdiff
path: root/file/src/readelf.c
diff options
context:
space:
mode:
Diffstat (limited to 'file/src/readelf.c')
-rw-r--r--file/src/readelf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/file/src/readelf.c b/file/src/readelf.c
index 527263172..6ca3ed949 100644
--- a/file/src/readelf.c
+++ b/file/src/readelf.c
@@ -37,7 +37,7 @@
#include "readelf.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.45 2004/11/24 17:38:24 christos Exp $")
+FILE_RCSID("@(#)$Id: readelf.c,v 1.47 2005/06/25 15:52:14 christos Exp $")
#endif
#ifdef ELFCORE
@@ -185,6 +185,7 @@ size_t prpsoffsets32[] = {
/*@unchecked@*/ /*@observer@*/
size_t prpsoffsets64[] = {
+ 40, /* Linux (tested on core from 2.4.x) */
120, /* SunOS 5.x, 64-bit */
};
@@ -497,6 +498,19 @@ donote(struct magic_set *ms, unsigned char *nbuf, size_t offset, size_t size,
return size;
}
+ if (namesz == 10 && strcmp((char *)&nbuf[noff], "DragonFly") == 0 &&
+ nh_type == NT_DRAGONFLY_VERSION && descsz == 4) {
+ uint32_t desc;
+ if (file_printf(ms, ", for DragonFly") == -1)
+ return size;
+ (void)memcpy(&desc, &nbuf[doff], sizeof(desc));
+ desc = getu32(swap, desc);
+ if (file_printf(ms, " %d.%d.%d", desc / 100000,
+ desc / 10000 % 10, desc % 10000) == -1)
+ return size;
+ return size;
+ }
+
/*
* Sigh. The 2.0.36 kernel in Debian 2.1, at
* least, doesn't correctly implement name