Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | /* HPPA ELF support for BFD. |
2 | Copyright (C) 1993, 1994 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of BFD, the Binary File Descriptor library. | |
5 | ||
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. | |
10 | ||
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. | |
15 | ||
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. */ | |
19 | ||
20 | /* This file holds definitions specific to the HPPA ELF ABI. Note | |
21 | that most of this is not actually implemented by BFD. */ | |
22 | ||
23 | #ifndef _ELF_HPPA_H | |
24 | #define _ELF_HPPA_H | |
25 | ||
26 | /* Processor specific flags for the ELF header e_flags field. */ | |
27 | ||
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. */ | |
31 | ||
32 | /* PA 1.0 big endian. */ | |
33 | #ifndef CPU_PA_RISC1_0 | |
34 | #define CPU_PA_RISC1_0 0x0000020b | |
35 | #endif | |
36 | ||
37 | /* PA 1.1 big endian. */ | |
38 | #ifndef CPU_PA_RISC1_1 | |
39 | #define CPU_PA_RISC1_1 0x00000210 | |
40 | #endif | |
41 | ||
42 | /* PA 1.0 little endian (unsupported) is 0x0000028b. */ | |
43 | /* PA 1.1 little endian (unsupported) is 0x00000290. */ | |
44 | ||
45 | /* Trap null address dereferences. */ | |
46 | #define ELF_PARISC_TRAPNIL 0x00010000 | |
47 | ||
48 | /* .PARISC.archext section is present. */ | |
49 | #define EF_PARISC_EXT 0x00020000 | |
50 | ||
51 | /* Processor specific section types. */ | |
52 | ||
53 | /* Holds the global offset table, a table of pointers to external | |
54 | data. */ | |
55 | #define SHT_PARISC_GOT SHT_LOPROC+0 | |
56 | ||
57 | /* Nonloadable section containing information in architecture | |
58 | extensions used by the code. */ | |
59 | #define SHT_PARISC_ARCH SHT_LOPROC+1 | |
60 | ||
61 | /* Section in which $global$ is defined. */ | |
62 | #define SHT_PARISC_GLOBAL SHT_LOPROC+2 | |
63 | ||
64 | /* Section holding millicode routines (mul, div, rem, dyncall, etc. */ | |
65 | #define SHT_PARISC_MILLI SHT_LOPROC+3 | |
66 | ||
67 | /* Section holding unwind information for use by debuggers. */ | |
68 | #define SHT_PARISC_UNWIND SHT_LOPROC+4 | |
69 | ||
70 | /* Section holding the procedure linkage table. */ | |
71 | #define SHT_PARISC_PLT SHT_LOPROC+5 | |
72 | ||
73 | /* Short initialized and uninitialized data. */ | |
74 | #define SHT_PARISC_SDATA SHT_LOPROC+6 | |
75 | #define SHT_PARISC_SBSS SHT_LOPROC+7 | |
76 | ||
77 | /* Optional section holding argument location/relocation info. */ | |
78 | #define SHT_PARISC_SYMEXTN SHT_LOPROC+8 | |
79 | ||
80 | /* Option section for linker stubs. */ | |
81 | #define SHT_PARISC_STUBS SHT_LOPROC+9 | |
82 | ||
83 | /* Processor specific section flags. */ | |
84 | ||
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 | |
88 | ||
89 | /* Processor specific symbol types. */ | |
90 | ||
91 | /* Millicode function entry point. */ | |
92 | #define STT_PARISC_MILLICODE STT_LOPROC+0 | |
93 | ||
94 | ||
95 | /* ELF/HPPA relocation types */ | |
96 | ||
97 | #include "reloc-macros.h" | |
98 | ||
99 | START_RELOC_NUMBERS (elf32_hppa_reloc_type) | |
100 | RELOC_NUMBER (R_PARISC_NONE, 0) /* No reloc */ | |
101 | ||
102 | /* These relocation types do simple base + offset relocations. */ | |
103 | ||
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) | |
109 | ||
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. | |
114 | ||
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. | |
119 | ||
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. */ | |
123 | ||
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) | |
130 | ||
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) | |
135 | ||
136 | /* Data linkage table (DLT) relocation types | |
137 | ||
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. */ | |
141 | ||
142 | RELOC_NUMBER (R_PARISC_DLTREL21L, 0x1a) | |
143 | RELOC_NUMBER (R_PARISC_DLTREL14R, 0x1e) | |
144 | RELOC_NUMBER (R_PARISC_DLTREL14F, 0x1f) | |
145 | ||
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) | |
150 | ||
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) | |
159 | ||
160 | /* Segment relative relocation types. */ | |
161 | RELOC_NUMBER (R_PARISC_TEXTREL32, 0x31) | |
162 | RELOC_NUMBER (R_PARISC_DATAREL32, 0x39) | |
163 | ||
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) | |
168 | ||
169 | /* PLT relocations. */ | |
170 | RELOC_NUMBER (R_PARISC_PLTIND21L, 0x82) | |
171 | RELOC_NUMBER (R_PARISC_PLTIND14R, 0x86) | |
172 | RELOC_NUMBER (R_PARISC_PLTIND14F, 0x87) | |
173 | ||
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) | |
179 | ||
180 | EMPTY_RELOC (R_PARISC_UNIMPLEMENTED) | |
181 | END_RELOC_NUMBERS | |
182 | ||
183 | #ifndef RELOC_MACROS_GEN_FUNC | |
184 | typedef enum elf32_hppa_reloc_type elf32_hppa_reloc_type; | |
185 | #endif | |
186 | ||
187 | #endif /* _ELF_HPPA_H */ |