(elf1: ELFFile, elf2: ELFFile)
return (
        (len(osabis) == 1 or any(osabis.issubset(x) for x in compat_sets))
        and elf1.elfclass == elf2.elfclass
        and elf1.little_endian == elf2.little_endian
        and elf1.header["e_machine"] == elf2.header["e_machine"]
    )
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.

    Parameters
    ----------
    elf1 : ELFFile
    elf2 : ELFFile

    Returns
    -------
    True if compatible, False otherwise
See if two ELFs are compatible
See if two ELFs are compatible
def compatible_elfs(elf1: ELFFile, elf2: ELFFile) -> bool:
    """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.

    Parameters
    ----------
    elf1 : ELFFile
    elf2 : ELFFile

    Returns
    -------
    True if compatible, False otherwise
    """
    osabis = frozenset(e.header["e_ident"]["EI_OSABI"] for e in (elf1, elf2))
    compat_sets = (
        frozenset(
            "ELFOSABI_%s" % x
            for x in (
                "NONE",
                "SYSV",
                "GNU",
                "LINUX",
            )
        ),
    )
    return (
        (len(osabis) == 1 or any(osabis.issubset(x) for x in compat_sets))
        and elf1.elfclass == elf2.elfclass
        and elf1.little_endian == elf2.little_endian
        and elf1.header["e_machine"] == elf2.header["e_machine"]
    )
def compatible_elfs ( elf1 : ELFFile , elf2 : ELFFile ) -> bool : osabis = frozenset ( e . header [ "e_ident" ] [ "EI_OSABI" ] for e in ( elf1 , elf2 ) ) compat_sets = ( frozenset ( "ELFOSABI_%s" % x for x in ( "NONE" , "SYSV" , "GNU" , "LINUX" , ) ) , ) return ( ( len ( osabis ) == 1 or any ( osabis . issubset ( x ) for x in compat_sets ) ) and elf1 . elfclass == elf2 . elfclass and elf1 . little_endian == elf2 . little_endian and elf1 . header [ "e_machine" ] == elf2 . header [ "e_machine" ] )