Finally fixed long-standing reloc bug.

committer: mfx <mfx> 1080194776 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2004-03-25 06:06:16 +00:00
parent 81e77a8b2b
commit e06722d121

View File

@ -1779,7 +1779,7 @@ void PackW32Pe::pack(OutputFile *fo)
patch_le32(loader,codesize + 4,"JMPO",ih.entry - upxsection - jmp_pos - 4);
}
if (big_relocs & 6)
patch_le32(loader,codesize,"DELT", rvamin - ih.imagebase);
patch_le32(loader,codesize,"DELT", 0u - (unsigned) ih.imagebase - rvamin);
if (sorelocs && (soimport == 0 || soimport + cimports != crelocs))
patch_le32(loader,codesize,"BREL",crelocs);
if (soimport)
@ -1819,7 +1819,7 @@ void PackW32Pe::pack(OutputFile *fo)
}
const unsigned esi0 = s1addr + ic;
patch_le32(loader,codesize,"EDI0", rvamin - esi0);
patch_le32(loader,codesize,"EDI0", 0u - esi0 + rvamin);
patch_le32(loader,codesize,"ESI0", esi0 + ih.imagebase);
ic = getLoaderSection("PEMAIN01") + 2 + upxsection;