ELF_KIND(3) Libelf Programmer's Manual ELF_KIND(3)

elf_kind - Determine the type of file represented by an ELF descriptor.

#include <libelf.h>
Elf_Kind elf_kind(Elf *elf);

The elf_kind function determines the file type of the file represented by elf. This type identifies whether the descriptor represents an ELF object, an archive member, or some other type of file.

The ELF descriptor.

The file type of the file represented by elf. The possible return value are

Unknown file type.
Archive member.
COFF object file. COFF is not supported by elfutils libelf.
ELF object file.

ar(1), ranlib(1), libelf(3), elf(5)

For an explanation of the terms used in this section, see attributes(7).

Interface Attribute Value
elf_kind () Thread safety MT-Safe

Report bugs to <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.

2025-03-31 Libelf