elf_version(3)

elf_version3

Set the elf version for libelf.

Usage

#include <libelf.h>

unsigned int elf_version(unsigned int version);

Overview

The elf_version function sets libelf's ELF version to the specified value. This function must be called before any other libelf functions are used.

Parameters

version

An unsigned int value specifying the desired ELF version for the library. This is should be set to EV_CURRENT to indicate the current ELF version. At this time the only supported ELF version is EV_CURRENT.

Return value

The elf_version function returns EV_CURRENT if version is supported and sets the library's ELF version to this value. If the given version is EV_NONE, then this function returns EV_CURRENT and does not set the library's ELF version. If the specified version is not supported, this function returns EV_NONE.

Releases

Unchanged in 2 releases since Debian 13 (Trixie).

  1. 13–Arch

Reporting bugs

Report bugs to <[email protected]> or https://sourceware.org/bugzilla/.

From libelf 0.197-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.