Steven Wallace provided a program which broke this stuff. I guess there are

more weird kinds of a.out than anyone can argue for.  This code failed to
load the first 28K of the text-segment, in the case where the first page
of the a.out contains only the a.out-header, and the text is still at 0x0.
Thanks Steven !
This commit is contained in:
Poul-Henning Kamp 1994-10-06 18:22:24 +00:00
parent 9949ebf656
commit c3a82ca0a6

View File

@ -7,7 +7,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $Id: imgact_gzip.c,v 1.4 1994/10/04 06:51:42 phk Exp $
* $Id: imgact_gzip.c,v 1.5 1994/10/05 00:58:33 phk Exp $
*
* This module handles execution of a.out files which have been run through
* "gzip -9".
@ -389,6 +389,13 @@ Flush(struct gzip *gz,u_long siz)
}
}
}
/* Skip over zero-padded first PAGE if needed */
if(gz->output < gz->file_offset && (gz->output+siz) > gz->file_offset) {
i = min(siz, gz->file_offset - gz->output);
gz->output += i;
p += i;
siz -= i;
}
if(gz->output >= gz->file_offset && gz->output < gz->file_end) {
i = min(siz, gz->file_end - gz->output);
q = (u_char*) gz->virtual_offset + gz->output - gz->file_offset;