diff options
| author | Alexander Taylor <alex@vector35.com> | 2026-01-23 02:18:19 -0500 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2026-01-23 10:35:46 -0500 |
| commit | 19ea371012f127727a947e144bb7701ca145c135 (patch) | |
| tree | fd26078f12a1b9e168d538e1d5f22cd413151d96 /arch/x86 | |
| parent | c52958ee4e31f8c61737cf7d240b0906bcf70ee0 (diff) | |
Add missing x86_64 relocations.
Diffstat (limited to 'arch/x86')
| -rw-r--r-- | arch/x86/arch_x86.cpp | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/arch/x86/arch_x86.cpp b/arch/x86/arch_x86.cpp index 22bab67d..3d50b020 100644 --- a/arch/x86/arch_x86.cpp +++ b/arch/x86/arch_x86.cpp @@ -87,11 +87,11 @@ enum Elfx64RelocationType : uint32_t R_X86_64_PC64 = 24, R_X86_64_GOTOFF64 = 25, R_X86_64_GOTPC32 = 26, - R_X86_64_UNKNOWN27 = 27, - R_X86_64_UNKNOWN28 = 28, - R_X86_64_UNKNOWN29 = 29, - R_X86_64_UNKNOWN30 = 30, - R_X86_64_UNKNOWN31 = 31, + R_X86_64_GOT64 = 27, + R_X86_64_GOTPCREL64 = 28, + R_X86_64_GOTPC64 = 29, + R_X86_64_GOTPLT64 = 30, + R_X86_64_PLTOFF64 = 31, R_X86_64_SIZE32 = 32, R_X86_64_SIZE64 = 33, R_X86_64_GOTPC32_TLSDESC = 34, @@ -355,11 +355,11 @@ static const char* GetRelocationString(Elfx64RelocationType relocType) "R_X86_64_PC64", "R_X86_64_GOTOFF64", "R_X86_64_GOTPC32", - "R_X86_64_UNKNOWN27", - "R_X86_64_UNKNOWN28", - "R_X86_64_UNKNOWN29", - "R_X86_64_UNKNOWN30", - "R_X86_64_UNKNOWN31", + "R_X86_64_GOT64", + "R_X86_64_GOTPCREL64", + "R_X86_64_GOTPC64", + "R_X86_64_GOTPLT64", + "R_X86_64_PLTOFF64", "R_X86_64_SIZE32", "R_X86_64_SIZE64", "R_X86_64_GOTPC32_TLSDESC", @@ -4424,6 +4424,16 @@ public: reloc.size = 8; reloc.truncateSize = 8; break; + case R_X86_64_GOTOFF64: + case R_X86_64_GOT64: + case R_X86_64_GOTPLT64: + case R_X86_64_PLTOFF64: + reloc.pcRelative = false; + reloc.baseRelative = false; + reloc.hasSign = false; + reloc.size = 8; + reloc.truncateSize = 8; + break; case R_X86_64_PC32: case R_X86_64_PLT32: case R_X86_64_GOTPCREL: @@ -4443,6 +4453,14 @@ public: reloc.size = 8; reloc.truncateSize = 8; break; + case R_X86_64_GOTPCREL64: + case R_X86_64_GOTPC64: + reloc.pcRelative = true; + reloc.baseRelative = false; + reloc.hasSign = false; + reloc.size = 8; + reloc.truncateSize = 8; + break; case R_X86_64_REX_GOTPCRELX: // The 3 bytes before the immediate that specify the registers and operand // encoding are variable!!! Example: 49c7c400000000 vs 4c8b25d5140000 |
