|
@@ -32,7 +32,6 @@
|
|
|
#include <getopt.h>
|
|
|
#include <dirent.h>
|
|
|
#include <unistd.h>
|
|
|
-#include <a.out.h>
|
|
|
#include <link.h>
|
|
|
#include <elf.h>
|
|
|
#include <sys/stat.h>
|
|
@@ -43,6 +42,32 @@
|
|
|
#include "../config.h"
|
|
|
#include "readelf.h"
|
|
|
|
|
|
+struct exec
|
|
|
+{
|
|
|
+ unsigned long a_info; /* Use macros N_MAGIC, etc for access */
|
|
|
+ unsigned a_text; /* length of text, in bytes */
|
|
|
+ unsigned a_data; /* length of data, in bytes */
|
|
|
+ unsigned a_bss; /* length of uninitialized data area for file, in bytes */
|
|
|
+ unsigned a_syms; /* length of symbol table data in file, in bytes */
|
|
|
+ unsigned a_entry; /* start address */
|
|
|
+ unsigned a_trsize; /* length of relocation info for text, in bytes */
|
|
|
+ unsigned a_drsize; /* length of relocation info for data, in bytes */
|
|
|
+};
|
|
|
+
|
|
|
+#if !defined (N_MAGIC)
|
|
|
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
|
|
|
+#endif
|
|
|
+/* Code indicating object file or impure executable. */
|
|
|
+#define OMAGIC 0407
|
|
|
+/* Code indicating pure executable. */
|
|
|
+#define NMAGIC 0410
|
|
|
+/* Code indicating demand-paged executable. */
|
|
|
+#define ZMAGIC 0413
|
|
|
+/* This indicates a demand-paged executable with the header in the text.
|
|
|
+ The first page is unmapped to help trap NULL pointer references */
|
|
|
+#define QMAGIC 0314
|
|
|
+/* Code indicating core file. */
|
|
|
+#define CMAGIC 0421
|
|
|
#ifdef __GNUC__
|
|
|
void warn(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
|
|
void error(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|