1 /* 2 * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 package sun.jvm.hotspot.debugger.win32.coff; 26 27 /** Enumerates the types of COFF object file relocations for all 28 currently-supported processors. (Some of the descriptions are 29 taken directly from Microsoft's documentation and are copyrighted 30 by Microsoft.) */ 31 32 public interface TypeIndicators { 33 // 34 // I386 processors 35 // 36 37 /** This relocation is ignored. */ 38 public static final short IMAGE_REL_I386_ABSOLUTE = 0x0000; 39 /** Not supported. */ 40 public static final short IMAGE_REL_I386_DIR16 = (short) 0x0001; 41 /** Not supported. */ 42 public static final short IMAGE_REL_I386_REL16 = (short) 0x0002; 43 /** The target?s 32-bit virtual address. */ 44 public static final short IMAGE_REL_I386_DIR32 = (short) 0x0006; 45 /** The target?s 32-bit relative virtual address. */ 46 public static final short IMAGE_REL_I386_DIR32NB = (short) 0x0007; 47 /** Not supported. */ 48 public static final short IMAGE_REL_I386_SEG12 = (short) 0x0009; 49 /** The 16-bit-section index of the section containing the 50 target. This is used to support debugging information. */ 51 public static final short IMAGE_REL_I386_SECTION = (short) 0x000A; 52 /** The 32-bit offset of the target from the beginning of its 53 section. This is used to support debugging information as well 54 as static thread local storage. */ 55 public static final short IMAGE_REL_I386_SECREL = (short) 0x000B; 56 /** The 32-bit relative displacement to the target. This supports 57 the x86 relative branch and call instructions. */ 58 public static final short IMAGE_REL_I386_REL32 = (short) 0x0014; 59 60 // 61 // MIPS processors 62 // 63 64 /** This relocation is ignored. */ 65 public static final short IMAGE_REL_MIPS_ABSOLUTE = (short) 0x0000; 66 /** The high 16 bits of the target's 32-bit virtual address. */ 67 public static final short IMAGE_REL_MIPS_REFHALF = (short) 0x0001; 68 /** The target's 32-bit virtual address. */ 69 public static final short IMAGE_REL_MIPS_REFWORD = (short) 0x0002; 70 /** The low 26 bits of the target's virtual address. This 71 supports the MIPS J and JAL instructions. */ 72 public static final short IMAGE_REL_MIPS_JMPADDR = (short) 0x0003; 73 /** The high 16 bits of the target's 32-bit virtual address. Used 74 for the first instruction in a two-instruction sequence that 75 loads a full address. This relocation must be immediately 76 followed by a PAIR relocations whose SymbolTableIndex contains a 77 signed 16-bit displacement which is added to the upper 16 bits 78 taken from the location being relocated. */ 79 public static final short IMAGE_REL_MIPS_REFHI = (short) 0x0004; 80 /** The low 16 bits of the target's virtual address. */ 81 public static final short IMAGE_REL_MIPS_REFLO = (short) 0x0005; 82 /** 16-bit signed displacement of the target relative to the Global 83 Pointer (GP) register. */ 84 public static final short IMAGE_REL_MIPS_GPREL = (short) 0x0006; 85 /** Same as IMAGE_REL_MIPS_GPREL. */ 86 public static final short IMAGE_REL_MIPS_LITERAL = (short) 0x0007; 87 /** The 16-bit section index of the section containing the target. 88 This is used to support debugging information. */ 89 public static final short IMAGE_REL_MIPS_SECTION = (short) 0x000A; 90 /** The 32-bit offset of the target from the beginning of its 91 section. This is used to support debugging information as well 92 as static thread local storage. */ 93 public static final short IMAGE_REL_MIPS_SECREL = (short) 0x000B; 94 /** The low 16 bits of the 32-bit offset of the target from the 95 beginning of its section. */ 96 public static final short IMAGE_REL_MIPS_SECRELLO = (short) 0x000C; 97 /** The high 16 bits of the 32-bit offset of the target from the 98 beginning of its section. A PAIR relocation must immediately 99 follow this on. The SymbolTableIndex of the PAIR relocation 100 contains a signed 16-bit displacement, which is added to the 101 upper 16 bits taken from the location being relocated. */ 102 public static final short IMAGE_REL_MIPS_SECRELHI = (short) 0x000D; 103 /** The low 26 bits of the target's virtual address. This supports 104 the MIPS16 JAL instruction. */ 105 public static final short IMAGE_REL_MIPS_JMPADDR16 = (short) 0x0010; 106 /** The target's 32-bit relative virtual address. */ 107 public static final short IMAGE_REL_MIPS_REFWORDNB = (short) 0x0022; 108 /** This relocation is only valid when it immediately follows a 109 REFHI or SECRELHI relocation. Its SymbolTableIndex contains a 110 displacement and not an index into the symbol table. */ 111 public static final short IMAGE_REL_MIPS_PAIR = (short) 0x0025; 112 113 // 114 // Alpha processors 115 // 116 117 /** This relocation is ignored. */ 118 public static final short IMAGE_REL_ALPHA_ABSOLUTE = (short) 0x0000; 119 /** The target's 32-bit virtual address. This fixup is illegal in a 120 PE32+ image unless the image has been sandboxed by clearing the 121 IMAGE_FILE_LARGE_ADDRESS_AWARE bit in the File Header. */ 122 public static final short IMAGE_REL_ALPHA_REFLONG = (short) 0x0001; 123 /** The target's 64-bit virtual address. */ 124 public static final short IMAGE_REL_ALPHA_REFQUAD = (short) 0x0002; 125 /** 32-bit signed displacement of the target relative to the Global 126 Pointer (GP) register. */ 127 public static final short IMAGE_REL_ALPHA_GPREL32 = (short) 0x0003; 128 /** 16-bit signed displacement of the target relative to the Global 129 Pointer (GP) register. */ 130 public static final short IMAGE_REL_ALPHA_LITERAL = (short) 0x0004; 131 /** Reserved for future use. */ 132 public static final short IMAGE_REL_ALPHA_LITUSE = (short) 0x0005; 133 /** Reserved for future use. */ 134 public static final short IMAGE_REL_ALPHA_GPDISP = (short) 0x0006; 135 /** The 21-bit relative displacement to the target. This supports 136 the Alpha relative branch instructions. */ 137 public static final short IMAGE_REL_ALPHA_BRADDR = (short) 0x0007; 138 /** 14-bit hints to the processor for the target of an Alpha jump 139 instruction. */ 140 public static final short IMAGE_REL_ALPHA_HINT = (short) 0x0008; 141 /** The target's 32-bit virtual address split into high and low 142 16-bit parts. Either an ABSOLUTE or MATCH relocation must 143 immediately follow this relocation. The high 16 bits of the 144 target address are stored in the location identified by the 145 INLINE_REFLONG relocation. The low 16 bits are stored four bytes 146 later if the following relocation is of type ABSOLUTE or at a 147 signed displacement given in the SymbolTableIndex if the 148 following relocation is of type MATCH. */ 149 public static final short IMAGE_REL_ALPHA_INLINE_REFLONG = (short) 0x0009; 150 /** The high 16 bits of the target's 32-bit virtual address. Used 151 for the first instruction in a two-instruction sequence that 152 loads a full address. This relocation must be immediately 153 followed by a PAIR relocations whose SymbolTableIndex contains a 154 signed 16-bit displacement which is added to the upper 16 bits 155 taken from the location being relocated. */ 156 public static final short IMAGE_REL_ALPHA_REFHI = (short) 0x000A; 157 /** The low 16 bits of the target's virtual address. */ 158 public static final short IMAGE_REL_ALPHA_REFLO = (short) 0x000B; 159 /** This relocation is only valid when it immediately follows a 160 REFHI , REFQ3, REFQ2, or SECRELHI relocation. Its 161 SymbolTableIndex contains a displacement and not an index into 162 the symbol table. */ 163 public static final short IMAGE_REL_ALPHA_PAIR = (short) 0x000C; 164 /** This relocation is only valid when it immediately follows 165 INLINE_REFLONG relocation. Its SymbolTableIndex contains the 166 displacement in bytes of the location for the matching low 167 address and not an index into the symbol table. */ 168 public static final short IMAGE_REL_ALPHA_MATCH = (short) 0x000D; 169 /** The 16-bit section index of the section containing the target. 170 This is used to support debugging information. */ 171 public static final short IMAGE_REL_ALPHA_SECTION = (short) 0x000E; 172 /** The 32-bit offset of the target from the beginning of its 173 section. This is used to support debugging information as well 174 as static thread local storage. */ 175 public static final short IMAGE_REL_ALPHA_SECREL = (short) 0x000F; 176 /** The target's 32-bit relative virtual address. */ 177 public static final short IMAGE_REL_ALPHA_REFLONGNB = (short) 0x0010; 178 /** The low 16 bits of the 32-bit offset of the target from the 179 beginning of its section. */ 180 public static final short IMAGE_REL_ALPHA_SECRELLO = (short) 0x0011; 181 /** The high 16 bits of the 32-bit offset of the target from the 182 beginning of its section. A PAIR relocation must immediately 183 follow this on. The SymbolTableIndex of the PAIR relocation 184 contains a signed 16-bit displacement which is added to the 185 upper 16 bits taken from the location being relocated. */ 186 public static final short IMAGE_REL_ALPHA_SECRELHI = (short) 0x0012; 187 /** The low 16 bits of the high 32 bits of the target's 64-bit 188 virtual address. This relocation must be immediately followed by 189 a PAIR relocations whose SymbolTableIndex contains a signed 190 32-bit displacement which is added to the 16 bits taken from the 191 location being relocated. The 16 bits in the relocated location 192 are shifted left by 32 before this addition. */ 193 public static final short IMAGE_REL_ALPHA_REFQ3 = (short) 0x0013; 194 /** The high 16 bits of the low 32 bits of the target's 64-bit 195 virtual address. This relocation must be immediately followed by 196 a PAIR relocations whose SymbolTableIndex contains a signed 197 16-bit displacement which is added to the upper 16 bits taken 198 from the location being relocated. */ 199 public static final short IMAGE_REL_ALPHA_REFQ2 = (short) 0x0014; 200 /** The low 16 bits of the target's 64-bit virtual address. */ 201 public static final short IMAGE_REL_ALPHA_REFQ1 = (short) 0x0015; 202 /** The low 16 bits of the 32-bit signed displacement of the target 203 relative to the Global Pointer (GP) register. */ 204 public static final short IMAGE_REL_ALPHA_GPRELLO = (short) 0x0016; 205 /** The high 16 bits of the 32-bit signed displacement of the target 206 relative to the Global Pointer (GP) register. */ 207 public static final short IMAGE_REL_ALPHA_GPRELHI = (short) 0x0017; 208 209 // 210 // PowerPC processors 211 // 212 213 /** This relocation is ignored. */ 214 public static final short IMAGE_REL_PPC_ABSOLUTE = (short) 0x0000; 215 /** The target's 64-bit virtual address. */ 216 public static final short IMAGE_REL_PPC_ADDR64 = (short) 0x0001; 217 /** The target's 32-bit virtual address. */ 218 public static final short IMAGE_REL_PPC_ADDR32 = (short) 0x0002; 219 /** The low 24 bits of the target's virtual address. This is only 220 valid when the target symbol is absolute and can be sign 221 extended to its original value. */ 222 public static final short IMAGE_REL_PPC_ADDR24 = (short) 0x0003; 223 /** The low 16 bits of the target's virtual address. */ 224 public static final short IMAGE_REL_PPC_ADDR16 = (short) 0x0004; 225 /** The low 14 bits of the target's virtual address. This is only 226 valid when the target symbol is absolute and can be sign 227 extended to its original value. */ 228 public static final short IMAGE_REL_PPC_ADDR14 = (short) 0x0005; 229 /** A 24-bit PC-relative offset to the symbol's location. */ 230 public static final short IMAGE_REL_PPC_REL24 = (short) 0x0006; 231 /** A 14-bit PC-relative offset to the symbol's location. */ 232 public static final short IMAGE_REL_PPC_REL14 = (short) 0x0007; 233 /** The target's 32-bit relative virtual address. */ 234 public static final short IMAGE_REL_PPC_ADDR32NB = (short) 0x000A; 235 /** The 32-bit offset of the target from the beginning of its 236 section. This is used to support debugging information as well 237 as static thread local storage. */ 238 public static final short IMAGE_REL_PPC_SECREL = (short) 0x000B; 239 /** The 16-bit section index of the section containing the target. 240 This is used to support debugging information. */ 241 public static final short IMAGE_REL_PPC_SECTION = (short) 0x000C; 242 /** The 16-bit offset of the target from the beginning of its 243 section. This is used to support debugging information as well 244 as static thread local storage. */ 245 public static final short IMAGE_REL_PPC_SECREL16 = (short) 0x000F; 246 /** The high 16 bits of the target's 32-bit virtual address. Used 247 for the first instruction in a two-instruction sequence that 248 loads a full address. This relocation must be immediately 249 followed by a PAIR relocations whose SymbolTableIndex contains a 250 signed 16-bit displacement which is added to the upper 16 bits 251 taken from the location being relocated. */ 252 public static final short IMAGE_REL_PPC_REFHI = (short) 0x0010; 253 /** The low 16 bits of the target's virtual address. */ 254 public static final short IMAGE_REL_PPC_REFLO = (short) 0x0011; 255 /** This relocation is only valid when it immediately follows a 256 REFHI or SECRELHI relocation. Its SymbolTableIndex contains a 257 displacement and not an index into the symbol table. */ 258 public static final short IMAGE_REL_PPC_PAIR = (short) 0x0012; 259 /** The low 16 bits of the 32-bit offset of the target from the 260 beginning of its section. */ 261 public static final short IMAGE_REL_PPC_SECRELLO = (short) 0x0013; 262 /** The high 16 bits of the 32-bit offset of the target from the 263 beginning of its section. A PAIR relocation must immediately 264 follow this on. The SymbolTableIndex of the PAIR relocation 265 contains a signed 16-bit displacement which is added to the 266 upper 16 bits taken from the location being relocated. */ 267 public static final short IMAGE_REL_PPC_SECRELHI = (short) 0x0014; 268 /** 16-bit signed displacement of the target relative to the Global 269 Pointer (GP) register. */ 270 public static final short IMAGE_REL_PPC_GPREL = (short) 0x0015; 271 272 // 273 // SH3 and SH4 processors 274 // 275 276 /** This relocation is ignored. */ 277 public static final short IMAGE_REL_SH3_ABSOLUTE = (short) 0x0000; 278 /** Reference to the 16-bit location that contains the virtual 279 address of the target symbol. */ 280 public static final short IMAGE_REL_SH3_DIRECT16 = (short) 0x0001; 281 /** The target's 32-bit virtual address. */ 282 public static final short IMAGE_REL_SH3_DIRECT32 = (short) 0x0002; 283 /** Reference to the 8-bit location that contains the virtual 284 address of the target symbol. */ 285 public static final short IMAGE_REL_SH3_DIRECT8 = (short) 0x0003; 286 /** Reference to the 8-bit instruction that contains the effective 287 16-bit virtual address of the target symbol. */ 288 public static final short IMAGE_REL_SH3_DIRECT8_WORD = (short) 0x0004; 289 /** Reference to the 8-bit instruction that contains the effective 290 32-bit virtual address of the target symbol. */ 291 public static final short IMAGE_REL_SH3_DIRECT8_LONG = (short) 0x0005; 292 /** Reference to the 8-bit location whose low 4 bits contain the 293 virtual address of the target symbol. */ 294 public static final short IMAGE_REL_SH3_DIRECT4 = (short) 0x0006; 295 /** Reference to the 8-bit instruction whose low 4 bits contain the 296 effective 16-bit virtual address of the target symbol. */ 297 public static final short IMAGE_REL_SH3_DIRECT4_WORD = (short) 0x0007; 298 /** Reference to the 8-bit instruction whose low 4 bits contain the 299 effective 32-bit virtual address of the target symbol. */ 300 public static final short IMAGE_REL_SH3_DIRECT4_LONG = (short) 0x0008; 301 /** Reference to the 8-bit instruction which contains the effective 302 16-bit relative offset of the target symbol. */ 303 public static final short IMAGE_REL_SH3_PCREL8_WORD = (short) 0x0009; 304 /** Reference to the 8-bit instruction which contains the effective 305 32-bit relative offset of the target symbol. */ 306 public static final short IMAGE_REL_SH3_PCREL8_LONG = (short) 0x000A; 307 /** Reference to the 16-bit instruction whose low 12 bits contain 308 the effective 16-bit relative offset of the target symbol. */ 309 public static final short IMAGE_REL_SH3_PCREL12_WORD = (short) 0x000B; 310 /** Reference to a 32-bit location that is the virtual address of 311 the symbol's section. */ 312 public static final short IMAGE_REL_SH3_STARTOF_SECTION = (short) 0x000C; 313 /** Reference to the 32-bit location that is the size of the 314 symbol's section. */ 315 public static final short IMAGE_REL_SH3_SIZEOF_SECTION = (short) 0x000D; 316 /** The 16-bit section index of the section containing the target. 317 This is used to support debugging information. */ 318 public static final short IMAGE_REL_SH3_SECTION = (short) 0x000E; 319 /** The 32-bit offset of the target from the beginning of its 320 section. This is used to support debugging information as well 321 as static thread local storage. */ 322 public static final short IMAGE_REL_SH3_SECREL = (short) 0x000F; 323 /** The target's 32-bit relative virtual address. */ 324 public static final short IMAGE_REL_SH3_DIRECT32_NB = (short) 0x0010; 325 326 // 327 // ARM processors 328 // 329 330 /** This relocation is ignored. */ 331 public static final short IMAGE_REL_ARM_ABSOLUTE = (short) 0x0000; 332 /** The target's 32-bit virtual address. */ 333 public static final short IMAGE_REL_ARM_ADDR32 = (short) 0x0001; 334 /** The target's 32-bit relative virtual address. */ 335 public static final short IMAGE_REL_ARM_ADDR32NB = (short) 0x0002; 336 /** The 24-bit relative displacement to the target. */ 337 public static final short IMAGE_REL_ARM_BRANCH24 = (short) 0x0003; 338 /** Reference to a subroutine call, consisting of two 16-bit 339 instructions with 11-bit offsets. */ 340 public static final short IMAGE_REL_ARM_BRANCH11 = (short) 0x0004; 341 /** The 16-bit section index of the section containing the target. 342 This is used to support debugging information. */ 343 public static final short IMAGE_REL_ARM_SECTION = (short) 0x000E; 344 /** The 32-bit offset of the target from the beginning of its 345 section. This is used to support debugging information as well 346 as static thread local storage. */ 347 public static final short IMAGE_REL_ARM_SECREL = (short) 0x000F; 348 } 349