133965Sjdp/* IEEE-695 object file formats:  definitions internal to BFD.
2130561Sobrien   Copyright 1990, 1991, 1992, 1994, 1996, 2001, 2002
389857Sobrien   Free Software Foundation, Inc.
433965Sjdp   Written by Cygnus Support.  Mostly Steve Chamberlain's fault.
533965Sjdp
633965SjdpThis file is part of BFD, the Binary File Descriptor library.
733965Sjdp
833965SjdpThis program is free software; you can redistribute it and/or modify
933965Sjdpit under the terms of the GNU General Public License as published by
1033965Sjdpthe Free Software Foundation; either version 2 of the License, or
1133965Sjdp(at your option) any later version.
1233965Sjdp
1333965SjdpThis program is distributed in the hope that it will be useful,
1433965Sjdpbut WITHOUT ANY WARRANTY; without even the implied warranty of
1533965SjdpMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1633965SjdpGNU General Public License for more details.
1733965Sjdp
1833965SjdpYou should have received a copy of the GNU General Public License
1933965Sjdpalong with this program; if not, write to the Free Software
20218822SdimFoundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2133965Sjdp
2233965Sjdptypedef struct {
2333965Sjdp  unsigned int index:24;
2433965Sjdp  char letter;
2533965Sjdp} ieee_symbol_index_type;
2633965Sjdp
2733965Sjdptypedef struct ct {
2833965Sjdp  bfd *this;
2933965Sjdp  struct ct *next;
3033965Sjdp} bfd_chain_type;
3133965Sjdp
3289857Sobrientypedef struct ieee_symbol
3333965Sjdp{
3433965Sjdp  asymbol symbol;
3533965Sjdp  struct ieee_symbol *next;
3633965Sjdp
3733965Sjdp  unsigned int index;
3833965Sjdp} ieee_symbol_type;
3933965Sjdp
4033965Sjdp
4133965Sjdptypedef struct ieee_reloc {
4233965Sjdp  arelent relent;
4333965Sjdp  struct ieee_reloc *next;
4433965Sjdp  ieee_symbol_index_type symbol;
4533965Sjdp
4633965Sjdp} ieee_reloc_type;
4733965Sjdp
4833965Sjdp#define ieee_symbol(x) ((ieee_symbol_type *)(x))
4933965Sjdp
5033965Sjdptypedef struct ieee_per_section
5133965Sjdp{
5233965Sjdp  asection *section;
5333965Sjdp  bfd_byte *data;
5433965Sjdp  bfd_vma offset;
5533965Sjdp  bfd_vma pc;
5633965Sjdp  /* For output */
5733965Sjdp  file_ptr current_pos;
5833965Sjdp  unsigned int current_byte;
59130561Sobrien  bfd_boolean initialized;
6033965Sjdp  ieee_reloc_type **reloc_tail_ptr;
6133965Sjdp} ieee_per_section_type;
6233965Sjdp
6333965Sjdp#define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd))
6489857Sobrien
6533965Sjdptypedef struct {
6689857Sobrien  unsigned char *input_p;
6733965Sjdp  unsigned char *first_byte;
6889857Sobrien  unsigned char *last_byte;
6933965Sjdp  bfd *abfd;
7033965Sjdp} common_header_type ;
7133965Sjdp
7233965Sjdptypedef struct ieee_data_struct
7333965Sjdp{
7433965Sjdp  common_header_type h;
75130561Sobrien  bfd_boolean read_symbols;
76130561Sobrien  bfd_boolean read_data;
7733965Sjdp  file_ptr output_cursor;
7833965Sjdp  /* Map of section indexes to section ptrs */
7933965Sjdp  asection **section_table;
8033965Sjdp  unsigned int section_table_size;
8133965Sjdp  ieee_address_descriptor_type ad;
8233965Sjdp  ieee_module_begin_type mb;
8333965Sjdp  ieee_w_variable_type w;
8489857Sobrien
8533965Sjdp  unsigned int section_count;
8689857Sobrien
8733965Sjdp  unsigned int map_idx;
8833965Sjdp  /* List of GLOBAL EXPORT symbols */
8933965Sjdp  ieee_symbol_type *external_symbols;
9033965Sjdp  /* List of UNDEFINED symbols */
9133965Sjdp  ieee_symbol_type *external_reference;
9289857Sobrien
9333965Sjdp  /* When the symbols have been canonicalized, they are in a
9433965Sjdp    * special order, we remember various bases here.. */
9533965Sjdp  unsigned int external_symbol_max_index;
9633965Sjdp  unsigned int external_symbol_min_index;
9733965Sjdp  unsigned int external_symbol_count;
9833965Sjdp  int external_symbol_base_offset;
9989857Sobrien
10033965Sjdp  unsigned int external_reference_max_index;
10133965Sjdp  unsigned int external_reference_min_index;
10233965Sjdp  unsigned int external_reference_count;
10333965Sjdp  int external_reference_base_offset;
10433965Sjdp
10589857Sobrien
106130561Sobrien  bfd_boolean symbol_table_full;
10733965Sjdp
10889857Sobrien
109130561Sobrienbfd_boolean done_debug;
11033965Sjdp
11133965Sjdp
11233965Sjdpbfd_chain_type *chain_head;
11333965Sjdpbfd_chain_type *chain_root;
11433965Sjdp
11533965Sjdp} ieee_data_type;
11633965Sjdp
11733965Sjdptypedef struct {
11833965Sjdp  file_ptr file_offset;
11933965Sjdp  bfd *abfd;
12033965Sjdp} ieee_ar_obstack_type;
12133965Sjdp
12289857Sobrientypedef struct ieee_ar_data_struct
12333965Sjdp{
12433965Sjdp  common_header_type h;
12533965Sjdp  ieee_ar_obstack_type *elements;
12689857Sobrien
12733965Sjdp  unsigned  int element_index ;
12833965Sjdp  unsigned int element_count;
12933965Sjdp
13033965Sjdp} ieee_ar_data_type;
13133965Sjdp
13233965Sjdp#define IEEE_DATA(abfd) ((abfd)->tdata.ieee_data)
13333965Sjdp#define IEEE_AR_DATA(abfd) ((abfd)->tdata.ieee_ar_data)
13433965Sjdp
13533965Sjdp#define ptr(abfd) (ieee_data(abfd)->input_p)
136