elftc_version(3)

elftc_version3

Return a project-wide version identifier string

Usage

#include <libelftc.h>

const char *

elftc_version(void);

Library

library “libelftc”

Overview

Function elftc_version() returns a project-wide identifier string that encodes the source revision of the project source tree.

The returned identifier has four space-separated fields:

Project-Name

This is always “elftoolchain”.

Project-Branch

The branch name for the project source tree.

Build-OS

The operating system that the tool chain was compiled for.

Version-Number

A tree-wide version number extracted from the version control system in use.

Return values

Function elftc_program_version() returns a pointer to an internal character buffer.

Examples

To retrieve and print the current toolchain version identifier, use:

#include <sys/types.h>
#include <libelftc.h>
(void) printf("%s\n", elftc_version());

On the HEAD branch of the project's sources, when checked out using Subversion and compiled on a NetBSD host, this would print:

“elftoolchain HEAD NetBSD svn:REVINFO”

where REVINFO would be the current revision information for the project source tree.

Errors

Function elftc_program_version() always succeeds.

Releases

24 releases since FreeBSD 11.1-RELEASE; the text changed 1 time.

  1. 11.1–12.0
  2. 12.1–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.