def METHOD_NAME(prog: Program) -> Iterator[Object]:
    """
    Iterate over all BTF objects.
    This is only supported since Linux v4.18.
    :return: Iterator of ``struct btf *`` objects.
    """
    type = prog.type("struct btf *")
    # BTF was introduced in Linux kernel commit 69b693f0aefa ("bpf: btf:
    # Introduce BPF Type Format (BTF)") (in v4.18). btf_idr was added in a
    # later commit in v4.18, 78958fca7ead ("bpf: btf: Introduce BTF ID").
    for nr, entry in idr_for_each(prog["btf_idr"]):
        yield cast(type, entry)