11.3. Dynamic Entries

11.3.1. Introduction

As described in System V ABI, if an object file participates in dynamic linking, its program header table shall have an element of type PT_DYNAMIC. This `segment' contains the .dynamic section. A special symbol, _DYNAMIC, labels the section, which contains an array of the following structures.

typedef struct {
	Elf32_Sword	d_tag;
   	union {
   		Elf32_Word	d_val;
   		Elf32_Addr	d_ptr;
	} d_un;
} Elf32_Dyn;

extern Elf32_Dyn	_DYNAMIC[];

typedef struct {
	Elf64_Sxword	d_tag;
   	union {
   		Elf64_Xword	d_val;
   		Elf64_Addr	d_ptr;
	} d_un;
} Elf64_Dyn;

extern Elf64_Dyn	_DYNAMIC[];

Figure 11-1. Dynamic Structure

For each object with this type, d_tag controls the interpretation of d_un.

11.3.2. Dynamic Entries

11.3.2.1. ELF Dynamic Entries

The following dynamic entries are defined in the System V ABI and System V ABI Update.

DT_BIND_NOW 

Process relocations of object

DT_DEBUG 

For debugging; unspecified

DT_FINI 

Address of termination function

DT_FINI_ARRAY 

The address of an array of pointers to termination functions.

DT_FINI_ARRAYSZ 

Size in bytes of DT_FINI_ARRAY

DT_FLAGS 

Flag values specific to the object being loaded

DT_HASH 

Address of symbol hash table

DT_HIPROC 

End of processor-specific

DT_INIT 

Address of init function

DT_INIT_ARRAY 

The address of an array of pointers to initialization functions.

DT_INIT_ARRAYSZ 

Size in bytes of DT_INIT_ARRAY

DT_JMPREL 

Address of PLT relocs

DT_LOPROC 

Start of processor-specific

DT_NEEDED 

Name of needed library

DT_NULL 

Marks end of dynamic section

DT_PLTREL 

Type of reloc in PLT

DT_PLTRELSZ 

Size in bytes of PLT relocs

DT_PREINIT_ARRAY 

Array with addresses of preinit functions

DT_PREINIT_ARRAYSZ 

Size in bytes of DT_PREINIT_ARRAY

DT_REL 

Address of Rel relocs

DT_RELA 

Address of Rela relocs

DT_RELAENT 

Size of one Rela reloc

DT_RELASZ 

Total size of Rela relocs

DT_RELENT 

Size of one Rel reloc

DT_RELSZ 

Total size of Rel relocs

DT_RPATH 

Library search path

DT_RUNPATH 

null-terminated library search path string

DT_SONAME 

Name of shared object

DT_STRSZ 

Size of string table

DT_STRTAB 

Address of string table

DT_SYMBOLIC 

Start symbol search here

DT_SYMENT 

Size of one symbol table entry

DT_SYMTAB 

Address of symbol table

DT_TEXTREL 

Reloc might modify .text

11.3.2.2. Additional Dynamic Entries

An LSB conforming object may also use the following additional Dynamic Entry types.

DT_ADDRRNGHI 

Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for definition by an archLSB.

DT_ADDRRNGLO 

Values from DT_ADDRRNGLO through DT_ADDRRNGHI are reserved for definition by an archLSB.

DT_AUXILIARY 

Shared object to load before self

DT_FILTER 

Shared object to get values from

DT_HIOS 

Values from DT_LOOS through DT_HIOS are reserved for definition by specific operating systems.

DT_LOOS 

Values from DT_LOOS through DT_HIOS are reserved for definition by specific operating systems.

DT_NUM 

Number of dynamic entry tags defined (excepting reserved ranges).

DT_POSFLAG_1 

Flags for DT_* entries, effecting the following DT_* entry

DT_RELCOUNT 

All Elf32_Rel R_*_RELATIVE relocations have been placed into a single block and this entry specifies the number of entries in that block. This permits ld.so.1 to streamline the processing of RELATIVE relocations.

DT_SYMINENT 

Entry size of syminfo

DT_SYMINFO 

Address of the Syminfo table.

DT_SYMINSZ 

Size of syminfo table (in bytes)

DT_VALRNGHI 

Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the Dyn.d_un.d_val field of the Elf*_Dyn structure.

DT_VALRNGLO 

Entries which fall between DT_VALRNGHI & DT_VALRNGLO use the Dyn.d_un.d_val field of the Elf*_Dyn structure.

DT_VERDEF 

Address of version definition table

DT_VERDEFNUM 

Number of version definitions

DT_VERNEED 

Address of table with needed versions

DT_VERNEEDNUM 

Number of needed versions

DT_VERSYM 

Address of the table provided by the .gnu.version section.