1 /* HP PA-RISC SOM object file format: definitions internal to BFD.
2 Copyright (C) 1990-1991 Free Software Foundation, Inc.
4 Contributed by the Center for Software Science at the
5 University of Utah (pa-gdb-bugs@cs.utah.edu).
7 This file is part of BFD, the Binary File Descriptor library.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
24 #include <sys/utsname.h>
26 #define BYTES_IN_WORD 4
29 struct som_exec_auxhdr;
30 struct subspace_dictionary;
32 #define FILE_HDR_SIZE sizeof(struct header)
33 #define AUX_HDR_SIZE sizeof(struct som_exec_auxhdr)
35 typedef struct hppa_symbol
45 struct header *file_hdr;
46 struct som_exec_auxhdr *aux_hdr;
47 hppa_symbol_type *symbols;
49 /* We remember these offsets so that after check_file_format, we have
50 no dependencies on the particular format of the exec_hdr. */
55 unsigned stringtab_size;
57 /* Size of a symbol table entry in external form */
58 unsigned hp_symbol_entry_size;
61 struct hppa_data_struct {
65 #define padata(bfd) ((bfd)->tdata.hppa_data->a)
66 #define obj_file_hdr(bfd) (padata(bfd).file_hdr)
67 #define obj_aux_hdr(bfd) (padata(bfd).aux_hdr)
68 #define obj_pa_symbols(bfd) (padata(bfd).symbols)
69 #define obj_sym_filepos(bfd) (padata(bfd).sym_filepos)
70 #define obj_str_filepos(bfd) (padata(bfd).str_filepos)
71 #define obj_stringtab_size(bfd) (padata(bfd).stringtab_size)
73 /* We take the address of the first element of an asymbol to ensure that the
74 macro is only ever applied to an asymbol */
75 #define hppa_symbol(asymbol) ((hppa_symbol_type *)(&(asymbol)->the_bfd))
78 /* These are stored in the bfd's tdata */
80 struct hppa_core_struct
83 char cmd[MAXCOMLEN + 1];
84 asection *data_section;
85 asection *stack_section;
86 asection *reg_section;
89 #define core_hdr(bfd) ((bfd)->tdata.hppa_core_data)
90 #define core_signal(bfd) (core_hdr(bfd)->sig)
91 #define core_command(bfd) (core_hdr(bfd)->cmd)
92 #define core_datasec(bfd) (core_hdr(bfd)->data_section)
93 #define core_stacksec(bfd) (core_hdr(bfd)->stack_section)
94 #define core_regsec(bfd) (core_hdr(bfd)->reg_section)
96 /* HP PA-RISC relocation types */
98 enum hppa_reloc_field_selector_type
109 R_HPPA_PSEL = 0x9, /* P' : procedure address for shlib's */
110 R_HPPA_LPSEL = 0xa, /* LP' : L' for procedure addresses */
111 R_HPPA_RPSEL = 0xb, /* RP' : R' for procedure addresses */
113 R_HPPA_TSEL = 0xc, /* T' : DLT-relative offset for shlib's */
114 R_HPPA_LTSEL = 0xd, /* LT' : L' for DLT-relative offsets */
115 R_HPPA_RTSEL = 0xe /* RT' : R' for DLT-relative offsets */
119 /* for compatibility */
120 enum hppa_reloc_field_selector_type_alt
122 e_fsel = R_HPPA_FSEL,
123 e_lssel = R_HPPA_LSSEL,
124 e_rssel = R_HPPA_RSSEL,
125 e_lsel = R_HPPA_LSEL,
126 e_rsel = R_HPPA_RSEL,
127 e_ldsel = R_HPPA_LDSEL,
128 e_rdsel = R_HPPA_RDSEL,
129 e_lrsel = R_HPPA_LRSEL,
130 e_rrsel = R_HPPA_RRSEL,
131 e_psel = R_HPPA_PSEL, /* P' : procedure address for shlib's */
132 e_lpsel = R_HPPA_LPSEL, /* LP' : L' for procedure addresses */
133 e_rpsel = R_HPPA_RPSEL, /* RP' : R' for procedure addresses */
135 e_tsel = R_HPPA_TSEL, /* T' : DLT-relative offset for shlib's */
136 e_ltsel = R_HPPA_LTSEL, /* LT' : L' for DLT-relative offsets */
137 e_rtsel = R_HPPA_RTSEL /* RT' : R' for DLT-relative offsets */
140 enum hppa_reloc_expr_type
150 /* for compatibility */
151 enum hppa_reloc_expr_type_alt
153 e_one = R_HPPA_E_ONE,
154 e_two = R_HPPA_E_TWO,
155 e_pcrel = R_HPPA_E_PCREL,
156 e_con = R_HPPA_E_CON,
157 e_plabel = R_HPPA_E_PLABEL,