gelf_getrel3
Retrieve relocation entries as class-independent structures
Usage
#include <gelf.h> GElf_Rel *gelf_getrel (Elf_Data *data, int ndx, GElf_Rel *dst); GElf_Rela *gelf_getrela(Elf_Data *data, int ndx, GElf_Rela *dst);
Overview
The gelf_getrel() and gelf_getrela() functions translate the REL or RELA relocation entry at index ndx from data into a class-independent representation stored in *dst.
data must be the Elf_Data of a section whose type matches the function being called: SHT_REL for gelf_getrel() and SHT_RELA for gelf_getrela().
Parameters
- data
-
Pointer to an
Elf_Datafor a SHT_REL or SHT_RELA relocation section.
- ndx
-
Zero-based index of the relocation entry within data.
- dst
-
Pointer to a caller-provided structure for storing the relocation:
GElf_Relforgelf_getrel() andGElf_Relaforgelf_getrela(). dst must not be NULL.
Return value
On success, returns dst. On failure, returns NULL and sets elf_errno. If data is NULL, then NULL is returned without setting elf_errno.
Attributes
| Interface | Attribute | Value |
| gelf_getrel(), gelf_getrela() | Thread safety | MT-Safe |