Skip to content

Commit b2cb4bc

Browse files
committed
add base reloc constants
1 parent 74bcedc commit b2cb4bc

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/pe/relocation.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,42 @@ pub const IMAGE_REL_IA64_GPREL32: u16 = 0x001C;
218218
/// Offset with an addend
219219
pub const IMAGE_REL_IA64_ADDEND: u16 = 0x001F;
220220

221+
// base relocation.
222+
223+
// IMAGE_REL_BASED constants for relocation types
224+
/// Absolute relocation. No modification is necessary.
225+
pub const IMAGE_REL_BASED_ABSOLUTE: u16 = 0;
226+
/// Relocation based on the high 16 bits of the address.
227+
pub const IMAGE_REL_BASED_HIGH: u16 = 1;
228+
/// Relocation based on the low 16 bits of the address.
229+
pub const IMAGE_REL_BASED_LOW: u16 = 2;
230+
/// Relocation based on the entire 32-bit address.
231+
pub const IMAGE_REL_BASED_HIGHLOW: u16 = 3;
232+
/// Relocation based on the adjusted high 16 bits of the address.
233+
pub const IMAGE_REL_BASED_HIGHADJ: u16 = 4;
234+
/// MIPS jump address relocation.
235+
pub const IMAGE_REL_BASED_MIPS_JMPADDR: u16 = 5;
236+
/// ARM MOV32A relocation (shares the same value as MIPS_JMPADDR).
237+
pub const IMAGE_REL_BASED_ARM_MOV32A: u16 = 5;
238+
/// ARM MOV32 relocation (shares the same value as MIPS_JMPADDR).
239+
pub const IMAGE_REL_BASED_ARM_MOV32: u16 = 5;
240+
/// Relocation based on the section.
241+
pub const IMAGE_REL_BASED_SECTION: u16 = 6;
242+
/// Relocation relative to the base.
243+
pub const IMAGE_REL_BASED_REL: u16 = 7;
244+
/// ARM MOV32T relocation (shares the same value as REL).
245+
pub const IMAGE_REL_BASED_ARM_MOV32T: u16 = 7;
246+
/// Thumb MOV32 relocation (shares the same value as REL).
247+
pub const IMAGE_REL_BASED_THUMB_MOV32: u16 = 7;
248+
/// MIPS 16-bit jump address relocation.
249+
pub const IMAGE_REL_BASED_MIPS_JMPADDR16: u16 = 9;
250+
/// IA64 immediate 64-bit relocation (shares the same value as MIPS_JMPADDR16).
251+
pub const IMAGE_REL_BASED_IA64_IMM64: u16 = 9;
252+
/// Relocation based on a 64-bit address.
253+
pub const IMAGE_REL_BASED_DIR64: u16 = 10;
254+
/// Relocation based on the top 16 bits of a 48-bit address.
255+
pub const IMAGE_REL_BASED_HIGH3ADJ: u16 = 11;
256+
221257
/// A COFF relocation.
222258
#[repr(C)]
223259
#[derive(Debug, Copy, Clone, PartialEq, Default, Pread, Pwrite, IOread, IOwrite, SizeWith)]

0 commit comments

Comments
 (0)