[comp.os.minix] MINIX-ST 1.1 patch #9: new file /usr/include/out.h

johan@nlgvax.UUCP (Johan Stevenson) (11/28/88)

This message contains a shar wrapping of the following files:
	$ crc *
	23828   3238 out.h

This include file describes the ACK object file format.

Go to an empty directory, feed the lines following the cut mark
to the shell, check the table above with the output of /usr/bin/crc
and install as follows:
	$ cp * /usr/include
Good luck.
--
Johan W. Stevenson	johan@pcg.philips.nl		Philips Research
------------------------------------------------------------------------
: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
echo 'Extracting out.h'
sed 's/^X//' > out.h << '+ END-OF-FILE out.h'
X/*
X * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
X * See the copyright notice in the file "../Copyright".
X */
X/*
X * output format for ACK assemblers
X */
X#ifndef ushort
X#define ushort	unsigned short
X#endif ushort
X
Xstruct outhead {
X	ushort 	oh_magic;	/* magic number */
X	ushort 	oh_stamp;	/* version stamp */
X	ushort	oh_flags;	/* several format flags */
X	ushort	oh_nsect;	/* number of outsect structures */
X	ushort	oh_nrelo;	/* number of outrelo structures */
X	ushort	oh_nname;	/* number of outname structures */
X	long	oh_nemit;	/* sum of all os_flen */
X	long	oh_nchar;	/* size of string area */
X};
X
X#define O_MAGIC	0x0201		/* magic number of output file */
X#define	O_STAMP	0		/* version stamp */
X#define MAXSECT	64		/* Maximum number of sections */
X
X#define	HF_LINK	0x0004		/* unresolved references left */
X#define	HF_8086	0x0008		/* os_base specially encoded */
X
Xstruct outsect {
X	long 	os_base;	/* startaddress in machine */
X	long	os_size;	/* section size in machine */
X	long	os_foff;	/* startaddress in file */
X	long	os_flen;	/* section size in file */
X	long	os_lign;	/* section alignment */
X};
X
Xstruct outrelo {
X	char	or_type;	/* type of reference */
X	char	or_sect;	/* referencing section */
X	ushort	or_nami;	/* referenced symbol index */
X	long	or_addr;	/* referencing address */
X};
X
Xstruct outname {
X	union {
X	  char	*on_ptr;	/* symbol name (in core) */
X	  long	on_off;		/* symbol name (in file) */
X	}	on_u;
X#define on_mptr	on_u.on_ptr
X#define on_foff	on_u.on_off
X	ushort	on_type;	/* symbol type */
X	ushort	on_desc;	/* debug info */
X	long	on_valu;	/* symbol value */
X};
X
X/*
X * relocation type bits
X */
X#define RELSZ	0x07		/* relocation length */
X#define RELO1	   1		/* 1 byte */
X#define RELO2	   2		/* 2 bytes */
X#define RELO4	   4		/* 4 bytes */
X#define RELPC	0x08		/* pc relative */
X#define RELBR	0x10		/* High order byte lowest address. */
X#define RELWR	0x20		/* High order word lowest address. */
X
X/*
X * section type bits and fields
X */
X#define S_TYP	0x007F		/* undefined, absolute or relative */
X#define S_EXT	0x0080		/* external flag */
X#define S_ETC	0x7F00		/* for symbolic debug, bypassing 'as' */
X
X/*
X * S_TYP field values
X */
X#define S_UND	0x0000		/* undefined item */
X#define S_ABS	0x0001		/* absolute item */
X#define S_MIN	0x0002		/* first user section */
X#define S_MAX	S_TYP		/* last user section */
X
X/*
X * S_ETC field values
X */
X#define S_SCT	0x0100		/* section names */
X#define S_LIN	0x0200		/* hll source line item */
X#define S_FIL	0x0300		/* hll source file item */
X#define S_MOD	0x0400		/* ass source file item */
X#define S_COM	0x1000		/* Common name. */
X
X/*
X * structure format strings
X */
X#define SF_HEAD		"22222244"
X#define SF_SECT		"44444"
X#define SF_RELO		"1124"
X#define SF_NAME		"4224"
X
X/*
X * structure sizes (bytes in file; add digits in SF_*)
X */
X#define SZ_HEAD		20
X#define SZ_SECT		20
X#define SZ_RELO		8
X#define SZ_NAME		12
X
X/*
X * file access macros
X */
X#define BADMAGIC(x)	((x).oh_magic!=O_MAGIC)
X#define OFF_SECT(x)	SZ_HEAD
X#define OFF_EMIT(x)	(OFF_SECT(x) + ((long)(x).oh_nsect * SZ_SECT))
X#define OFF_RELO(x)	(OFF_EMIT(x) + (x).oh_nemit)
X#define OFF_NAME(x)	(OFF_RELO(x) + ((long)(x).oh_nrelo * SZ_RELO))
X#define OFF_CHAR(x)	(OFF_NAME(x) + ((long)(x).oh_nname * SZ_NAME))
+ END-OF-FILE out.h
chmod 644 out.h
echo 'CRC SENT: 23828   3238 out.h'
echo -n 'CRC RCVD: '
crc out.h
exit 0