xref: /openbsd-src/gnu/usr.bin/binutils/bfd/liboasys.h (revision c074d1c999f3e07019cd5e9a2f190b057ef3b935)
12159047fSniklas /* BFD internal declarations for Oasys file format handling.
2*c074d1c9Sdrahn    Copyright 1990, 1991, 1992, 1993, 1994, 1997, 2002
3b55d4692Sfgsch    Free Software Foundation, Inc.
42159047fSniklas    Scrawled by Steve Chamberlain of Cygnus Support.
52159047fSniklas 
62159047fSniklas This file is part of BFD, the Binary File Descriptor library.
72159047fSniklas 
82159047fSniklas This program is free software; you can redistribute it and/or modify
92159047fSniklas it under the terms of the GNU General Public License as published by
102159047fSniklas the Free Software Foundation; either version 2 of the License, or
112159047fSniklas (at your option) any later version.
122159047fSniklas 
132159047fSniklas This program is distributed in the hope that it will be useful,
142159047fSniklas but WITHOUT ANY WARRANTY; without even the implied warranty of
152159047fSniklas MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
162159047fSniklas GNU General Public License for more details.
172159047fSniklas 
182159047fSniklas You should have received a copy of the GNU General Public License
192159047fSniklas along with this program; if not, write to the Free Software
202159047fSniklas Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
212159047fSniklas 
222159047fSniklas typedef struct _oasys_symbol
232159047fSniklas {
242159047fSniklas   asymbol symbol;
252159047fSniklas } oasys_symbol_type;
262159047fSniklas 
272159047fSniklas typedef struct _oasys_reloc {
282159047fSniklas   arelent relent;
292159047fSniklas   struct _oasys_reloc *next;
302159047fSniklas   unsigned int symbol;
312159047fSniklas } oasys_reloc_type;
322159047fSniklas 
332159047fSniklas 
342159047fSniklas #define oasys_symbol(x) ((oasys_symbol_type *)(x))
352159047fSniklas #define oasys_per_section(x) ((oasys_per_section_type *)(x->used_by_bfd))
362159047fSniklas 
372159047fSniklas typedef struct _oasys_per_section
382159047fSniklas {
392159047fSniklas   asection *section;
402159047fSniklas   bfd_byte *data;
412159047fSniklas   bfd_vma offset;
42*c074d1c9Sdrahn   bfd_boolean had_vma;
432159047fSniklas   oasys_reloc_type **reloc_tail_ptr;
442159047fSniklas   bfd_vma pc;
452159047fSniklas 
462159047fSniklas 
472159047fSniklas   file_ptr current_pos;
482159047fSniklas   unsigned int current_byte;
49*c074d1c9Sdrahn   bfd_boolean initialized;
502159047fSniklas } oasys_per_section_type;
512159047fSniklas 
522159047fSniklas #define NSECTIONS 10
532159047fSniklas 
542159047fSniklas typedef struct _oasys_ar_obstack {
552159047fSniklas   file_ptr file_offset;
562159047fSniklas   bfd *abfd;
572159047fSniklas } oasys_ar_obstack_type;
582159047fSniklas 
592159047fSniklas 
602159047fSniklas typedef struct _oasys_module_info {
612159047fSniklas   file_ptr pos;
622159047fSniklas   unsigned int size;
632159047fSniklas   bfd *abfd;
642159047fSniklas   char *name;
652159047fSniklas } oasys_module_info_type;
662159047fSniklas 
672159047fSniklas typedef struct _oasys_ar_data {
682159047fSniklas   oasys_module_info_type *module;
692159047fSniklas   unsigned int module_count;
702159047fSniklas   unsigned int module_index;
712159047fSniklas } oasys_ar_data_type;
722159047fSniklas 
732159047fSniklas typedef struct _oasys_data {
742159047fSniklas   char *strings;
752159047fSniklas   asymbol *symbols;
762159047fSniklas   unsigned int symbol_string_length;
772159047fSniklas   asection *sections[OASYS_MAX_SEC_COUNT];
782159047fSniklas   file_ptr first_data_record;
792159047fSniklas } oasys_data_type;
802159047fSniklas 
812159047fSniklas #define OASYS_DATA(abfd)	((abfd)->tdata.oasys_obj_data)
822159047fSniklas #define OASYS_AR_DATA(abfd)	((abfd)->tdata.oasys_ar_data)
832159047fSniklas 
84