src/pefile.cpp: support relocs of large files

Use 5-byte entries instead of 4-byte entries to fully preserve "pos".

And add some symbolic constants.

Partially based on a patch by John.
This commit is contained in:
Markus F.X.J. Oberhumer
2024-03-22 00:46:17 +01:00
parent a21a006fe9
commit 9b80628f84
3 changed files with 92 additions and 66 deletions
+15
View File
@@ -356,6 +356,21 @@ protected:
RT_LAST
};
enum {
IMAGE_REL_BASED_ABSOLUTE = 0, // this relocation is ignored
IMAGE_REL_BASED_IGNORE = 0, // (unofficial name)
IMAGE_REL_BASED_HIGH = 1,
IMAGE_REL_BASED_LOW = 2,
IMAGE_REL_BASED_HIGHLOW = 3,
IMAGE_REL_BASED_HIGHADJ = 4,
IMAGE_REL_BASED_MIPS_JMPADDR = 5,
IMAGE_REL_BASED_ARM_MOV32 = 5,
IMAGE_REL_BASED_THUMB_MOV32 = 7,
IMAGE_REL_BASED_MIPS_JMPADDR16 = 9,
IMAGE_REL_BASED_IA64_IMM64 = 9,
IMAGE_REL_BASED_DIR64 = 10,
};
class Interval final : private noncopyable {
unsigned capacity = 0;
void *base = nullptr;