Always call buildLoader() directly after compress().
committer: mfx <mfx> 978181874 +0000
This commit is contained in:
parent
8ce23f15e8
commit
c0bbc2216e
@ -271,7 +271,6 @@ void PackDjgpp2::pack(OutputFile *fo)
|
||||
// filter
|
||||
Filter ft(opt->level);
|
||||
tryFilters(&ft, ibuf, usize - data->size, text->vaddr & ~0x1ff);
|
||||
buildLoader(&ft);
|
||||
|
||||
// compress
|
||||
ph.filter = ft.id;
|
||||
@ -279,6 +278,7 @@ void PackDjgpp2::pack(OutputFile *fo)
|
||||
ph.u_len = usize;
|
||||
if (!compress(ibuf,obuf))
|
||||
throwNotCompressible();
|
||||
buildLoader(&ft);
|
||||
|
||||
unsigned overlapoh = findOverlapOverhead(obuf,ibuf,512);
|
||||
overlapoh = (overlapoh + 0x3ff) & ~0x1ff;
|
||||
|
||||
@ -212,13 +212,13 @@ void PackTmt::pack(OutputFile *fo)
|
||||
// filter
|
||||
Filter ft(opt->level);
|
||||
tryFilters(&ft, ibuf, usize);
|
||||
buildLoader(&ft);
|
||||
|
||||
ph.filter = ft.id;
|
||||
ph.filter_cto = ft.cto;
|
||||
ph.u_len = usize + relocsize;
|
||||
if (!compress(ibuf,obuf))
|
||||
throwNotCompressible();
|
||||
buildLoader(&ft);
|
||||
|
||||
unsigned overlapoh = findOverlapOverhead(obuf,512);
|
||||
|
||||
|
||||
@ -1619,13 +1619,14 @@ void PackW32Pe::pack(OutputFile *fo)
|
||||
Filter ft(opt->level);
|
||||
if (allow_filter)
|
||||
tryFilters(&ft, ibuf + ih.codebase, ih.codesize);
|
||||
buildLoader(&ft);
|
||||
|
||||
// compress
|
||||
ph.filter = ft.id;
|
||||
ph.filter_cto = ft.cto;
|
||||
if (!compress(ibuf + rvamin,obuf))
|
||||
throwNotCompressible();
|
||||
buildLoader(&ft);
|
||||
|
||||
const unsigned overlapoh = findOverlapOverhead(obuf, 2048);
|
||||
|
||||
// verify filter
|
||||
|
||||
@ -421,6 +421,8 @@ void PackWcle::encodeImage(const Filter *ft)
|
||||
// reserve RESERVED bytes for the decompressor
|
||||
if (!compress(ibuf,oimage+RESERVED))
|
||||
throwNotCompressible();
|
||||
buildLoader(ft);
|
||||
|
||||
overlapoh = findOverlapOverhead(oimage+RESERVED, 512);
|
||||
ibuf.free();
|
||||
soimage = (ph.c_len + 3) &~ 3;
|
||||
@ -463,11 +465,6 @@ void PackWcle::pack(OutputFile *fo)
|
||||
const unsigned text_size = IOT(ih.init_cs_object-1,npages) * mps;
|
||||
const unsigned text_vaddr = IOT(ih.init_cs_object-1,my_base_address);
|
||||
|
||||
// filter
|
||||
Filter ft(opt->level);
|
||||
tryFilters(&ft, iimage+text_vaddr, text_size, text_vaddr);
|
||||
buildLoader(&ft);
|
||||
|
||||
// attach some useful data at the end of preprocessed fixups
|
||||
ifixups[sofixups++] = (unsigned char) ih.automatic_data_object;
|
||||
unsigned ic = objects*sizeof(*iobject_table);
|
||||
@ -481,6 +478,10 @@ void PackWcle::pack(OutputFile *fo)
|
||||
ifixups[sofixups+12] = (unsigned char) objects;
|
||||
sofixups += 13;
|
||||
|
||||
// filter
|
||||
Filter ft(opt->level);
|
||||
tryFilters(&ft, iimage+text_vaddr, text_size, text_vaddr);
|
||||
|
||||
encodeImage(&ft);
|
||||
|
||||
// verify filter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user