mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Fix conflict between VDSO and unfolded decompressor for ET_DYN
(-fPIE) with unlimited stack on Linux-2.6.34 et al.
This commit is contained in:
parent
d08a51d7e4
commit
5336c51199
|
@ -635,7 +635,11 @@ void PackLinuxElf32x86::addStubEntrySections(Filter const *ft)
|
|||
}
|
||||
|
||||
addLoader("IDENTSTR", NULL);
|
||||
addLoader("LEXEC020", (opt->o_unix.unmap_all_pages ? "LUNMP000" : "LUNMP001"), "LEXEC025", NULL);
|
||||
addLoader("LEXEC020", NULL);
|
||||
if (Elf32_Ehdr::ET_DYN==get_te16(&ehdri.e_type)) {
|
||||
addLoader("LEXECDYN", NULL);
|
||||
}
|
||||
addLoader((opt->o_unix.unmap_all_pages ? "LUNMP000" : "LUNMP001"), "LEXEC025", NULL);
|
||||
addLoader("FOLDEXEC", NULL);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
/* i386-linux.elf-fold.h
|
||||
created from i386-linux.elf-fold.bin, 1742 (0x6ce) bytes
|
||||
created from i386-linux.elf-fold.bin, 1725 (0x6bd) bytes
|
||||
|
||||
This file is part of the UPX executable compressor.
|
||||
|
||||
|
@ -31,17 +31,17 @@
|
|||
*/
|
||||
|
||||
|
||||
#define STUB_I386_LINUX_ELF_FOLD_SIZE 1742
|
||||
#define STUB_I386_LINUX_ELF_FOLD_ADLER32 0xe994ee47
|
||||
#define STUB_I386_LINUX_ELF_FOLD_CRC32 0x54750d83
|
||||
#define STUB_I386_LINUX_ELF_FOLD_SIZE 1725
|
||||
#define STUB_I386_LINUX_ELF_FOLD_ADLER32 0xe6cfe425
|
||||
#define STUB_I386_LINUX_ELF_FOLD_CRC32 0xced73b90
|
||||
|
||||
unsigned char stub_i386_linux_elf_fold[1742] = {
|
||||
unsigned char stub_i386_linux_elf_fold[1725] = {
|
||||
/* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x0010 */ 2, 0, 3, 0, 1, 0, 0, 0,128, 16,192, 0, 52, 0, 0, 0,
|
||||
/* 0x0020 */ 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 32, 0, 2, 0, 0, 0,
|
||||
/* 0x0030 */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 16,192, 0,
|
||||
/* 0x0040 */ 0, 16,192, 0,206, 6, 0, 0,208, 6, 0, 0, 5, 0, 0, 0,
|
||||
/* 0x0050 */ 0, 16, 0, 0, 1, 0, 0, 0,206, 6, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x0040 */ 0, 16,192, 0,189, 6, 0, 0,192, 6, 0, 0, 5, 0, 0, 0,
|
||||
/* 0x0050 */ 0, 16, 0, 0, 1, 0, 0, 0,189, 6, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x0060 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x0070 */ 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x0080 */ 87, 83, 41,201,186,120, 2, 0, 0,137,230,137,231, 41,219,232,
|
||||
|
@ -53,7 +53,7 @@ unsigned char stub_i386_linux_elf_fold[1742] = {
|
|||
/* 0x00e0 */ 4,198, 4, 1, 0, 91, 94,129,236, 0, 10, 0, 0, 83,139, 83,
|
||||
/* 0x00f0 */ 72,141,148, 26,255, 31, 0, 0,129,226, 0,240,255,255, 82, 41,
|
||||
/* 0x0100 */ 192,102,131,123, 16, 3,117, 1,146, 80,141,131,140, 0, 0, 0,
|
||||
/* 0x0110 */ 139, 24,139, 72, 4,131,193, 12,141, 84, 36, 12, 96, 71,232,117,
|
||||
/* 0x0110 */ 139, 24,139, 72, 4,131,193, 12,141, 84, 36, 12, 96, 71,232,100,
|
||||
/* 0x0120 */ 4, 0, 0,131,196, 36, 89, 91,129,196, 0, 10, 0, 0, 90,193,
|
||||
/* 0x0130 */ 226, 12, 1,211, 80, 79, 41,192, 60,175,175,117,252, 80, 80, 80,
|
||||
/* 0x0140 */ 80, 80, 80, 80, 80, 41,217,176, 91,255, 39,173,171,173,171,173,
|
||||
|
@ -77,72 +77,71 @@ unsigned char stub_i386_linux_elf_fold[1742] = {
|
|||
/* 0x0260 */ 15,182, 69,238, 80, 82,255,115, 4,255,215,131,196, 16,139, 69,
|
||||
/* 0x0270 */ 232, 1, 70, 4, 41, 6,235, 10,139, 83, 4,137,240,232, 14,255,
|
||||
/* 0x0280 */ 255,255,139, 85,228,139, 3, 1, 83, 4, 41,208,133,192,137, 3,
|
||||
/* 0x0290 */ 233, 65,255,255,255,141,101,244, 91, 94, 95,201,195,133,192, 83,
|
||||
/* 0x02a0 */ 137,211,116, 26,168, 1,117, 22,139, 16, 57,218,116, 7, 74,117,
|
||||
/* 0x02b0 */ 8,133,219,116, 4,137, 24,235, 7,131,192, 8,235,234, 49,192,
|
||||
/* 0x02c0 */ 133,192,116, 3,137, 72, 4, 91,195, 85,137,229, 87, 86, 83,131,
|
||||
/* 0x02d0 */ 236, 68,137, 69,228,139, 69, 8,137, 85,224,139, 93,224,139, 85,
|
||||
/* 0x02e0 */ 12,137, 69,220,139, 69,224,139, 77, 20,137, 85,216, 3, 91, 28,
|
||||
/* 0x02f0 */ 139, 85,224,137, 77,212,102,131,120, 16, 2, 15,183, 74, 44,137,
|
||||
/* 0x0300 */ 93,208, 15,148,192,131,206,255, 15,182,192,137,202,193,224, 4,
|
||||
/* 0x0310 */ 49,255,131,192, 34, 74,120, 28,131, 59, 1,117, 18,139, 83, 8,
|
||||
/* 0x0320 */ 57,242,115, 2,137,214, 3, 83, 20, 57,215,115, 2,137,215,131,
|
||||
/* 0x0330 */ 195, 32,226,228,129,230, 0,240,255,255, 41,247,137,242,141,159,
|
||||
/* 0x0340 */ 255, 15, 0, 0,129,227, 0,240,255,255,168, 16,117, 19,106, 0,
|
||||
/* 0x0350 */ 106,255, 80,106, 0, 83, 86,232, 39,254,255,255,131,196, 24,137,
|
||||
/* 0x0360 */ 194,139, 77,224,141, 4, 26, 41,242,199, 69,200, 0, 0, 0, 0,
|
||||
/* 0x0370 */ 102,131,121, 44, 0,137, 69,240,137, 85,204, 15,132,221, 1, 0,
|
||||
/* 0x0380 */ 0,131,125,220, 0,116, 32,139, 93,208,131, 59, 6,117, 24,139,
|
||||
/* 0x0390 */ 77,204,186, 3, 0, 0, 0, 3, 75, 8,139, 69,216,232,251,254,
|
||||
/* 0x03a0 */ 255,255,233,160, 1, 0, 0,139, 69,208,131, 56, 1, 15,133,148,
|
||||
/* 0x03b0 */ 1, 0, 0,139, 72, 24,199, 69,196, 64, 98, 81,115,139, 85,208,
|
||||
/* 0x03c0 */ 131,225, 7,193,225, 2,139, 90, 20,211,109,196,139, 72, 16,139,
|
||||
/* 0x03d0 */ 69,204, 3, 66, 8,137, 77,232,131,101,196, 7,137,194, 1,195,
|
||||
/* 0x03e0 */ 129,226,255, 15, 0, 0,137,199,141, 52, 17,139, 77,208,137, 69,
|
||||
/* 0x03f0 */ 236, 41,215,139, 65, 4,137, 93,192, 41,208,131,125,220, 0, 80,
|
||||
/* 0x0400 */ 139, 69,228,116, 3,131,200,255,131,125,220, 1, 80, 25,192,131,
|
||||
/* 0x0410 */ 224,224,131,192, 50,131,125,220, 0, 80,139, 69,196,116, 3,131,
|
||||
/* 0x0420 */ 200, 2,131,125,220, 0, 80,137,240,116, 3,141, 70, 3, 80, 87,
|
||||
/* 0x0430 */ 232, 78,253,255,255,131,196, 24, 57,199, 15,133,184, 0, 0, 0,
|
||||
/* 0x0440 */ 131,125,220, 0,116, 28,246, 69,196, 4,139, 69,212,117, 2, 49,
|
||||
/* 0x0450 */ 192, 80,139, 69,220,255,117,228,141, 85,232,232, 93,253,255,255,
|
||||
/* 0x0460 */ 88, 90,137,243,247,219,129,227,255, 15, 0, 0,246, 69,196, 2,
|
||||
/* 0x0470 */ 137, 93,188,116, 15,133,219,141, 4, 55,116, 8,137,217,198, 0,
|
||||
/* 0x0480 */ 0, 64,226,250,131,125,220, 0,116,120,139, 69,208,131, 56, 1,
|
||||
/* 0x0490 */ 117, 86,246, 64, 24, 1,116, 80,139, 80, 20,139, 88, 8,141, 12,
|
||||
/* 0x04a0 */ 26, 3, 77,204, 59, 80, 16,117, 14,137,200,247,216, 37,255, 15,
|
||||
/* 0x04b0 */ 0, 0,131,248, 3,119, 17,139, 85,208,107, 69,204, 52,131,122,
|
||||
/* 0x04c0 */ 4, 0,141, 76, 3, 12,117, 32,139, 1, 61,205,128, 97,195,116,
|
||||
/* 0x04d0 */ 6,199, 1,205,128, 97,195,133,201,116, 13,139, 69,216, 49,210,
|
||||
/* 0x04e0 */ 131,224,254,232,181,253,255,255,137,251,137,241,139, 85,196,106,
|
||||
/* 0x04f0 */ 125, 88,205,128,133,192,116, 10,106,127, 91,106, 1, 88,205,128,
|
||||
/* 0x0500 */ 235,254,139, 85,188,141, 4, 22,141, 28, 7, 59, 93,192,115, 30,
|
||||
/* 0x0510 */ 106, 0,106,255,106, 50,255,117,196, 41, 93,192,255,117,192, 83,
|
||||
/* 0x0520 */ 232, 94,252,255,255,131,196, 24, 57,195,116, 27,235,202,131,125,
|
||||
/* 0x0530 */ 220, 0,116, 19,141, 78, 3,129,225,255, 15, 0, 0,131,249, 3,
|
||||
/* 0x0540 */ 119, 5,106, 91, 88,205,128,139, 77,224,255, 69,200, 15,183, 65,
|
||||
/* 0x0550 */ 44,131, 69,208, 32, 57, 69,200, 15,140, 35,254,255,255,131,125,
|
||||
/* 0x0560 */ 220, 0,116, 18,139, 93,224,102,131,123, 16, 3,116, 8,139, 93,
|
||||
/* 0x0570 */ 240,106, 45, 88,205,128,131,125, 16, 0,116, 8,139, 85,204,139,
|
||||
/* 0x0580 */ 69, 16,137, 16,139, 77,224,139, 73, 24, 1, 77,204,139, 69,204,
|
||||
/* 0x0590 */ 141,101,244, 91, 94, 95,201,195, 85,137,229, 87, 86, 83,131,236,
|
||||
/* 0x05a0 */ 32,139,125, 28,106, 0,139,117, 16,139, 69, 8,141, 87, 52,141,
|
||||
/* 0x05b0 */ 78, 2,139, 93, 32,137, 69,236,137, 85,228,141, 69, 32,141, 85,
|
||||
/* 0x05c0 */ 24, 86,137, 77,232,232,243,251,255,255,139, 69, 12,186, 5, 0,
|
||||
/* 0x05d0 */ 0, 0, 15,183, 79, 44,137, 69, 32,139, 69,236, 41, 93, 36,232,
|
||||
/* 0x05e0 */ 185,252,255,255, 15,183, 79, 42,139, 69,236,186, 4, 0, 0, 0,
|
||||
/* 0x05f0 */ 232,168,252,255,255,139, 93,228,139, 77, 40,186, 3, 0, 0, 0,
|
||||
/* 0x0600 */ 3, 75, 8,139, 69,236,131,193, 52,232,143,252,255,255,141, 69,
|
||||
/* 0x0610 */ 240,255,117,232,137,250, 80,255,117,236,141, 69, 32, 80,137,240,
|
||||
/* 0x0620 */ 232,164,252,255,255,186, 9, 0, 0, 0,137,193,137, 69,224,139,
|
||||
/* 0x0630 */ 69,236,232,102,252,255,255,102,139, 79, 44,131,196, 24, 49,210,
|
||||
/* 0x0640 */ 102,133,201,116,126,139, 93,228,131, 59, 3,117,106,139, 69,228,
|
||||
/* 0x0650 */ 49,201,139, 93,240,137,202, 3, 88, 8,106, 5, 88,205,128,133,
|
||||
/* 0x0660 */ 192,137,198,120, 21,186, 0, 2, 0, 0,137,195,137,249,106, 3,
|
||||
/* 0x0670 */ 88,205,128, 61, 0, 2, 0, 0,116, 10,106,127, 91,106, 1, 88,
|
||||
/* 0x0680 */ 205,128,235,254,141, 69,240,137,250,106, 0,137,243, 80,137,240,
|
||||
/* 0x0690 */ 255,117,236,106, 0,232, 47,252,255,255,139, 77,240,137, 69,224,
|
||||
/* 0x06a0 */ 139, 69,236,186, 7, 0, 0, 0,232,240,251,255,255,131,196, 16,
|
||||
/* 0x06b0 */ 106, 6, 88,205,128,235, 12, 66, 15,183,193,131, 69,228, 32, 57,
|
||||
/* 0x06c0 */ 194,124,130,139, 69,224,141,101,244, 91, 94, 95,201,195
|
||||
/* 0x0290 */ 233, 65,255,255,255,141,101,244, 91, 94, 95,201,195,133,192,116,
|
||||
/* 0x02a0 */ 13,168, 1,117, 9, 57, 16,116, 7,131,192, 8,235,247, 49,192,
|
||||
/* 0x02b0 */ 133,192,116, 3,137, 72, 4,195, 85,137,229, 87, 86, 83,131,236,
|
||||
/* 0x02c0 */ 68,137, 69,228,139, 69, 8,137, 85,224,139, 93,224,139, 85, 12,
|
||||
/* 0x02d0 */ 137, 69,220,139, 69,224,139, 77, 20,137, 85,216, 3, 91, 28,139,
|
||||
/* 0x02e0 */ 85,224,137, 77,212,102,131,120, 16, 2, 15,183, 74, 44,137, 93,
|
||||
/* 0x02f0 */ 208, 15,148,192,131,206,255, 15,182,192,137,202,193,224, 4, 49,
|
||||
/* 0x0300 */ 255,131,192, 34, 74,120, 28,131, 59, 1,117, 18,139, 83, 8, 57,
|
||||
/* 0x0310 */ 242,115, 2,137,214, 3, 83, 20, 57,215,115, 2,137,215,131,195,
|
||||
/* 0x0320 */ 32,226,228,129,230, 0,240,255,255, 41,247,137,242,141,159,255,
|
||||
/* 0x0330 */ 15, 0, 0,129,227, 0,240,255,255,168, 16,117, 19,106, 0,106,
|
||||
/* 0x0340 */ 255, 80,106, 0, 83, 86,232, 56,254,255,255,131,196, 24,137,194,
|
||||
/* 0x0350 */ 139, 77,224,141, 4, 26, 41,242,199, 69,200, 0, 0, 0, 0,102,
|
||||
/* 0x0360 */ 131,121, 44, 0,137, 69,240,137, 85,204, 15,132,221, 1, 0, 0,
|
||||
/* 0x0370 */ 131,125,220, 0,116, 32,139, 93,208,131, 59, 6,117, 24,139, 77,
|
||||
/* 0x0380 */ 204,186, 3, 0, 0, 0, 3, 75, 8,139, 69,216,232, 12,255,255,
|
||||
/* 0x0390 */ 255,233,160, 1, 0, 0,139, 69,208,131, 56, 1, 15,133,148, 1,
|
||||
/* 0x03a0 */ 0, 0,139, 72, 24,199, 69,196, 64, 98, 81,115,139, 85,208,131,
|
||||
/* 0x03b0 */ 225, 7,193,225, 2,139, 90, 20,211,109,196,139, 72, 16,139, 69,
|
||||
/* 0x03c0 */ 204, 3, 66, 8,137, 77,232,131,101,196, 7,137,194, 1,195,129,
|
||||
/* 0x03d0 */ 226,255, 15, 0, 0,137,199,141, 52, 17,139, 77,208,137, 69,236,
|
||||
/* 0x03e0 */ 41,215,139, 65, 4,137, 93,192, 41,208,131,125,220, 0, 80,139,
|
||||
/* 0x03f0 */ 69,228,116, 3,131,200,255,131,125,220, 1, 80, 25,192,131,224,
|
||||
/* 0x0400 */ 224,131,192, 50,131,125,220, 0, 80,139, 69,196,116, 3,131,200,
|
||||
/* 0x0410 */ 2,131,125,220, 0, 80,137,240,116, 3,141, 70, 3, 80, 87,232,
|
||||
/* 0x0420 */ 95,253,255,255,131,196, 24, 57,199, 15,133,184, 0, 0, 0,131,
|
||||
/* 0x0430 */ 125,220, 0,116, 28,246, 69,196, 4,139, 69,212,117, 2, 49,192,
|
||||
/* 0x0440 */ 80,139, 69,220,255,117,228,141, 85,232,232,110,253,255,255, 88,
|
||||
/* 0x0450 */ 90,137,243,247,219,129,227,255, 15, 0, 0,246, 69,196, 2,137,
|
||||
/* 0x0460 */ 93,188,116, 15,133,219,141, 4, 55,116, 8,137,217,198, 0, 0,
|
||||
/* 0x0470 */ 64,226,250,131,125,220, 0,116,120,139, 69,208,131, 56, 1,117,
|
||||
/* 0x0480 */ 86,246, 64, 24, 1,116, 80,139, 80, 20,139, 88, 8,141, 12, 26,
|
||||
/* 0x0490 */ 3, 77,204, 59, 80, 16,117, 14,137,200,247,216, 37,255, 15, 0,
|
||||
/* 0x04a0 */ 0,131,248, 3,119, 17,139, 85,208,107, 69,204, 52,131,122, 4,
|
||||
/* 0x04b0 */ 0,141, 76, 3, 12,117, 32,139, 1, 61,205,128, 97,195,116, 6,
|
||||
/* 0x04c0 */ 199, 1,205,128, 97,195,133,201,116, 13,139, 69,216, 49,210,131,
|
||||
/* 0x04d0 */ 224,254,232,198,253,255,255,137,251,137,241,139, 85,196,106,125,
|
||||
/* 0x04e0 */ 88,205,128,133,192,116, 10,106,127, 91,106, 1, 88,205,128,235,
|
||||
/* 0x04f0 */ 254,139, 85,188,141, 4, 22,141, 28, 7, 59, 93,192,115, 30,106,
|
||||
/* 0x0500 */ 0,106,255,106, 50,255,117,196, 41, 93,192,255,117,192, 83,232,
|
||||
/* 0x0510 */ 111,252,255,255,131,196, 24, 57,195,116, 27,235,202,131,125,220,
|
||||
/* 0x0520 */ 0,116, 19,141, 78, 3,129,225,255, 15, 0, 0,131,249, 3,119,
|
||||
/* 0x0530 */ 5,106, 91, 88,205,128,139, 77,224,255, 69,200, 15,183, 65, 44,
|
||||
/* 0x0540 */ 131, 69,208, 32, 57, 69,200, 15,140, 35,254,255,255,131,125,220,
|
||||
/* 0x0550 */ 0,116, 18,139, 93,224,102,131,123, 16, 3,116, 8,139, 93,240,
|
||||
/* 0x0560 */ 106, 45, 88,205,128,131,125, 16, 0,116, 8,139, 85,204,139, 69,
|
||||
/* 0x0570 */ 16,137, 16,139, 77,224,139, 73, 24, 1, 77,204,139, 69,204,141,
|
||||
/* 0x0580 */ 101,244, 91, 94, 95,201,195, 85,137,229, 87, 86, 83,131,236, 32,
|
||||
/* 0x0590 */ 139,125, 28,106, 0,139,117, 16,139, 69, 8,141, 87, 52,141, 78,
|
||||
/* 0x05a0 */ 2,139, 93, 32,137, 69,236,137, 85,228,141, 69, 32,141, 85, 24,
|
||||
/* 0x05b0 */ 86,137, 77,232,232, 4,252,255,255,139, 69, 12,186, 5, 0, 0,
|
||||
/* 0x05c0 */ 0, 15,183, 79, 44,137, 69, 32,139, 69,236, 41, 93, 36,232,202,
|
||||
/* 0x05d0 */ 252,255,255, 15,183, 79, 42,139, 69,236,186, 4, 0, 0, 0,232,
|
||||
/* 0x05e0 */ 185,252,255,255,139, 93,228,139, 77, 40,186, 3, 0, 0, 0, 3,
|
||||
/* 0x05f0 */ 75, 8,139, 69,236,131,193, 52,232,160,252,255,255,141, 69,240,
|
||||
/* 0x0600 */ 255,117,232,137,250, 80,255,117,236,141, 69, 32, 80,137,240,232,
|
||||
/* 0x0610 */ 164,252,255,255,186, 9, 0, 0, 0,137,193,137, 69,224,139, 69,
|
||||
/* 0x0620 */ 236,232,119,252,255,255,102,139, 79, 44,131,196, 24, 49,210,102,
|
||||
/* 0x0630 */ 133,201,116,126,139, 93,228,131, 59, 3,117,106,139, 69,228, 49,
|
||||
/* 0x0640 */ 201,139, 93,240,137,202, 3, 88, 8,106, 5, 88,205,128,133,192,
|
||||
/* 0x0650 */ 137,198,120, 21,186, 0, 2, 0, 0,137,195,137,249,106, 3, 88,
|
||||
/* 0x0660 */ 205,128, 61, 0, 2, 0, 0,116, 10,106,127, 91,106, 1, 88,205,
|
||||
/* 0x0670 */ 128,235,254,141, 69,240,137,250,106, 0,137,243, 80,137,240,255,
|
||||
/* 0x0680 */ 117,236,106, 0,232, 47,252,255,255,139, 77,240,137, 69,224,139,
|
||||
/* 0x0690 */ 69,236,186, 7, 0, 0, 0,232, 1,252,255,255,131,196, 16,106,
|
||||
/* 0x06a0 */ 6, 88,205,128,235, 12, 66, 15,183,193,131, 69,228, 32, 57,194,
|
||||
/* 0x06b0 */ 124,130,139, 69,224,141,101,244, 91, 94, 95,201,195
|
||||
};
|
||||
|
|
|
@ -180,6 +180,34 @@ unfold:
|
|||
add eax, PAGE_SIZE -1
|
||||
and eax, 0-PAGE_SIZE
|
||||
|
||||
section LEXECDYN
|
||||
// VDSO might be at [eax]; if so, then erase AT_SYSINFO and AT_SYSINFO_EHDR.
|
||||
// This happens with some kernels (Linux-2.6.34) for ET_DYN when stack is
|
||||
// unlimited (ulimit -s unlimited), because the only PT_LOAD of compressed
|
||||
// ET_DYN is placed at TASK_UNMAPPED_BASE (TASK_SIZE/3, typically 0x40000000)
|
||||
// and VDSO follows. When stack is limited, then allocation is from high
|
||||
// (just below stack) to low: VDSO will be below our PT_LOAD, and mmap()
|
||||
// below will steal the lowest page of stack.
|
||||
pop ecx; push ecx // argc
|
||||
push esi
|
||||
push eax
|
||||
lea esi,[esp + 4*ecx + (3+1)*4] // &env
|
||||
1:
|
||||
lodsd; test eax,eax; jne 1b // skip env
|
||||
2:
|
||||
lodsd; test eax,eax; je 5f // done with auxv
|
||||
AT_IGNORE= 1
|
||||
AT_SYSINFO= 32
|
||||
AT_SYSINFO_EHDR=33
|
||||
subb al,AT_SYSINFO
|
||||
cmpb al,AT_SYSINFO_EHDR - AT_SYSINFO
|
||||
lodsd
|
||||
ja 2b; movb [esi - 2*4],AT_IGNORE
|
||||
jmp 2b
|
||||
5:
|
||||
pop eax
|
||||
pop esi
|
||||
|
||||
section LUNMP000
|
||||
push 0 // 0-page bread crumb
|
||||
section LUNMP001
|
||||
|
|
|
@ -383,15 +383,22 @@ __attribute__((regparm(2), stdcall))
|
|||
#endif /*}*/
|
||||
auxv_find(Elf32_auxv_t *av, unsigned const type)
|
||||
{
|
||||
Elf32_auxv_t *avail = 0;
|
||||
if (av
|
||||
#if defined(__i386__) /*{*/
|
||||
&& 0==(1&(int)av) /* PT_INTERP usually inhibits, except for hatch */
|
||||
#endif /*}*/
|
||||
)
|
||||
for (;; ++av) {
|
||||
if (av->a_type==type || (av->a_type==AT_IGNORE && type!=AT_NULL)) {
|
||||
av->a_type = type;
|
||||
return av;
|
||||
) {
|
||||
for (;; ++av) {
|
||||
if (av->a_type==type)
|
||||
return av;
|
||||
if (av->a_type==AT_IGNORE)
|
||||
avail = av;
|
||||
}
|
||||
if (0!=avail && AT_NULL!=type) {
|
||||
av = avail;
|
||||
av->a_type = type;
|
||||
return av;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -170,9 +170,10 @@ Idx Name Size VMA LMA File off Algn Flags
|
|||
165 ctok32.40 00000005 00000000 00000000 00001ab1 2**0 CONTENTS, RELOC, READONLY
|
||||
166 LEXEC017 00000002 00000000 00000000 00001ab6 2**0 CONTENTS, READONLY
|
||||
167 LEXEC020 0000004c 00000000 00000000 00001ab8 2**0 CONTENTS, READONLY
|
||||
168 LUNMP000 00000002 00000000 00000000 00001b04 2**0 CONTENTS, READONLY
|
||||
169 LUNMP001 00000002 00000000 00000000 00001b06 2**0 CONTENTS, READONLY
|
||||
170 LEXEC025 0000003a 00000000 00000000 00001b08 2**0 CONTENTS, RELOC, READONLY
|
||||
168 LEXECDYN 00000021 00000000 00000000 00001b04 2**0 CONTENTS, READONLY
|
||||
169 LUNMP000 00000002 00000000 00000000 00001b25 2**0 CONTENTS, READONLY
|
||||
170 LUNMP001 00000002 00000000 00000000 00001b27 2**0 CONTENTS, READONLY
|
||||
171 LEXEC025 0000003a 00000000 00000000 00001b29 2**0 CONTENTS, RELOC, READONLY
|
||||
SYMBOL TABLE:
|
||||
00000000 l d N2BSMA10 00000000 N2BSMA10
|
||||
00000000 l d N2BFAS11 00000000 N2BFAS11
|
||||
|
@ -343,6 +344,7 @@ SYMBOL TABLE:
|
|||
00000000 l d LXUNF035 00000000 LXUNF035
|
||||
00000000 l d ctok32.30 00000000 ctok32.30
|
||||
00000000 l d LEXEC017 00000000 LEXEC017
|
||||
00000000 l d LEXECDYN 00000000 LEXECDYN
|
||||
00000000 l d LUNMP000 00000000 LUNMP000
|
||||
00000000 l d LUNMP001 00000000 LUNMP001
|
||||
00000000 g LEXEC000 00000000 _start
|
||||
|
|
Loading…
Reference in New Issue
Block a user