From d7e795a7318f8d750ac49d630f7096d5043743b8 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 11 Nov 2002 03:17:58 +0000 Subject: [PATCH] Set blocksize in canPack(). committer: mfx 1036984678 +0000 --- src/p_lx_elf.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index c55be0cf..64e07a19 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -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()