patch-1.3.10 linux/include/asm-alpha/a.out.h

Next file: linux/include/asm-alpha/lca.h
Previous file: linux/fs/ext2/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.9/linux/include/asm-alpha/a.out.h linux/include/asm-alpha/a.out.h
@@ -1,27 +1,76 @@
 #ifndef __ALPHA_A_OUT_H__
 #define __ALPHA_A_OUT_H__
 
-/* OSF/1 pseudo-a.out header */
+/*
+ * OSF/1 ECOFF header structs.  ECOFF files consist of:
+ * 	- a file header (struct filehdr),
+ *	- an a.out header (struct aouthdr),
+ *	- one or more section headers (struct scnhdr). 
+ *	  The filhdr's "f_nscns" field contains the
+ *	  number of section headers.
+ */
+
+struct filehdr
+{
+	/* OSF/1 "file" header */
+	__u16 f_magic, f_nscns;
+	__u32 f_timdat;
+	__u64 f_symptr;
+	__u32 f_nsyms;
+	__u16 f_opthdr, f_flags;
+};
+
+struct aouthdr
+{
+	__u64 info;		/* after that it looks quite normal.. */
+	__u64 tsize;
+	__u64 dsize;
+	__u64 bsize;
+	__u64 entry;
+	__u64 text_start;	/* with a few additions that actually make sense */
+	__u64 data_start;
+	__u64 bss_start;
+	__u32 gprmask, fprmask;	/* but what are these? */
+	__u64 gpvalue;
+};
+
+struct scnhdr
+{
+	char	s_name[8];
+	__u64	s_paddr;
+	__u64	s_vaddr;
+	__u64	s_size;
+	__u64	s_scnptr;
+	__u64	s_relptr;
+	__u64	s_lnnoptr;
+	__u16	s_nreloc;
+	__u16	s_nlnno;
+	__u32	s_flags;
+};
+
 struct exec
 {
 	/* OSF/1 "file" header */
-	unsigned short f_magic, f_nscns;
-	unsigned int f_timdat;
-	unsigned long f_symptr;
-	unsigned int f_nsyms;
-	unsigned short f_opthdr, f_flags;
-	/* followed by a more normal "a.out" header */
-	unsigned long a_info;		/* after that it looks quite normal.. */
-	unsigned long a_text;
-	unsigned long a_data;
-	unsigned long a_bss;
-	unsigned long a_entry;
-	unsigned long a_textstart;	/* with a few additions that actually make sense */
-	unsigned long a_datastart;
-	unsigned long a_bssstart;
-	unsigned int  a_gprmask, a_fprmask;	/* but what are these? */
-	unsigned long a_gpvalue;
+	struct filehdr		fh;
+	struct aouthdr		ah;
 };
+
+/*
+ * Define's so that the kernel exec code can access the a.out header
+ * fields...
+ */
+#define	a_info		ah.info
+#define	a_text		ah.tsize
+#define a_data		ah.dsize
+#define a_bss		ah.bsize
+#define a_entry		ah.entry
+#define a_textstart	ah.text_start
+#define	a_datastart	ah.data_start
+#define	a_bssstart	ah.bss_start
+#define	a_gprmask	ah.gprmask
+#define a_fprmask	ah.fprmask
+#define a_gpvalue	ah.gpvalue
+
 #define N_TXTADDR(x) ((x).a_textstart)
 #define N_DATADDR(x) ((x).a_datastart)
 #define N_BSSADDR(x) ((x).a_bssstart)
@@ -29,12 +78,13 @@
 #define N_TRSIZE(x) 0
 #define N_SYMSIZE(x) 0
 
-#define SCNHSZ		64		/* XXX should be sizeof(scnhdr) */
+#define AOUTHSZ		sizeof(struct aouthdr)
+#define SCNHSZ		sizeof(struct scnhdr)
 #define SCNROUND	16
 
 #define N_TXTOFF(x) \
   ((long) N_MAGIC(x) == ZMAGIC ? 0 : \
-   (sizeof(struct exec) + (x).f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1))
+   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1))
 
 #ifdef __KERNEL__
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this