Initial revision
[external/binutils.git] / include / oasys.h
1
2 /* **** */
3
4
5 typedef struct {
6   int32_type  version;
7   char create_date[12];
8   char revision_date[12];
9   uint32_type mod_count;
10   uint32_type mod_tbl_offset;
11   uint32_type sym_tbl_size;
12   uint32_type sym_count;
13   uint32_type sym_tbl_offset;
14   uint32_type xref_count;
15   uint32_type xref_lst_offset;
16 } oasys_archive_header_type;
17
18 typedef struct {
19   int32_type mod_number;
20   char mod_date[12];
21   int32_type mod_size;
22   int32_type dep_count;
23   int32_type depee_count;
24   int32_type sect_count;
25   int32_type file_offset;
26   int32_type mod_name_length;
27 } oasys_module_table_type;
28
29
30 typedef enum {
31   oasys_record_is_end_enum = 0,
32   oasys_record_is_data_enum = 1,
33   oasys_record_is_symbol_enum = 2,
34   oasys_record_is_header_enum = 3,
35   oasys_record_is_named_section_enum = 4,
36   oasys_record_is_com_enum = 5,
37   oasys_record_is_debug_enum = 6,
38   oasys_record_is_section_enum = 7,
39   oasys_record_is_debug_file_enum = 8,
40   oasys_record_is_module_enum = 9,
41   oasys_record_is_local_enum = 10
42 } oasys_record_enum_type;
43
44   
45
46 typedef struct {
47   uint8_type length;
48   int8_type check_sum;
49   int8_type type;
50   int8_type fill;
51 } oasys_record_header_type;
52
53 typedef struct {
54   oasys_record_header_type header;
55   uint8e_type relb;
56   uint8e_type addr[4];
57   uint8e_type data[256];
58 } oasys_data_record_type;
59
60 typedef struct {
61   oasys_record_header_type header;
62   int8_type version_number;
63   int8_type rev_number;
64   char module_name[26-6];
65   char description[64-26];
66 } oasys_header_record_type;
67
68 #define OASYS_VERSION_NUMBER 0
69 #define OASYS_REV_NUMBER 0
70 typedef struct {
71   oasys_record_header_type header;
72   int8e_type relb;
73   int8e_type value[4];
74   int8e_type refno[2];
75   char name[64];
76 } oasys_symbol_record_type;
77
78 typedef int8e_type relocation_byte;
79
80 #define RELOCATION_PCREL_BIT 0x80
81 #define RELOCATION_32BIT_BIT 0x40
82 #define RELOCATION_TYPE_BITS 0x30
83 #define RELOCATION_TYPE_ABS 0x00
84 #define RELOCATION_TYPE_REL 0x10
85 #define RELOCATION_TYPE_UND 0x20
86 #define RELOCATION_TYPE_COM 0x30
87 #define RELOCATION_SECT_BITS 0x0f
88
89 typedef struct 
90 {
91   oasys_record_header_type header;
92   uint8e_type relb;
93   int8_type value[4];
94   int8_type vma[4];
95   int8_type fill[3];
96 } oasys_section_record_type;
97
98 typedef struct {
99   oasys_record_header_type header;
100   uint8e_type relb;
101   int8e_type entry[4];
102   int8e_type fill[2];
103   int8e_type zero;
104 } oasys_end_record_type;
105
106
107 #define OASYS_MAX_SEC_COUNT 16
108 typedef union
109 {
110   oasys_record_header_type header;
111   oasys_data_record_type data;
112   oasys_section_record_type section;
113   oasys_symbol_record_type symbol;
114   oasys_header_record_type first;
115   oasys_end_record_type end;
116   uint8e_type pad[256];
117 } oasys_record_union_type;