Initial revision
[binutils.git] / include / elf / hppa.h
blob2952e2398d290076cf4b5678d2767d53de551a18
1 /* HPPA ELF support for BFD.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20 /* This file holds definitions specific to the HPPA ELF ABI. Note
21 that most of this is not actually implemented by BFD. */
23 #ifndef _ELF_HPPA_H
24 #define _ELF_HPPA_H
26 /* Processor specific flags for the ELF header e_flags field. */
28 /* Target processor IDs to be placed in the low 16 bits of the flags
29 field. Note these names are shared with SOM, and therefore do not
30 follow ELF naming conventions. */
32 /* PA 1.0 big endian. */
33 #ifndef CPU_PA_RISC1_0
34 #define CPU_PA_RISC1_0 0x0000020b
35 #endif
37 /* PA 1.1 big endian. */
38 #ifndef CPU_PA_RISC1_1
39 #define CPU_PA_RISC1_1 0x00000210
40 #endif
42 /* PA 1.0 little endian (unsupported) is 0x0000028b. */
43 /* PA 1.1 little endian (unsupported) is 0x00000290. */
45 /* Trap null address dereferences. */
46 #define ELF_PARISC_TRAPNIL 0x00010000
48 /* .PARISC.archext section is present. */
49 #define EF_PARISC_EXT 0x00020000
51 /* Processor specific section types. */
53 /* Holds the global offset table, a table of pointers to external
54 data. */
55 #define SHT_PARISC_GOT SHT_LOPROC+0
57 /* Nonloadable section containing information in architecture
58 extensions used by the code. */
59 #define SHT_PARISC_ARCH SHT_LOPROC+1
61 /* Section in which $global$ is defined. */
62 #define SHT_PARISC_GLOBAL SHT_LOPROC+2
64 /* Section holding millicode routines (mul, div, rem, dyncall, etc. */
65 #define SHT_PARISC_MILLI SHT_LOPROC+3
67 /* Section holding unwind information for use by debuggers. */
68 #define SHT_PARISC_UNWIND SHT_LOPROC+4
70 /* Section holding the procedure linkage table. */
71 #define SHT_PARISC_PLT SHT_LOPROC+5
73 /* Short initialized and uninitialized data. */
74 #define SHT_PARISC_SDATA SHT_LOPROC+6
75 #define SHT_PARISC_SBSS SHT_LOPROC+7
77 /* Optional section holding argument location/relocation info. */
78 #define SHT_PARISC_SYMEXTN SHT_LOPROC+8
80 /* Option section for linker stubs. */
81 #define SHT_PARISC_STUBS SHT_LOPROC+9
83 /* Processor specific section flags. */
85 /* This section is near the global data pointer and thus allows short
86 addressing modes to be used. */
87 #define SHF_PARISC_SHORT 0x20000000
89 /* Processor specific symbol types. */
91 /* Millicode function entry point. */
92 #define STT_PARISC_MILLICODE STT_LOPROC+0
95 /* ELF/HPPA relocation types */
97 #include "reloc-macros.h"
99 START_RELOC_NUMBERS (elf32_hppa_reloc_type)
100 RELOC_NUMBER (R_PARISC_NONE, 0) /* No reloc */
102 /* These relocation types do simple base + offset relocations. */
104 RELOC_NUMBER (R_PARISC_DIR32, 0x01)
105 RELOC_NUMBER (R_PARISC_DIR21L, 0x02)
106 RELOC_NUMBER (R_PARISC_DIR17R, 0x03)
107 RELOC_NUMBER (R_PARISC_DIR17F, 0x04)
108 RELOC_NUMBER (R_PARISC_DIR14R, 0x06)
110 /* PC-relative relocation types
111 Typically used for calls.
112 Note PCREL17C and PCREL17F differ only in overflow handling.
113 PCREL17C never reports a relocation error.
115 When supporting argument relocations, function calls must be
116 accompanied by parameter relocation information. This information is
117 carried in the ten high-order bits of the addend field. The remaining
118 22 bits of of the addend field are sign-extended to form the Addend.
120 Note the code to build argument relocations depends on the
121 addend being zero. A consequence of this limitation is GAS
122 can not perform relocation reductions for function symbols. */
124 RELOC_NUMBER (R_PARISC_PCREL21L, 0x0a)
125 RELOC_NUMBER (R_PARISC_PCREL17R, 0x0b)
126 RELOC_NUMBER (R_PARISC_PCREL17F, 0x0c)
127 RELOC_NUMBER (R_PARISC_PCREL17C, 0x0d)
128 RELOC_NUMBER (R_PARISC_PCREL14R, 0x0e)
129 RELOC_NUMBER (R_PARISC_PCREL14F, 0x0f)
131 /* DP-relative relocation types. */
132 RELOC_NUMBER (R_PARISC_DPREL21L, 0x12)
133 RELOC_NUMBER (R_PARISC_DPREL14R, 0x16)
134 RELOC_NUMBER (R_PARISC_DPREL14F, 0x17)
136 /* Data linkage table (DLT) relocation types
138 SOM DLT_REL fixup requests are used to for static data references
139 from position-independent code within shared libraries. They are
140 similar to the GOT relocation types in some SVR4 implementations. */
142 RELOC_NUMBER (R_PARISC_DLTREL21L, 0x1a)
143 RELOC_NUMBER (R_PARISC_DLTREL14R, 0x1e)
144 RELOC_NUMBER (R_PARISC_DLTREL14F, 0x1f)
146 /* DLT indirect relocation types */
147 RELOC_NUMBER (R_PARISC_DLTIND21L, 0x22)
148 RELOC_NUMBER (R_PARISC_DLTIND14R, 0x26)
149 RELOC_NUMBER (R_PARISC_DLTIND14F, 0x27)
151 /* Base relative relocation types. Ugh. These imply lots of state */
152 RELOC_NUMBER (R_PARISC_SETBASE, 0x28)
153 RELOC_NUMBER (R_PARISC_BASEREL32, 0x29)
154 RELOC_NUMBER (R_PARISC_BASEREL21L, 0x2a)
155 RELOC_NUMBER (R_PARISC_BASEREL17R, 0x2b)
156 RELOC_NUMBER (R_PARISC_BASEREL17F, 0x2c)
157 RELOC_NUMBER (R_PARISC_BASEREL14R, 0x2e)
158 RELOC_NUMBER (R_PARISC_BASEREL14F, 0x2f)
160 /* Segment relative relocation types. */
161 RELOC_NUMBER (R_PARISC_TEXTREL32, 0x31)
162 RELOC_NUMBER (R_PARISC_DATAREL32, 0x39)
164 /* Plabel relocation types. */
165 RELOC_NUMBER (R_PARISC_PLABEL32, 0x41)
166 RELOC_NUMBER (R_PARISC_PLABEL21L, 0x42)
167 RELOC_NUMBER (R_PARISC_PLABEL14R, 0x46)
169 /* PLT relocations. */
170 RELOC_NUMBER (R_PARISC_PLTIND21L, 0x82)
171 RELOC_NUMBER (R_PARISC_PLTIND14R, 0x86)
172 RELOC_NUMBER (R_PARISC_PLTIND14F, 0x87)
174 /* Misc relocation types. */
175 RELOC_NUMBER (R_PARISC_COPY, 0x88)
176 RELOC_NUMBER (R_PARISC_GLOB_DAT, 0x89)
177 RELOC_NUMBER (R_PARISC_JMP_SLOT, 0x8a)
178 RELOC_NUMBER (R_PARISC_RELATIVE, 0x8b)
180 EMPTY_RELOC (R_PARISC_UNIMPLEMENTED)
181 END_RELOC_NUMBERS
183 #ifndef RELOC_MACROS_GEN_FUNC
184 typedef enum elf32_hppa_reloc_type elf32_hppa_reloc_type;
185 #endif
187 #endif /* _ELF_HPPA_H */