GELF_UPDATE_EHDR(3) Libelf Programmer's Manual GELF_UPDATE_EHDR(3) NAME gelf_update_ehdr - copy a class-independent ELF header into an ELF descrip- tor SYNOPSIS #include int gelf_update_ehdr(Elf *elf, GElf_Ehdr *src); DESCRIPTION gelf_update_ehdr() copies the class-independent ELF header from the struc- ture pointed to by src into the ELF descriptor elf . The header is trans- lated as necessary to match the class ( ELFCLASS32 or ELFCLASS64) of the underlying object. If elf has class ELFCLASS32 then e_entry, e_phoff and e_shoff must be ex- pressible as 32-bit values. This function also marks the Ehdr dirty (see elf_flagehdr()). PARAMETERS elf Pointer to an ELF descriptor of kind ELF_K_ELF. src Pointer to a GElf_Ehdr structure that holds the calleras desired header contents. Must not be NULL. RETURN VALUE On success, gelf_update_ehdr() returns a non-zero value. On failure, it returns 0 and sets elf_errno. If elf is NULL, then 0 is returned without setting elf_errno. SEE ALSO gelf_getehdr(3), gelf_newehdr(3), elf_flagehdr(3), libelf(3), elf(5) ATTRIBUTES allbox; lbx lb lb l l l. Interface Attribute Value T{ gelf_update_ehdr() T} Thread safety MT-Safe REPORTING BUGS Report bugs to or https://source- ware.org/bugzilla/. Libelf 2025-09-17 GELF_UPDATE_EHDR(3)