shithub: scc

ref: 6f1a568924aa209ad591f3c540251f00006c655e
dir: /inc/coff32/filehdr.h/

View raw version

/* This file is inspired in the book "Understanding and using COFF" */

struct filehdr {
	unsigned short f_magic;  /* magic number */
	unsigned short f_nscns;  /* number of sections */
	long f_timdat;           /* time stamp */
	long f_symptr;           /* file pointer to symbols */
	long f_nsyms;            /* number of symbols */
	unsigned short f_opthdr; /* size of optional header */
	unsigned short f_flags;  /* file flags */
};

#define FILHDR struct filehdr
#define FILHSZ 20

#define F_RELFLG (1 << 0)
#define F_EXEC   (1 << 1)
#define F_LMNO   (1 << 2)
#define F_SYMS   (1 << 3)
#define F_AR16WR (1 << 4)
#define F_AR32WR (1 << 5)
#define F_A32WR  (1 << 6)

#define COFF_I386MAGIC    0x014c
#define COFF_Z80MAGIC     0x805a