summaryrefslogtreecommitdiff
path: root/ldso/util/ldd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/util/ldd.c')
-rw-r--r--ldso/util/ldd.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/ldso/util/ldd.c b/ldso/util/ldd.c
index 640da41f0..a0b0338eb 100644
--- a/ldso/util/ldd.c
+++ b/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__