Mon Dec 21 12:40:10 1992 Ian Lance Taylor (ian@cygnus.com)
[deliverable/binutils-gdb.git] / bfd / libhppa.h
CommitLineData
76c7e44d
SG
1/* HP PA-RISC SOM object file format: definitions internal to BFD.
2 Copyright (C) 1990-1991 Free Software Foundation, Inc.
3
4 Contributed by the Center for Software Science at the
5 University of Utah (pa-gdb-bugs@cs.utah.edu).
6
7This file is part of BFD, the Binary File Descriptor library.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22
23#define BYTES_IN_WORD 4
24
25struct header;
26struct som_exec_auxhdr;
27struct subspace_dictionary;
28
29
30
31#define FILE_HDR_SIZE sizeof(struct header)
32#define AUX_HDR_SIZE sizeof(struct som_exec_auxhdr)
33
34unsigned int millicode_start, millicode_end;
35
36struct nlist {
37 union {
38 char *n_name;
39 struct nlist *n_next;
40 long n_strx;
41 } n_un;
42 unsigned char n_type;
43 char n_other;
44 short n_desc;
45 unsigned long n_value;
46};
47
48typedef struct hppa_symbol
49{
50 asymbol symbol;
51 short desc;
52 char other;
53 unsigned char type;
54} hppa_symbol_type;
55
56struct hppadata
57{
58 struct header *file_hdr;
59 struct som_exec_auxhdr *aux_hdr;
60 hppa_symbol_type *symbols;
61
62 /* For ease, we do this */
63 asection *textsec;
64 asection *datasec;
65 asection *bsssec;
66
67 /* We remember these offsets so that after check_file_format, we have
68 no dependencies on the particular format of the exec_hdr. */
69 file_ptr dbx_sym_filepos;
70 file_ptr dbx_str_filepos;
71
72 file_ptr hp_sym_filepos;
73 file_ptr hp_str_filepos;
74
75 int dbx_sym_count;
76 int hp_sym_count;
77
78 unsigned dbx_stringtab_size;
79 unsigned hp_stringtab_size;
80
81 /* Size of a symbol table entry in external form */
82 unsigned dbx_symbol_entry_size;
83 unsigned hp_symbol_entry_size;
84};
85
86struct hppa_data_struct {
87 struct hppadata a;
88};
89
90
91#define padata(bfd) ((bfd)->tdata.hppa_data->a)
92#define obj_file_hdr(bfd) (padata(bfd).file_hdr)
93#define obj_aux_hdr(bfd) (padata(bfd).aux_hdr)
94#define obj_pa_symbols(bfd) (padata(bfd).symbols)
95#define obj_textsec(bfd) (padata(bfd).textsec)
96#define obj_datasec(bfd) (padata(bfd).datasec)
97#define obj_bsssec(bfd) (padata(bfd).bsssec)
98#define obj_dbx_sym_filepos(bfd) (padata(bfd).dbx_sym_filepos)
99#define obj_dbx_str_filepos(bfd) (padata(bfd).dbx_str_filepos)
100#define obj_hp_sym_filepos(bfd) (padata(bfd).hp_sym_filepos)
101#define obj_hp_str_filepos(bfd) (padata(bfd).hp_str_filepos)
102#define obj_dbx_sym_count(bfd) (padata(bfd).dbx_sym_count)
103#define obj_hp_sym_count(bfd) (padata(bfd).hp_sym_count)
104#define obj_dbx_stringtab_size(bfd) (padata(bfd).dbx_stringtab_size)
105#define obj_hp_stringtab_size(bfd) (padata(bfd).hp_stringtab_size)
106#define obj_dbx_symbol_entry_size(bfd) (padata(bfd).dbx_symbol_entry_size)
107#define obj_hp_symbol_entry_size(bfd) (padata(bfd).hp_symbol_entry_size)
108
109/* We take the address of the first element of an asymbol to ensure that the
110 macro is only ever applied to an asymbol */
111#define hppa_symbol(asymbol) ((hppa_symbol_type *)(&(asymbol)->the_bfd))
112
113
114/* These are stored in the bfd's tdata */
115struct hppa_core_struct
116{
117 struct hpuxuser *upage;
118 asection *data_section;
119 asection *stack_section;
120 asection *reg_section;
121};
122
123
124#define core_upage(bfd) ((bfd)->tdata.hppa_core_data->upage)
125#define core_datasec(bfd) ((bfd)->tdata.hppa_core_data->data_section)
126#define core_stacksec(bfd) ((bfd)->tdata.hppa_core_data->stack_section)
127#define core_regsec(bfd) ((bfd)->tdata.hppa_core_data->reg_section)
This page took 0.026956 seconds and 4 git commands to generate.