Linux i386 allow compression of position-independent main executables (gcc -pie).

p_elf.h p_lx_elf.cpp p_lx_elf.h p_lx_exc.cpp
	stub/fold_elf86.asm stub/fold_elf86.h stub/l_lx_elf.c
	stub/l_lx_elf86.asm stub/l_lx_elf86.h stub/l_lx_elf86.lds
	stub/linux.hh

committer: jreiser <jreiser> 1126886896 +0000
This commit is contained in:
John Reiser
2005-09-16 16:08:16 +00:00
parent eb6c51426a
commit 3f7b642c7d
11 changed files with 761 additions and 515 deletions
+5 -4
View File
@@ -418,13 +418,14 @@ int PackLinuxI386::checkEhdr(const Elf32_Ehdr *ehdr) const
return -1;
// now check the ELF header
if (!memcmp(buf+8, "FreeBSD", 7)) // branded
if (!memcmp(buf+8, "FreeBSD", 7)) // branded
return 1;
if (ehdr->e_type != 2) // executable
if (ehdr->e_type != Elf32_Ehdr::ET_EXEC
&& ehdr->e_type != Elf32_Ehdr::ET_DYN ) // executable
return 2;
if (ehdr->e_machine != 3) // Intel 80386
if (ehdr->e_machine != Elf32_Ehdr::EM_386) // Intel 80386
return 3;
if (ehdr->e_version != 1) // version
if (ehdr->e_version != Elf32_Ehdr::EV_CURRENT) // version
return 4;
if (ehdr->e_phnum < 1)
return 5;