Description

For a 32-bit class file, elf32_getehdr() returns a pointer to an ELF
header, if one is available for the ELF descriptor elf. If no
header exists for the descriptor, elf32_newehdr() allocates a clean one, but it
otherwise behaves the same as elf32_getehdr(). It does not allocate a new
header if one exists already. If no header exists for elf32_getehdr(), one cannot
be created for elf32_newehdr(), a system error occurs, the file is not
a 32-bit class file, or elf is NULL, both functions return a
null pointer.

The elf32_newehdr() function automatically sets the ELF_F_DIRTY bit. See elf_flagdata(3ELF).

An application can use elf_getident() to inspect the identification bytes from a
file.

An application can use elf_getshnum() and elf_getshstrndx() to obtain section header information.
The location of this section header information differs between standard ELF files
to those that require Extended Sections.