Renamed method.

This commit is contained in:
Markus F.X.J. Oberhumer
2006-06-22 16:00:03 +02:00
parent 392f283d9e
commit d7592f01e1
3 changed files with 9 additions and 9 deletions
+1 -2
View File
@@ -300,8 +300,7 @@ void PackDjgpp2::pack(OutputFile *fo)
text->size = lsize; // new size of .text text->size = lsize; // new size of .text
data->size = ph.c_len; // new size of .data data->size = ph.c_len; // new size of .data
unsigned stack = 1024 + ph.overlap_overhead + unsigned stack = 1024 + ph.overlap_overhead + getDecompressorWrkmemSize();
patchDecompressorGetExtraStacksize();
stack = ALIGN_UP(stack, 16); stack = ALIGN_UP(stack, 16);
if (bss->size < stack) // give it a .bss if (bss->size < stack) // give it a .bss
bss->size = stack; bss->size = stack;
+1 -1
View File
@@ -224,8 +224,8 @@ protected:
const int *getDefaultCompressionMethods_8(int method, int level, int small=-1) const; const int *getDefaultCompressionMethods_8(int method, int level, int small=-1) const;
const int *getDefaultCompressionMethods_le32(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 const char *getDecompressorSections() const;
virtual unsigned getDecompressorWrkmemSize() const;
virtual void patchDecompressor(void *, int); virtual void patchDecompressor(void *, int);
virtual unsigned patchDecompressorGetExtraStacksize();
// filter handling [see packer_f.cpp] // filter handling [see packer_f.cpp]
virtual bool isValidFilter(int filter_id) const; virtual bool isValidFilter(int filter_id) const;
+7 -6
View File
@@ -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) if (ph.method == M_LZMA)
{ {
const lzma_compress_result_t *res = &ph.compress_result.result_lzma; const lzma_compress_result_t *res = &ph.compress_result.result_lzma;
// FIXME - this is for i386 only // FIXME - this is for i386 only
stack = 8 + 4 + ALIGN_UP(2 * res->num_probs, 4); size = 8 + 4 + ALIGN_UP(2 * res->num_probs, 4);
stack = ALIGN_UP(stack, 16); 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, "UPXd", properties);
patch_le32(loader, lsize, "UPXc", ph.c_len - 1); patch_le32(loader, lsize, "UPXc", ph.c_len - 1);
patch_le32(loader, lsize, "UPXb", ph.u_len); patch_le32(loader, lsize, "UPXb", ph.u_len);
unsigned stack = patchDecompressorGetExtraStacksize(); unsigned stack = getDecompressorWrkmemSize();
patch_le32(loader, lsize, "UPXa", 0u - stack); patch_le32(loader, lsize, "UPXa", 0u - stack);
} }
} }