PE: Fix stripped relocation handling
This commit is contained in:
committed by
Markus F.X.J. Oberhumer
parent
966b571b7c
commit
cc100be26e
+4
-1
@@ -2316,6 +2316,9 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
|
|||||||
if (IDSIZE(PEDIR_SEC))
|
if (IDSIZE(PEDIR_SEC))
|
||||||
IDSIZE(PEDIR_SEC) = IDADDR(PEDIR_SEC) = 0;
|
IDSIZE(PEDIR_SEC) = IDADDR(PEDIR_SEC) = 0;
|
||||||
|
|
||||||
|
if (ih.flags & RELOCS_STRIPPED)
|
||||||
|
opt->win32_pe.strip_relocs = true;
|
||||||
|
else
|
||||||
ih.flags |= handleStripRelocs(ih.imagebase, default_imagebase, ih.dllflags);
|
ih.flags |= handleStripRelocs(ih.imagebase, default_imagebase, ih.dllflags);
|
||||||
|
|
||||||
handleStub(fi,fo,pe_offset);
|
handleStub(fi,fo,pe_offset);
|
||||||
@@ -2568,7 +2571,7 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
|
|||||||
// this one is tricky: it seems windoze touches 4 bytes after
|
// this one is tricky: it seems windoze touches 4 bytes after
|
||||||
// the end of the relocation data - so we have to increase
|
// the end of the relocation data - so we have to increase
|
||||||
// the virtual size of this section
|
// the virtual size of this section
|
||||||
const unsigned ncsize_virt_increase = (ncsize & oam1) == 0 ? 8 : 0;
|
const unsigned ncsize_virt_increase = soxrelocs && (ncsize & oam1) == 0 ? 8 : 0;
|
||||||
|
|
||||||
// fill the sections
|
// fill the sections
|
||||||
strcpy(osection[0].name,"UPX0");
|
strcpy(osection[0].name,"UPX0");
|
||||||
|
|||||||
Reference in New Issue
Block a user