From 8d23df86bfe5f75461c30da25f76358a345581aa Mon Sep 17 00:00:00 2001 From: karutoh Date: Thu, 15 Feb 2024 01:01:46 -0800 Subject: [PATCH] Fixed potential bug with program fileSize field. --- src/ELF64.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ELF64.cpp b/src/ELF64.cpp index f5648fc..fc2b3a7 100644 --- a/src/ELF64.cpp +++ b/src/ELF64.cpp @@ -235,8 +235,7 @@ ehs::Serializer ELF64::Serialize() const if (sections[i].programIndex < EHS_UINT_16_MAX + 1) { sections[i].vAddr = programs[entryPoint].pAddr + result.GetOffset() + programsSize + segmentOffset; - programs[sections[i].programIndex].fileSize = - result.GetOffset() + programsSize + segmentOffset + segmentData[i].Size(); + programs[sections[i].programIndex].fileSize = segmentData[i].Size(); } segmentOffset += segmentData[i].Size();