Renamed method.
This commit is contained in:
parent
392f283d9e
commit
d7592f01e1
@ -300,8 +300,7 @@ void PackDjgpp2::pack(OutputFile *fo)
|
||||
text->size = lsize; // new size of .text
|
||||
data->size = ph.c_len; // new size of .data
|
||||
|
||||
unsigned stack = 1024 + ph.overlap_overhead +
|
||||
patchDecompressorGetExtraStacksize();
|
||||
unsigned stack = 1024 + ph.overlap_overhead + getDecompressorWrkmemSize();
|
||||
stack = ALIGN_UP(stack, 16);
|
||||
if (bss->size < stack) // give it a .bss
|
||||
bss->size = stack;
|
||||
|
||||
@ -224,8 +224,8 @@ protected:
|
||||
const int *getDefaultCompressionMethods_8(int method, int level, int small=-1) const;
|
||||
const int *getDefaultCompressionMethods_le32(int method, int level, int small=-1) const;
|
||||
virtual const char *getDecompressorSections() const;
|
||||
virtual unsigned getDecompressorWrkmemSize() const;
|
||||
virtual void patchDecompressor(void *, int);
|
||||
virtual unsigned patchDecompressorGetExtraStacksize();
|
||||
|
||||
// filter handling [see packer_f.cpp]
|
||||
virtual bool isValidFilter(int filter_id) const;
|
||||
|
||||
@ -208,17 +208,18 @@ const char *Packer::getDecompressorSections() const
|
||||
}
|
||||
|
||||
|
||||
unsigned Packer::patchDecompressorGetExtraStacksize()
|
||||
unsigned Packer::getDecompressorWrkmemSize() const
|
||||
{
|
||||
unsigned stack = 0;
|
||||
unsigned size = 0;
|
||||
if (ph.method == M_LZMA)
|
||||
{
|
||||
const lzma_compress_result_t *res = &ph.compress_result.result_lzma;
|
||||
// FIXME - this is for i386 only
|
||||
stack = 8 + 4 + ALIGN_UP(2 * res->num_probs, 4);
|
||||
stack = ALIGN_UP(stack, 16);
|
||||
size = 8 + 4 + ALIGN_UP(2 * res->num_probs, 4);
|
||||
size = ALIGN_UP(size, 16);
|
||||
}
|
||||
return stack;
|
||||
assert((int)size >= 0);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +236,7 @@ void Packer::patchDecompressor(void *loader, int lsize)
|
||||
patch_le32(loader, lsize, "UPXd", properties);
|
||||
patch_le32(loader, lsize, "UPXc", ph.c_len - 1);
|
||||
patch_le32(loader, lsize, "UPXb", ph.u_len);
|
||||
unsigned stack = patchDecompressorGetExtraStacksize();
|
||||
unsigned stack = getDecompressorWrkmemSize();
|
||||
patch_le32(loader, lsize, "UPXa", 0u - stack);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user