gelf_update_rel3
Copy class-independent relocation entries into a relocation section
Usage
#include <gelf.h> int gelf_update_rel (Elf_Data *data, int ndx, GElf_Rel *src); int gelf_update_rela(Elf_Data *data, int ndx, GElf_Rela *src);
Overview
The gelf_update_rel() and gelf_update_rela() functions copy a class-independent REL or RELA relocation entry from *src into the SHT_REL or SHT_RELA section associated with data at entry index ndx.
Parameters
- data
-
Elf_Datafor a relocation section. The section must have sh_typeSHT_RELforgelf_update_rel() orSHT_RELAforgelf_update_rela().
- ndx
-
Zero-based index of the relocation entry within data.
- src
-
Pointer to the caller-provided source entry:
GElf_Relforgelf_update_rel() andGElf_Relaforgelf_update_rela(). src must not be NULL.For
ELFCLASS32binaries, r_offset should fit in unsigned 32 bits. r_addend should fit in signed 32 bits. TheGELF_R_SYMcomponent of r_info should fit in 24 bits and theGELF_R_TYPEcomponent should fit in 8 bits.
Return value
On success, gelf_update_rel() and gelf_update_rela() copy src into data, flag the corresponding section with ELF_F_DIRTY and return a non-zero value. On failure, these functions return 0 and set elf_errno. If src is NULL, then 0 is returned without setting elf_errno.
Attributes
| Interface | Attribute | Value |
| gelf_update_rel(), gelf_update_rela() | Thread safety | MT-Safe |