fn compatible_elfs(elf1: &Elf, elf2: &Elf) -> bool {
    if elf1.is_64 != elf2.is_64 {
        return false;
    }
    if elf1.little_endian != elf2.little_endian {
        return false;
    }
    if elf1.header.e_machine != elf2.header.e_machine {
        return false;
    }
    let compatible_osabis = &[
        ELFOSABI_NONE, // ELFOSABI_NONE / ELFOSABI_SYSV
        ELFOSABI_GNU,  // ELFOSABI_GNU / ELFOSABI_LINUX
    ];
    let osabi1 = elf1.header.e_ident[EI_OSABI];
    let osabi2 = elf2.header.e_ident[EI_OSABI];
    if osabi1 != osabi2
        && !compatible_osabis.contains(&osabi1)
        && !compatible_osabis.contains(&osabi2)
    {
        return false;
    }
    true
}
/// See if two ELFs are compatible
///
/// This compares the aspects of the ELF to see if they're compatible:
/// bit size, endianness, machine type, and operating system.
See if two ELFs are compatible
This compares the aspects of the ELF to see if they're compatible:
bit size, endianness, machine type, and operating system.
See if two ELFs are compatible This compares the aspects of the ELF to see if they ' re compatible : bit size endianness machine type and operating system .
fn compatible_elfs(elf1: &Elf, elf2: &Elf) -> bool {
    if elf1.is_64 != elf2.is_64 {
        return false;
    }
    if elf1.little_endian != elf2.little_endian {
        return false;
    }
    if elf1.header.e_machine != elf2.header.e_machine {
        return false;
    }
    let compatible_osabis = &[
        ELFOSABI_NONE, // ELFOSABI_NONE / ELFOSABI_SYSV
        ELFOSABI_GNU,  // ELFOSABI_GNU / ELFOSABI_LINUX
    ];
    let osabi1 = elf1.header.e_ident[EI_OSABI];
    let osabi2 = elf2.header.e_ident[EI_OSABI];
    if osabi1 != osabi2
        && !compatible_osabis.contains(&osabi1)
        && !compatible_osabis.contains(&osabi2)
    {
        return false;
    }
    true
}
fn compatible_elfs ( elf1 : & Elf , elf2 : & Elf ) -> bool { if elf1 . is_64 != elf2 . is_64 { return false ; } if elf1 . little_endian != elf2 . little_endian { return false ; } if elf1 . header . e_machine != elf2 . header . e_machine { return false ; } let compatible_osabis = & [ ELFOSABI_NONE , // ELFOSABI_NONE / ELFOSABI_SYSV ELFOSABI_GNU , // ELFOSABI_GNU / ELFOSABI_LINUX ] ; let osabi1 = elf1 . header . e_ident [ EI_OSABI ] ; let osabi2 = elf2 . header . e_ident [ EI_OSABI ] ; if osabi1 != osabi2 && ! compatible_osabis . contains ( & osabi1 ) && ! compatible_osabis . contains ( & osabi2 ) { return false ; } true }
See if two ELFs are compatible
This compares the aspects of the ELF to see if they're compatible:
bit size, endianness, machine type, and operating system.
See if two ELFs are compatible This compares the aspects of the ELF to see if they ' re compatible : bit size endianness machine type and operating system .
elf1
&Elf
elf2
&Elf
elf1
&Elf
elf2
&Elf