This function may fail with the following errors:
[ELF_E_ARGUMENT]
Argument elf was null.
[ELF_E_ARGUMENT]
Argument cmd was not recognized.
[ELF_E_ARGUMENT]
The argument elf was not a descriptor for an ELF object.
[ELF_E_CLASS]
The e_ident[EI_CLASS] field of the executable header of argument elf did not match the class of the file.
[ELF_E_DATA]
An Elf_Data descriptor contained in argument elf specified a type incompatible with its containing section.
[ELF_E_HEADER]
The ELF header in argument elf requested a different byte order from the byte order already associated with the file.
[ELF_E_IO]
An I/O error was encountered.
[ELF_E_LAYOUT]
An Elf_Data descriptor contained in argument elf specified an alignment incompatible with its containing section.
[ELF_E_LAYOUT]
Argument elf contained section descriptors that overlapped in extent.
[ELF_E_LAYOUT]
Argument elf contained section descriptors that were incorrectly aligned or were too small for their data.
[ELF_E_LAYOUT]
The flag ELF_F_LAYOUT was set on the Elf descriptor and the section header table overlapped an extent in the object mapped by a section descriptor.
[ELF_E_MODE]
An ELF_C_WRITE operation was requested with an ELF descriptor that was not opened for writing or updating.
[ELF_E_SECTION]
Argument elf contained a section with an unrecognized type.
[ELF_E_SECTION]
The section header at index SHN_UNDEF had an illegal section type.
[ELF_E_SEQUENCE]
An ELF_C_WRITE operation was requested after a prior call to elf_cntl(elf, ELF_C_FDDONE) disassociated the ELF descriptor elf from its underlying file.
[ELF_E_VERSION]
Argument elf had an unsupported version or contained an Elf_Data descriptor with an unsupported version.