/*
 * NetBSD a.out header
 */

#include <exec/types.h>

struct exec {
	ULONG a_midmag;    /* htonl(flags << 26 | mid << 16 | magic) */
	ULONG a_text;      /* text segment size       */
	ULONG a_data;      /* initialized data size   */
	ULONG a_bss;       /* uninitialized data size */
	ULONG a_syms;      /* symbol table size       */
	ULONG a_entry;     /* entry point             */
	ULONG a_trsize;    /* text relocation size    */
	ULONG a_drsize;    /* data relocation size    */
};

#define E_MAGIC(e) ((e)->a_midmag & 0xffff)
#define E_MID(e)   (((e)->a_midmag >> 16) & 0x3ff)
#define E_FLAGS(e) (((e)->a_midmag >> 26) & 0x3f)

#define OMAGIC   0407  /* old impure format  */
#define NMAGIC   0410  /* read-only text     */
#define ZMAGIC   0413  /* demand-load format */
#define QMAGIC   0314  /* "compact" demand-load format; deprecated */

#define	MID_ZERO	0	/* unknown - implementation dependent */
#define	MID_SUN010	1	/* sun 68010/68020 binary */
#define	MID_SUN020	2	/* sun 68020-only binary */
#define	MID_PC386	100	/* 386 PC binary. (so quoth BFD) */
#define	MID_HP200	200	/* hp200 (68010) BSD binary */
#define	MID_I386	134	/* i386 BSD binary */
#define	MID_M68K	135	/* m68k BSD binary with 8K page sizes */
#define	MID_M68K4K	136	/* m68k BSD binary with 4K page sizes */
#define	MID_NS32532	137	/* ns32532 */
#define	MID_SPARC	138	/* sparc */
#define	MID_PMAX	139	/* pmax */
#define	MID_VAX		140	/* vax */
#define	MID_ALPHA	141	/* Alpha BSD binary */
#define	MID_HP300	300	/* hp300 (68020+68881) BSD binary */
#define	MID_HPUX	0x20C	/* hp200/300 HP-UX binary */
#define	MID_HPUX800     0x20B   /* hp800 HP-UX binary */

#define EX_DYNAMIC	0x20
#define EX_PIC		0x10
#define EX_DPMASK	0x30
