Linker and Libraries Guide

Version Dependency Section

The version dependency section is defined by the type SHT_SUNW_verneed. This section complements the dynamic dependency requirements of the file by indicating the version definitions required from these dependencies. A recording is made in this section only if a dependency contains version definitions. Elements of this section have the following structure.

typedef struct {
        Elf32_Half      vn_version;
        Elf32_Half      vn_cnt;
        Elf32_Word      vn_file;
        Elf32_Word      vn_aux;
        Elf32_Word      vn_next;
} Elf32_Verneed;
 
typedef struct {
        Elf32_Word      vna_hash;
        Elf32_Half      vna_flags;
        Elf32_Half      vna_other;
        Elf32_Word      vna_name;
        Elf32_Word      vna_next;
} Elf32_Vernaux;

typedef struct {
        Elf64_Half      vn_version;
        Elf64_Half      vn_cnt;
        Elf64_Word      vn_file;
        Elf64_Word      vn_aux;
        Elf64_Word      vn_next;
} Elf64_Verneed;
 
typedef struct {
        Elf64_Word      vna_hash;
        Elf64_Half      vna_flags;
        Elf64_Half      vna_other;
        Elf64_Word      vna_name;
        Elf64_Word      vna_next;
} Elf64_Vernaux;
vn_version

This member identifies the version of the structure, as listed in the following table.

Name 

Value 

Meaning 

VER_NEED_NONE

0

Invalid version. 

VER_NEED_CURRENT

>=1

Current version. 

The value 1 signifies the original section format. Extensions require new versions with higher numbers. The value of VER_NEED_CURRENT changes as necessary to reflect the current version number.

vn_cnt

The number of elements in the Elf32_Vernaux array.

vn_file

The string table offset to a null-terminated string, providing the file name of a version dependency. This name matches one of the .dynamic dependencies found in the file. See Dynamic Section.

vn_aux

The byte offset, from the start of this Elf32_Verneed entry, to the Elf32_Vernaux array of version definitions that are required from the associated file dependency. At least one version dependency must exist. Additional version dependencies can be present, the number being indicated by the vn_cnt value.

vn_next

The byte offset, from the start of this Elf32_Verneed entry, to the next Elf32_Verneed entry.

vna_hash

The hash value of the version dependency name. This value is generated using the same hashing function that is described in Hash Table Section.

vna_flags

Version dependency specific information, as listed in the following table.

Name 

Value 

Meaning 

VER_FLG_WEAK

0x2

Weak version identifier. 

VER_FLG_INFO

0x4

SHT_SUNW_versym reference exists for informational purposes, and need not be validated at runtime.

A weak version dependency indicates an original binding to a weak version definition.

vna_other

If non-zero, the version index assigned to this dependency version. This index is used within the SHT_SUNW_versym to assign global symbol references to this version.

Versions of Solaris up to and including the Solaris 10 release, did not assign version symbol indexes to dependency versions. In these objects, the value of vna_other is 0.

vna_name

The string table offset to a null-terminated string, giving the name of the version dependency.

vna_next

The byte offset from the start of this Elf32_Vernaux entry to the next Elf32_Vernaux entry.