From 770e9c0c75a943cd4d47ba3cb3be936d09a6c86f Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sat, 24 Jan 2026 01:24:25 -0500 Subject: Implement DTPOFF64 and DTPMOD64 relocations. Finally closes #5463. --- arch/x86/arch_x86.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arch') diff --git a/arch/x86/arch_x86.cpp b/arch/x86/arch_x86.cpp index f639040e..af3f4901 100644 --- a/arch/x86/arch_x86.cpp +++ b/arch/x86/arch_x86.cpp @@ -4416,6 +4416,16 @@ public: memcpy(dest, (uint8_t*)&write, sizeof(uint64_t)); return true; } + case R_X86_64_DTPMOD64: { + uint64_t write = 0; + memcpy(dest, (uint8_t*)&write, sizeof(uint64_t)); + return true; + } + case R_X86_64_DTPOFF64: { + uint64_t write = reloc->GetTarget() + info.addend; + memcpy(dest, (uint8_t*)&write, sizeof(uint64_t)); + return true; + } default: return RelocationHandler::ApplyRelocation(view, arch, reloc, dest, len); } @@ -4509,6 +4519,21 @@ public: reloc.size = 8; reloc.truncateSize = 8; break; + case R_X86_64_DTPMOD64: + reloc.pcRelative = false; + reloc.baseRelative = false; + reloc.hasSign = false; + reloc.size = 8; + reloc.truncateSize = 8; + reloc.symbolIndex = 0; + break; + case R_X86_64_DTPOFF64: + reloc.pcRelative = false; + reloc.baseRelative = false; + reloc.hasSign = false; + reloc.size = 8; + reloc.truncateSize = 8; + break; case R_X86_64_GOTOFF64: case R_X86_64_GOT64: case R_X86_64_GOTPLT64: -- cgit v1.3.1