Home | History | Annotate | Line # | Download | only in aout2hux
hux.h revision 1.3.170.1
      1        1.1  itohy /*
      2        1.1  itohy  *	Human68k .x file structure definitions
      3        1.1  itohy  *
      4  1.3.170.1  rmind  *	written by ITOH Yasufumi
      5        1.1  itohy  *	public domain
      6        1.1  itohy  *
      7  1.3.170.1  rmind  *	$NetBSD: hux.h,v 1.3.170.1 2011/03/05 20:52:23 rmind Exp $
      8        1.1  itohy  */
      9        1.1  itohy /*
     10        1.1  itohy  * Human68k ".x" executable format
     11        1.1  itohy  *
     12        1.1  itohy  *	----------------------------
     13        1.1  itohy  *	|  file header (64 bytes)  |
     14        1.1  itohy  *	|--------------------------|
     15        1.1  itohy  *	|  text                    |
     16        1.1  itohy  *	|--------------------------|
     17        1.1  itohy  *	|  data                    |
     18        1.1  itohy  *	|--------------------------|
     19        1.1  itohy  *	|  relocation table        |
     20        1.1  itohy  *	|--------------------------|
     21        1.1  itohy  *	|  symbol table            |
     22        1.1  itohy  *	|--------------------------|
     23        1.1  itohy  *	|  debugging information   |
     24        1.1  itohy  *	----------------------------
     25        1.1  itohy  *
     26        1.1  itohy  * text and data sections are loaded contiguous
     27        1.1  itohy  */
     28        1.1  itohy 
     29        1.1  itohy /* file header */
     30        1.1  itohy 
     31        1.1  itohy #define HUXMAGIC	0x4855		/* "HU" */
     32        1.1  itohy 
     33        1.1  itohy struct huxhdr {
     34        1.1  itohy 	be_uint16_t	x_magic;	/* HUXMAGIC */
     35        1.1  itohy 	u_int8_t	x_reserved1;	/* 0 */
     36        1.1  itohy 	u_int8_t	x_loadmode;	/* 0: normal, 1: minimal memory,
     37        1.1  itohy 					   2: high address */
     38        1.1  itohy 	be_uint32_t	x_base;		/* base address (normally 0) */
     39        1.1  itohy 	be_uint32_t	x_entry;	/* execution entry */
     40        1.1  itohy 	be_uint32_t	x_text;		/* size of text section */
     41        1.1  itohy 	be_uint32_t	x_data;		/* size of data section */
     42        1.1  itohy 	be_uint32_t	x_bss;		/* size of bss */
     43        1.1  itohy 	be_uint32_t	x_rsize;	/* size of relocation table */
     44        1.1  itohy 	be_uint32_t	x_syms;		/* size of symbol info */
     45        1.1  itohy 	be_uint32_t	x_db_line;	/* size of debugging info (line #) */
     46        1.1  itohy 	be_uint32_t	x_db_syms;	/* size of debugging info (symbol) */
     47        1.1  itohy 	be_uint32_t	x_db_str;	/* size of debugging info (string) */
     48        1.1  itohy 	be_uint32_t	x_reserved2[4];	/* 0 */
     49        1.1  itohy 	be_uint32_t	x_bindlist;	/* bind list offset */
     50        1.1  itohy };
     51        1.1  itohy 
     52        1.1  itohy /*
     53        1.1  itohy  * relocation information
     54        1.1  itohy  */
     55        1.1  itohy 
     56        1.1  itohy /* short format */
     57        1.1  itohy struct relinf_s {
     58        1.1  itohy 	be_uint16_t	locoff_s;	/* offset */
     59        1.1  itohy };
     60        1.1  itohy 
     61        1.1  itohy /* long format */
     62        1.1  itohy #define HUXLRELMAGIC	0x0001
     63        1.1  itohy struct relinf_l {
     64        1.1  itohy 	be_uint16_t	lrelmag;	/* HUXLRELMAGIC */
     65        1.1  itohy 	be_uint16_t	locoff_l[2];	/* this would be  be_uint32_t
     66        1.1  itohy 					 * if there were no alignment problems
     67        1.1  itohy 					 */
     68        1.1  itohy };
     69        1.1  itohy 
     70        1.2  itohy #define HUX_MINLREL	0x10000		/* minimal value for long format */
     71