Set blocksize in canPack().

committer: mfx <mfx> 1036984678 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2002-11-11 03:17:58 +00:00
parent c0cccd6196
commit d7e795a731

View File

@ -152,7 +152,13 @@ bool PackLinuxI386elf::canPack()
}
}
return super::canPack();
if (!super::canPack())
return false;
assert(exetype == 1);
// set options
opt->unix.blocksize = blocksize = file_size;
return true;
}
void PackLinuxI386elf::packExtent(
@ -176,7 +182,7 @@ void PackLinuxI386elf::packExtent(
// file is e.g. blocksize + 1 bytes long
// compress
ph.u_len = l;
ph.c_len = ph.u_len = l;
ph.overlap_overhead = 0;
unsigned end_u_adler = 0;
if (ft) {
@ -241,11 +247,6 @@ void PackLinuxI386elf::packExtent(
void PackLinuxI386elf::pack1(OutputFile *fo, Filter &)
{
// set options
opt->unix.blocksize = blocksize = file_size;
ibuf.dealloc();
ibuf.alloc(blocksize);
fi->seek(0, SEEK_SET);
fi->readx(&ehdri, sizeof(ehdri));
assert(ehdri.e_phoff == sizeof(Elf_LE32_Ehdr)); // checked by canPack()