Elf32_Ehdr::ELFOSABI_LINUX
This commit is contained in:
+3
-1
@@ -572,6 +572,7 @@ PackLinuxElf32x86::buildLoader(const Filter *ft)
|
||||
{
|
||||
unsigned char tmp[sizeof(linux_i386elf_fold)];
|
||||
memcpy(tmp, linux_i386elf_fold, sizeof(linux_i386elf_fold));
|
||||
((Elf32_Ehdr *)tmp)->e_ident[Elf32_Ehdr::EI_OSABI] = ei_osabi;
|
||||
checkPatch(NULL, 0, 0, 0); // reset
|
||||
if (opt->o_unix.is_ptinterp) {
|
||||
unsigned j;
|
||||
@@ -935,6 +936,7 @@ PackLinuxElf32::generateElfHdr(
|
||||
cprElfHdr2 *const h2 = (cprElfHdr2 *)&elfout;
|
||||
cprElfHdr3 *const h3 = (cprElfHdr3 *)&elfout;
|
||||
memcpy(h3, proto, sizeof(*h3)); // reads beyond, but OK
|
||||
h3->ehdr.e_ident[Elf32_Ehdr::EI_OSABI] = ei_osabi;
|
||||
|
||||
assert(get_native32(&h2->ehdr.e_phoff) == sizeof(Elf32_Ehdr));
|
||||
h2->ehdr.e_shoff = 0;
|
||||
@@ -1866,7 +1868,7 @@ PackLinuxElf32x86::PackLinuxElf32x86(InputFile *f) : super(f)
|
||||
e_machine = Elf32_Ehdr::EM_386;
|
||||
ei_class = Elf32_Ehdr::ELFCLASS32;
|
||||
ei_data = Elf32_Ehdr::ELFDATA2LSB;
|
||||
ei_osabi = Elf32_Ehdr::ELFOSABI_NONE; // ELFOSABI_LINUX
|
||||
ei_osabi = Elf32_Ehdr::ELFOSABI_LINUX;
|
||||
}
|
||||
|
||||
PackLinuxElf32x86::~PackLinuxElf32x86()
|
||||
|
||||
Reference in New Issue
Block a user