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