• Jesper Dangaard Brouer's avatar
    selftests/bpf: add test program for loading BPF ELF files · 864db336
    Jesper Dangaard Brouer authored
    V2: Moved program into selftests/bpf from tools/libbpf
    
    This program can be used on its own for testing/debugging if a
    BPF ELF-object file can be loaded with libbpf (from tools/lib/bpf).
    
    If something is wrong with the ELF object, the program have
    a --debug mode that will display the ELF sections and especially
    the skipped sections.  This allows for quickly identifying the
    problematic ELF section number, which can be corrolated with the
    readelf tool.
    
    The program signal error via return codes, and also have
    a --quiet mode, which is practical for use in scripts like
    selftests/bpf.
    Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    864db336
test_libbpf_open.c 3.32 KB