---
name: "elf_kind"
section: "3"
platform: "linux"
package: "libelf"
version: "0.197-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/elf_kind"
---

# elf\_kind(3)

Determine the type of file represented by an ELF descriptor.

## NAME

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

## SYNOPSIS

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

## 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

- *elf*

  The ELF descriptor.

## RETURN VALUE

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

-

  -

  - **ELF\_K\_NONE**

  Unknown file type.

- **ELF\_K\_AR**

  Archive member.

- **ELF\_K\_COFF**

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

- **ELF\_K\_ELF**

  ELF object file.

## SEE ALSO

[**ar**(1)](/ar/1.md), [**ranlib**(1)](/ranlib/1.md), [**libelf**(3)](/libelf/3.md), [**elf**(5)](/elf/5.md)

## ATTRIBUTES

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

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

## REPORTING BUGS

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