ELF\_KIND(3) Libelf Programmer's Manual ELF\_KIND(3)

# [NAME](#NAME)

elf\_kind - Determine the type of file represented by an ELF descriptor.

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

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.

# [PARAMETERS](#PARAMETERS)

[*elf*](#elf)

The ELF descriptor.

# [RETURN VALUE](#RETURN_VALUE)

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

[**ELF\_K\_NONE**](#ELF_K_NONE)

Unknown file type.

[**ELF\_K\_AR**](#ELF_K_AR)

Archive member.

[**ELF\_K\_COFF**](#ELF_K_COFF)

COFF object file. COFF is not supported by elfutils libelf.

[**ELF\_K\_ELF**](#ELF_K_ELF)

ELF object file.

# [SEE ALSO](#SEE_ALSO)

[**ar**(1)](/man/os/elfutils/ar.1), [**ranlib**(1)](/man/os/elfutils/ranlib.1), [**libelf**(3)](/man/os/elfutils/libelf.3), [**elf**(5)](/man/os/elfutils/elf.5)

# [ATTRIBUTES](#ATTRIBUTES)

For an explanation of the terms used in this section, see [**attributes**(7)](/man/os/elfutils/attributes.7).

**Interface** **Attribute** **Value** elf\_kind () Thread safety MT-Safe

# [REPORTING BUGS](#REPORTING_BUGS)

Report bugs to &lt;elfutils-devel@sourceware.org&gt; or https://sourceware.org/bugzilla/.

2025-03-31 Libelf

---

Document: elf_kind(3) from elfutils 0.196-r1 (Chainguard OS)
Source: https://sourceware.org/git/elfutils.git
