Browse Source

Get rid of the a.out header file

Eric Andersen 23 years ago
parent
commit
dcea56a735
2 changed files with 55 additions and 2 deletions
  1. 26 1
      ldso/util/ldconfig.c
  2. 29 1
      ldso/util/ldd.c

+ 26 - 1
ldso/util/ldconfig.c

@@ -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)));

+ 29 - 1
ldso/util/ldd.c

@@ -21,13 +21,41 @@
 #include <string.h>
 #include <getopt.h>
 #include <unistd.h>
-#include <a.out.h>
 #include <errno.h>
 #include <sys/wait.h>
 #include <linux/elf.h>
 #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
+
+
+
 extern int uselib(const char *library);
 
 #ifdef __GNUC__