• Andrii Nakryiko's avatar
    libbpf: split initialization and loading of BTF · 063183bf
    Andrii Nakryiko authored
    Libbpf does sanitization of BTF before loading it into kernel, if kernel
    doesn't support some of newer BTF features. This removes some of the
    important information from BTF (e.g., DATASEC and VAR description),
    which will be used for map construction. This patch splits BTF
    processing into initialization step, in which BTF is initialized from
    ELF and all the original data is still preserved; and
    sanitization/loading step, which ensures that BTF is safe to load into
    kernel. This allows to use full BTF information to construct maps, while
    still loading valid BTF into older kernels.
    Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
    Acked-by: default avatarSong Liu <songliubraving@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    063183bf
libbpf.c 91.9 KB