1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Avoid linker->setLoaderAlignOffset().

This commit is contained in:
John Reiser 2006-08-14 19:21:15 -07:00
parent ec5ff4e973
commit 6a7066ac2f

View File

@ -345,22 +345,23 @@ void PackLinuxElf32x86::addStubEntrySections(Filter const *ft)
{ {
int const n_mru = ft->n_mru; // FIXME: belongs to filter? packerf? int const n_mru = ft->n_mru; // FIXME: belongs to filter? packerf?
// Here is a quick summary of the format of the output file: // Rely on "+80CXXXX" [etc] in getDecompressorSections() packer_c.cpp */
linker->setLoaderAlignOffset( // // Here is a quick summary of the format of the output file:
// Elf32_Edhr // linker->setLoaderAlignOffset(
sizeof(elfout.ehdr) + // // Elf32_Edhr
// Elf32_Phdr: 1 for exec86, 2 for sh86, 3 for elf86 // sizeof(elfout.ehdr) +
(get_native16(&elfout.ehdr.e_phentsize) * get_native16(&elfout.ehdr.e_phnum)) + // // Elf32_Phdr: 1 for exec86, 2 for sh86, 3 for elf86
// checksum UPX! lsize version format // (get_native16(&elfout.ehdr.e_phentsize) * get_native16(&elfout.ehdr.e_phnum)) +
sizeof(l_info) + // // checksum UPX! lsize version format
// PT_DYNAMIC with DT_NEEDED "forwarded" from original file // sizeof(l_info) +
((get_native16(&elfout.ehdr.e_phnum)==3) // // PT_DYNAMIC with DT_NEEDED "forwarded" from original file
? (unsigned) get_native32(&elfout.phdr[2].p_memsz) // ((get_native16(&elfout.ehdr.e_phnum)==3)
: 0) + // ? (unsigned) get_native32(&elfout.phdr[2].p_memsz)
// p_progid, p_filesize, p_blocksize // : 0) +
sizeof(p_info) + // // p_progid, p_filesize, p_blocksize
// compressed data // sizeof(p_info) +
b_len + ph.c_len ); // // compressed data
// b_len + ph.c_len );
// entry to stub // entry to stub
addLoader("LEXEC000", NULL); addLoader("LEXEC000", NULL);