Merge devo/bfd with GDB's bfd.
[external/binutils.git] / bfd / libieee.h
1 typedef struct {
2   unsigned int index:24;
3   char letter;
4 } ieee_symbol_index_type;
5
6 typedef struct ieee_symbol {
7   asymbol symbol;
8   struct ieee_symbol *next;
9
10 unsigned int index;
11 } ieee_symbol_type;
12
13
14 typedef struct ieee_reloc {
15   arelent relent;
16   struct ieee_reloc *next;
17   ieee_symbol_index_type symbol;
18
19 } ieee_reloc_type;
20
21 #define ieee_symbol(x) ((ieee_symbol_type *)(x))
22
23 typedef struct ieee_per_section
24 {
25   asection *section;
26   bfd_byte *data;
27   bfd_vma offset;
28   bfd_vma pc;
29   /* For output */
30   file_ptr current_pos;
31   unsigned int current_byte;
32   boolean initialized;
33   ieee_reloc_type **reloc_tail_ptr;
34 } ieee_per_section_type;
35
36 #define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd))
37 #define NSECTIONS 10
38
39   
40
41 typedef struct {
42   boolean read_symbols;
43   boolean read_data;    
44 unsigned  char *input_p;
45 unsigned char *first_byte;
46   file_ptr output_cursor;
47   /* Map of section indexes to section ptrs */
48   asection * section_table[NSECTIONS];
49   ieee_address_descriptor_type ad;
50   ieee_module_begin_type mb;
51   ieee_w_variable_type w;
52
53   unsigned int section_count;
54   struct obstack ieee_obstack;
55
56
57   unsigned int map_idx;
58   /* List of GLOBAL EXPORT symbols */
59   ieee_symbol_type *external_symbols;
60   /* List of UNDEFINED symbols */
61   ieee_symbol_type *external_reference;
62
63   /* When the symbols have been canonicalized, they are in a
64    * special order, we remember various bases here.. */
65   unsigned int external_symbol_max_index;
66   unsigned int external_symbol_min_index;
67   unsigned int external_symbol_count;
68   int external_symbol_base_offset;
69
70   unsigned int external_reference_max_index;
71   unsigned int external_reference_min_index;
72   unsigned int external_reference_count;
73   int external_reference_base_offset;
74
75
76   boolean symbol_table_full;
77 } ieee_data_type;
78
79 typedef struct {
80   file_ptr file_offset;
81   bfd *abfd;
82 } ieee_ar_obstack_type;
83
84 typedef struct {
85   ieee_ar_obstack_type *elements;
86   struct  obstack element_obstack;
87   unsigned  int element_index ;
88   unsigned int element_count;
89 } ieee_ar_data_type;
90 #define ieee_data(abfd) ((ieee_data_type *)((abfd)->tdata))
91 #define ieee_ar_data(abfd) ((ieee_ar_data_type *)((abfd)->arelt_data))
92
93
94 #define ptr(abfd) (ieee_data(abfd)->input_p)