Section LZMA_ELF00 saves time (but no space) by not clearing CProb[].

This commit is contained in:
John Reiser 2006-08-16 19:49:09 -07:00
parent 4f18ec726c
commit 7f5635ea8c
12 changed files with 56 additions and 50 deletions

View File

@ -28,8 +28,8 @@
#define BSD_I386ELF_LOADER_SIZE 52787
#define BSD_I386ELF_LOADER_ADLER32 0x06e53ed8
#define BSD_I386ELF_LOADER_CRC32 0x56e2626b
#define BSD_I386ELF_LOADER_ADLER32 0xc1f73e3b
#define BSD_I386ELF_LOADER_CRC32 0xa33300de
unsigned char bsd_i386elf_loader[52787] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -89,7 +89,7 @@ unsigned char bsd_i386elf_loader[52787] = {
0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 360 */
195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 44,172, /* 0x 370 */
74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 380 */
156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 390 */
164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 390 */
131,195, 4,139, 77, 52,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 3a0 */
172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 3b0 */
83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 3c0 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 33539
#define NRV_LOADER_ADLER32 0x00029449
#define NRV_LOADER_CRC32 0x95a2db45
#define NRV_LOADER_ADLER32 0xe22f93ac
#define NRV_LOADER_CRC32 0xef0ce0ba
unsigned char nrv_loader[33539] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -89,8 +89,8 @@ unsigned char nrv_loader[33539] = {
0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, /* 0x 360 */
0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, /* 0x 370 */
80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, /* 0x 380 */
36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136, /* 0x 390 */
241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4, /* 0x 3a0 */
36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144, /* 0x 390 */
241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4, /* 0x 3a0 */
139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136, /* 0x 3b0 */
193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, /* 0x 3c0 */
87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36, /* 0x 3d0 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 34548
#define NRV_LOADER_ADLER32 0x0dd13755
#define NRV_LOADER_CRC32 0x52bf9345
#define NRV_LOADER_ADLER32 0x9e3836b8
#define NRV_LOADER_CRC32 0x21c51d7f
unsigned char nrv_loader[34548] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -92,8 +92,8 @@ unsigned char nrv_loader[34548] = {
117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, 83,104, /* 0x 390 */
0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, 0, 0, /* 0x 3a0 */
137,229,139, 85, 0,172, 74,136,193, 36, 7,192,233, 3,187, 0, /* 0x 3b0 */
253,255,255,211,227,141,156, 92,136,241,255,255,131,227,224,106, /* 0x 3c0 */
0, 57,220,117,250, 83,131,195, 4,139, 77, 0,255, 49, 87, 83, /* 0x 3d0 */
253,255,255,211,227,141,164, 92,144,241,255,255,131,228,224,106, /* 0x 3c0 */
0,106, 0,137,227, 83,131,195, 4,139, 77, 0,255, 49, 87, 83, /* 0x 3d0 */
131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3,192,233, /* 0x 3e0 */
4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236,124,139, /* 0x 3f0 */
148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0,198, 68, /* 0x 400 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 35306
#define NRV_LOADER_ADLER32 0x05a7dcb0
#define NRV_LOADER_CRC32 0xaa11fd60
#define NRV_LOADER_ADLER32 0xca97dc13
#define NRV_LOADER_CRC32 0x3d938c4c
unsigned char nrv_loader[35306] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -92,8 +92,8 @@ unsigned char nrv_loader[35306] = {
0, 0, 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, /* 0x 390 */
0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, /* 0x 3a0 */
4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74, /* 0x 3b0 */
136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, /* 0x 3c0 */
92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131, /* 0x 3d0 */
136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, /* 0x 3c0 */
92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131, /* 0x 3d0 */
195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, /* 0x 3e0 */
74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, /* 0x 3f0 */
80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, /* 0x 400 */

View File

@ -28,8 +28,8 @@
#define LINUX_I386ELF_LOADER_SIZE 52781
#define LINUX_I386ELF_LOADER_ADLER32 0x13983ee3
#define LINUX_I386ELF_LOADER_CRC32 0x0de2810c
#define LINUX_I386ELF_LOADER_ADLER32 0xd2583e46
#define LINUX_I386ELF_LOADER_CRC32 0x297d1e70
unsigned char linux_i386elf_loader[52781] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -89,7 +89,7 @@ unsigned char linux_i386elf_loader[52781] = {
0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 360 */
195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 44,172, /* 0x 370 */
74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 380 */
156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 390 */
164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 390 */
131,195, 4,139, 77, 52,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 3a0 */
172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 3b0 */
83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 3c0 */

View File

@ -28,8 +28,8 @@
#define LINUX_I386EXEC_LOADER_SIZE 53451
#define LINUX_I386EXEC_LOADER_ADLER32 0xb7e5a220
#define LINUX_I386EXEC_LOADER_CRC32 0x603584d0
#define LINUX_I386EXEC_LOADER_ADLER32 0xe098a183
#define LINUX_I386EXEC_LOADER_CRC32 0x4f3aabaa
unsigned char linux_i386exec_loader[53451] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -89,8 +89,8 @@ unsigned char linux_i386exec_loader[53451] = {
57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, /* 0x 360 */
83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, /* 0x 370 */
0, 0,137,229,139, 85, 44,172, 74,136,193, 36, 7,192,233, 3, /* 0x 380 */
187, 0,253,255,255,211,227,141,156, 92,136,241,255,255,131,227, /* 0x 390 */
224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, 52,255, 49, /* 0x 3a0 */
187, 0,253,255,255,211,227,141,164, 92,144,241,255,255,131,228, /* 0x 390 */
224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, 52,255, 49, /* 0x 3a0 */
87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3, /* 0x 3b0 */
192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236, /* 0x 3c0 */
124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0, /* 0x 3d0 */

View File

@ -28,8 +28,8 @@
#define LINUX_I386PTI_LOADER_SIZE 64197
#define LINUX_I386PTI_LOADER_ADLER32 0xca0193e3
#define LINUX_I386PTI_LOADER_CRC32 0xa5f0300f
#define LINUX_I386PTI_LOADER_ADLER32 0xe8739346
#define LINUX_I386PTI_LOADER_CRC32 0x86df3410
unsigned char linux_i386pti_loader[64197] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -108,7 +108,7 @@ unsigned char linux_i386pti_loader[64197] = {
0, 0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131, /* 0x 490 */
195, 4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, /* 0x 4a0 */
74,136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141, /* 0x 4b0 */
156, 92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83, /* 0x 4c0 */
164, 92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83, /* 0x 4c0 */
131,195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2, /* 0x 4d0 */
172, 74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, /* 0x 4e0 */
83, 80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0, /* 0x 4f0 */

View File

@ -28,8 +28,8 @@
#define LINUX_I386SH_LOADER_SIZE 41496
#define LINUX_I386SH_LOADER_ADLER32 0x306aca0d
#define LINUX_I386SH_LOADER_CRC32 0x5e7a69bf
#define LINUX_I386SH_LOADER_ADLER32 0xa73ec970
#define LINUX_I386SH_LOADER_CRC32 0xbd75a158
unsigned char linux_i386sh_loader[41496] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -106,8 +106,8 @@ unsigned char linux_i386sh_loader[41496] = {
49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87, /* 0x 470 */
131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, /* 0x 480 */
3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7, /* 0x 490 */
192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136,241,255, /* 0x 4a0 */
255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, /* 0x 4b0 */
192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144,241,255, /* 0x 4a0 */
255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, /* 0x 4b0 */
0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, /* 0x 4c0 */
15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, /* 0x 4d0 */
83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, /* 0x 4e0 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 34462
#define NRV_LOADER_ADLER32 0x5d8f25ff
#define NRV_LOADER_CRC32 0x9b5223f9
#define NRV_LOADER_ADLER32 0x01082562
#define NRV_LOADER_CRC32 0x56c03e89
unsigned char nrv_loader[34462] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -88,8 +88,8 @@ unsigned char nrv_loader[34462] = {
0, 0, 0, 0, 49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, /* 0x 350 */
0, 0, 0, 87,131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, /* 0x 360 */
4, 83, 80,199, 3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74, /* 0x 370 */
136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,156, /* 0x 380 */
92,136,241,255,255,131,227,224,106, 0, 57,220,117,250, 83,131, /* 0x 390 */
136,193, 36, 7,192,233, 3,187, 0,253,255,255,211,227,141,164, /* 0x 380 */
92,144,241,255,255,131,228,224,106, 0,106, 0,137,227, 83,131, /* 0x 390 */
195, 4,139, 77, 0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, /* 0x 3a0 */
74,136,193, 36, 15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, /* 0x 3b0 */
80, 85, 87, 86, 83,131,236,124,139,148, 36,144, 0, 0, 0,199, /* 0x 3c0 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 35989
#define NRV_LOADER_ADLER32 0xe931624c
#define NRV_LOADER_CRC32 0xa0b23316
#define NRV_LOADER_ADLER32 0x129e61af
#define NRV_LOADER_CRC32 0x4dbf260d
unsigned char nrv_loader[35989] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -93,8 +93,8 @@ unsigned char nrv_loader[35989] = {
49,192, 80, 57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87, /* 0x 3a0 */
131,195, 4, 83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, /* 0x 3b0 */
3, 0, 0, 0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7, /* 0x 3c0 */
192,233, 3,187, 0,253,255,255,211,227,141,156, 92,136,241,255, /* 0x 3d0 */
255,131,227,224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, /* 0x 3e0 */
192,233, 3,187, 0,253,255,255,211,227,141,164, 92,144,241,255, /* 0x 3d0 */
255,131,228,224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, /* 0x 3e0 */
0,255, 49, 87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, /* 0x 3f0 */
15,136, 3,192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, /* 0x 400 */
83,131,236,124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, /* 0x 410 */

View File

@ -28,8 +28,8 @@
#define NRV_LOADER_SIZE 42497
#define NRV_LOADER_ADLER32 0xf991fddb
#define NRV_LOADER_CRC32 0x97174a6b
#define NRV_LOADER_ADLER32 0x6b8bfd3e
#define NRV_LOADER_CRC32 0x205e8d53
unsigned char nrv_loader[42497] = {
127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 0 */
@ -90,8 +90,8 @@ unsigned char nrv_loader[42497] = {
57,220,117,251, 70, 70, 83,104, 0, 0, 0, 0, 87,131,195, 4, /* 0x 370 */
83,104, 0, 0, 0, 0, 86,131,195, 4, 83, 80,199, 3, 0, 0, /* 0x 380 */
0, 0,137,229,139, 85, 0,172, 74,136,193, 36, 7,192,233, 3, /* 0x 390 */
187, 0,253,255,255,211,227,141,156, 92,136,241,255,255,131,227, /* 0x 3a0 */
224,106, 0, 57,220,117,250, 83,131,195, 4,139, 77, 0,255, 49, /* 0x 3b0 */
187, 0,253,255,255,211,227,141,164, 92,144,241,255,255,131,228, /* 0x 3a0 */
224,106, 0,106, 0,137,227, 83,131,195, 4,139, 77, 0,255, 49, /* 0x 3b0 */
87, 83,131,195, 4,136, 67, 2,172, 74,136,193, 36, 15,136, 3, /* 0x 3c0 */
192,233, 4,136, 75, 1, 82, 86, 83, 80, 85, 87, 86, 83,131,236, /* 0x 3d0 */
124,139,148, 36,144, 0, 0, 0,199, 68, 36,116, 0, 0, 0, 0, /* 0x 3e0 */

View File

@ -76,6 +76,7 @@ section LZMA_DEC00
section LZMA_ELF00
// Preceded by LEXEC010 which tunes for NRV, including "pusha; push $cto"
#define LZMA_BASE_SIZE 1846
#define LZMA_LIT_SIZE 768
@ -96,13 +97,14 @@ section LZMA_ELF00
mov ebx, -LZMA_LIT_SIZE
shl ebx,cl
// inSizeProcessed, outSizeProcessed, *_bits, CLzmaDecoderState
lea ebx,[0 -(2*4 +4) - 2*LZMA_BASE_SIZE + 2*ebx + esp]
and ebx, (~0<<5) // 32-byte align
.elf_clearstack1:
push 0
cmp esp,ebx
jne .elf_clearstack1
// CLzmaDecoderState:{*_bits, CProb[LZMA_BASE_SIZE + (LZMA_LIT_SIZE<<%cl)]}
lea esp,[0 -4 - 2*LZMA_BASE_SIZE + 2*ebx + esp]
and esp, (~0<<5) // 32-byte align
push 0 // inSizeProcessed
push 0 // outSizeProcessed
mov ebx,esp
push ebx // &outSizeProcessed
add ebx, 4
@ -139,10 +141,14 @@ section LZMA_DEC20
// cleanup
section LZMA_DEC30
// These are needed only because followed by LEXEC015. LzmaDecode() has set
// *O_OUTS, and returned %eax=0 for success, %eax=1 for failure. Therefore
// "neg eax" would be enough (followed by clearing %ecx to agree with NRV.)
add esi, [ebx - 4] // inSizeProcessed
add edi, [ebx - 8] // outSizeProcessed
xor eax, eax
// Partially clear exposed stack (only because of paranoia.)
xor eax, eax
lea ecx, [esp - 256]
mov esp, ebp // restore stack
.clearstack2:
@ -151,7 +157,7 @@ section LZMA_DEC30
jnz .clearstack2
mov esp, ebp // restore stack
xor ecx, ecx
xor ecx, ecx // NRV protocol
// vi:ts=8:et