Index: head/lib/libelf/elf_strptr.3 =================================================================== --- head/lib/libelf/elf_strptr.3 (revision 165535) +++ head/lib/libelf/elf_strptr.3 (revision 165536) @@ -1,112 +1,116 @@ .\" Copyright (c) 2006 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" This software is provided by Joseph Koshy ``as is'' and .\" any express or implied warranties, including, but not limited to, the .\" implied warranties of merchantability and fitness for a particular purpose .\" are disclaimed. in no event shall Joseph Koshy be liable .\" for any direct, indirect, incidental, special, exemplary, or consequential .\" damages (including, but not limited to, procurement of substitute goods .\" or services; loss of use, data, or profits; or business interruption) .\" however caused and on any theory of liability, whether in contract, strict .\" liability, or tort (including negligence or otherwise) arising in any way .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" .\" $FreeBSD$ .\" -.Dd August 29, 2006 +.Dd December 16, 2006 .Os .Dt ELF_STRPTR 3 .Sh NAME .Nm elf_strptr .Nd retrieve a string pointer in a string table .Sh LIBRARY .Lb libelf .Sh SYNOPSIS .In libelf.h .Ft "char *" .Fn elf_strptr "Elf *elf" "size_t scndx" "size_t stroffset" .Sh DESCRIPTION Function .Fn elf_strptr allows an application to convert a string table offset to a string pointer, correctly translating the offset in the presence of multiple .Vt Elf_Data descriptors covering the contents of the section. .Pp Argument .Ar elf is a descriptor for an ELF object. Argument .Ar scndx is the section index for an ELF string table. Argument .Ar stroffset is the index of the desired string in the string table. .Sh RETURN VALUES Function .Fn elf_strptr returns a valid pointer on success or NULL in case an error was encountered. .Sh ERRORS .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was NULL .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was not a descriptor for an ELF object. .It Bq Er ELF_E_ARGUMENT Argument .Ar scndx was not the section index for a string table. .It Bq Er ELF_E_ARGUMENT Argument .Ar stroffset exceeeded the size of the string table. .It Bq Er ELF_E_ARGUMENT Argument .Ar stroffset index an unallocated region of the string table. .It Bq Er ELF_E_DATA Offset .Ar stroffset indexed a region that was not covered by any Elf_Data descriptor. .It Bq Er ELF_E_DATA An erroneous .Vt Elf_Data descriptor was part of the section specified by argument .Ar scndx . .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf contained an invalid section header. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. .It Bq Er ELF_E_SECTION Section .Ar scndx contained a malformed section header. +.It Bq Er ELF_E_SECTION +The ELF descriptor in argument +.Ar elf +did not adhere to the conventions used for extended numbering. .El .Sh SEE ALSO .Xr elf 3 , .Xr elf32_getshdr 3 , .Xr elf64_getshdr 3 , .Xr elf_getdata 3 , .Xr elf_rawdata 3 , .Xr gelf 3 , .Xr gelf_getshdr 3 Index: head/lib/libelf/elf_update.3 =================================================================== --- head/lib/libelf/elf_update.3 (revision 165535) +++ head/lib/libelf/elf_update.3 (revision 165536) @@ -1,277 +1,281 @@ .\" Copyright (c) 2006 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" This software is provided by Joseph Koshy ``as is'' and .\" any express or implied warranties, including, but not limited to, the .\" implied warranties of merchantability and fitness for a particular purpose .\" are disclaimed. in no event shall Joseph Koshy be liable .\" for any direct, indirect, incidental, special, exemplary, or consequential .\" damages (including, but not limited to, procurement of substitute goods .\" or services; loss of use, data, or profits; or business interruption) .\" however caused and on any theory of liability, whether in contract, strict .\" liability, or tort (including negligence or otherwise) arising in any way .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" .\" $FreeBSD$ .\" -.Dd August 29, 2006 +.Dd December 16, 2006 .Os .Dt ELF_UPDATE 3 .Sh NAME .Nm elf_update .Nd update an ELF descriptor .Sh LIBRARY .Lb libelf .Sh SYNOPSIS .In libelf.h .Ft off_t .Fn elf_update "Elf *elf" "Elf_Cmd cmd" .Sh DESCRIPTION Function .Fn elf_update causes the library to recalculate the structure of an ELF object and optionally write out the image of the object to file. .Pp Argument .Ar elf is a descriptor to an ELF object. Argument .Ar cmd can take on the following values: .Bl -tag -width "ELF_C_WRITE" .It Dv ELF_C_NULL The library will recalculate structural information flagging modified structures with the .Dv ELF_F_DIRTY flag, but will not write back data to the underlying file image. .It Dv ELF_C_WRITE The library will recalculate structural information and will also write the new image to the underlying file. .El .Ss File Layout If the .Dv ELF_F_LAYOUT flag has been set on the ELF descriptor, the application assumes full responsibility for the layout of the ELF object. If this bit is not set, the ELF library will compute the layout of the file from its associated section descriptors. .Pp It is the application's responsibility to manage the the following structure members in the ELF file: .Bl -tag -width indent .It "Executable Header" The ELF executable header is described in .Xr elf 5 . The following members of the ELF executable header are the application's responsibility: .Pp .Bl -tag -width "e_ident[EI_OSABI]" -compact .It Va e_entry Set to the desired entry address for executables. .It Va e_flags Set to the desired processor specific flags. .It Va "e_ident[EI_DATA]" Must be set to one of .Dv ELFDATA2LSB or .Dv ELFDATA2MSB . .It Va "e_ident[EI_OSABI]" Set to the OS ABI desired. For .Fx executables, this field should be set to .Dv ELFOSABI_FREEBSD . .It Va e_machine Set to the desired machine architecture, one of the .Dv EM_* values in .In sys/elf_common.h . .It Va e_phoff If the application is managing the object's layout, it must set this field to the file offset of the ELF program header table. .It Va e_shoff If the application is managing the object's layout, it must set this field to the file offset of the ELF section header table. .It Va e_shstrndx Set to the index of the string table containing section names. .It Va e_type Set to the type of the ELF object, one of the .Dv ET_* values in .In sys/elf_common.h . .It Va e_version Set to the desired version of the ELF object. .El .It "Program Header" All fields of the entries in the program header table are under application control. .It "Section Header" The ELF section header is described in .Xr elf 5 . The following members of the ELF section header are the application's responsibility: .Pp .Bl -tag -width "sh_addralign" -compact .It Va sh_addr Set to the physical memory address where the section should reside. .It Va sh_addralign If the application is managing the file layout, it must set this field to the desired alignment for the section's contents. This value must be a power of two. .It Va sh_entsize Set to the size of each entry, for sections containing fixed size elements, or set to zero for sections without fixed size elements. For section contents of types known to the library, the application may leave this field as zero. .It Va sh_flags Set to the desired section flags. .It Va sh_info Set as described in .Xr elf 5 . .It Va sh_link Set as described in .Xr elf 5 . .It Va sh_name Set to the index of the section's name in the string table containing section names. .It Va sh_offset If the application is managing the file layout, it must set this field to the file offset of the section's contents. .It Va sh_size If the application is managing the file layout, it must set this field to the file size of the section's contents. .It Va sh_type Set to the type of the section. .El .El .Pp Gaps in the coverage of the file's contents will be set to the fill value specified by .Xr elf_fill 3 . .Pp If the application has requested full control over the file's layout by setting the .Dv ELF_F_LAYOUT flag on the ELF descriptor, it should ensure that there are no gaps in the coverage of the file's contents. .Pp All pointers to .Vt Elf_Scn and .Vt Elf_Data descriptors associated with descriptor .Ar elf should be considered as invalid after a call to .Fn elf_update . .Sh RETURN VALUES Function .Fn elf_update returns the total size of the file image if successful, or -1 if an error occurred. .Sh ERRORS This function may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was null. .It Bq Er ELF_E_ARGUMENT Argument .Ar cmd was not recognized. .It Bq Er ELF_E_ARGUMENT The argument .Ar elf was not a descriptor for an ELF object. .It Bq Er ELF_E_CLASS The .Va e_ident[EI_CLASS] field of the executable header of argument .Ar elf did not match the class of the file. .It Bq Er ELF_E_DATA An .Vt Elf_Data descriptor contained in argument .Ar elf specified a type incompatible with its containing section. .It Bq Er ELF_E_HEADER The ELF header in argument .Ar elf requested a different byte order from the byte order already associated with the file. .It Bq Er ELF_E_IO An I/O error was encountered. .It Bq Er ELF_E_LAYOUT An .Vt Elf_Data descriptor contained in argument .Ar elf specified an alignment incompatible with its containing section. .It Bq Er ELF_E_LAYOUT Argument .Ar elf contained section descriptors that overlapped in extent. .It Bq Er ELF_E_LAYOUT Argument .Ar elf contained section descriptors that were incorrectly aligned or were too small for their data. .It Bq Er ELF_E_MODE An .Dv ELF_C_WRITE operation was requested with an ELF descriptor that was not opened for writing or updating. .It Bq Er ELF_E_SECTION Argument .Ar elf contained a section with an unrecognized type. +.It Bq Er ELF_E_SECTION +The section header at index +.Dv SHN_UNDEF +had an illegal section type. .It Bq Er ELF_E_SEQUENCE An .Dv ELF_C_WRITE operation was requested after a prior call to .Fn elf_cntl elf ELF_C_FDDONE disassociated the ELF descriptor .Ar elf from its underlying file. .It Bq Er ELF_E_VERSION Argument .Ar elf had an unsupported version or contained an .Vt Elf_Data descriptor with an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , .Xr elf32_getehdr 3 , .Xr elf32_getphdr 3 , .Xr elf32_newehdr 3 , .Xr elf32_newphdr 3 , .Xr elf64_getehdr 3 , .Xr elf64_getphdr 3 , .Xr elf64_newehdr 3 , .Xr elf64_newphdr 3 , .Xr elf_cntl 3 , .Xr elf_fill 3 , .Xr elf_flagehdr 3 , .Xr elf_flagelf 3 , .Xr elf_getdata 3 , .Xr elf_getscn 3 , .Xr elf_newdata 3 , .Xr elf_newscn 3 , .Xr elf_rawdata 3 , .Xr gelf 3 , .Xr gelf_newehdr 3 , .Xr gelf_newphdr 3 , .Xr elf 5 Index: head/lib/libelf/gelf_getehdr.3 =================================================================== --- head/lib/libelf/gelf_getehdr.3 (revision 165535) +++ head/lib/libelf/gelf_getehdr.3 (revision 165536) @@ -1,119 +1,123 @@ .\" Copyright (c) 2006 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" This software is provided by Joseph Koshy ``as is'' and .\" any express or implied warranties, including, but not limited to, the .\" implied warranties of merchantability and fitness for a particular purpose .\" are disclaimed. in no event shall Joseph Koshy be liable .\" for any direct, indirect, incidental, special, exemplary, or consequential .\" damages (including, but not limited to, procurement of substitute goods .\" or services; loss of use, data, or profits; or business interruption) .\" however caused and on any theory of liability, whether in contract, strict .\" liability, or tort (including negligence or otherwise) arising in any way .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" .\" $FreeBSD$ .\" -.Dd July 6, 2006 +.Dd December 16, 2006 .Os .Dt GELF_GETEHDR 3 .Sh NAME .Nm elf32_getehdr , .Nm elf64_getehdr , .Nm gelf_getehdr .Nd retrieve the object file header .Sh LIBRARY .Lb libelf .Sh SYNOPSIS .In libelf.h .Ft "Elf32_Ehdr *" .Fn elf32_getehdr "Elf *elf" .Ft "Elf64_Ehdr *" .Fn elf64_getehdr "Elf *elf" .In gelf.h .Ft "Gelf_Ehdr *" .Fn gelf_getehdr "Elf *elf" "Gelf_Ehdr *dst" .Sh DESCRIPTION These functions retrieve the ELF object file header from the ELF descriptor .Ar elf and return a translated header descriptor to their callers. .Pp Functions .Fn elf32_getehdr and .Fn elf64_getehdr return a pointer to the appropriate class-specific header descriptor if it exists in the file referenced by descriptor .Ar elf . These functions return .Dv NULL if an ELF header was not found in file .Ar elf . .Pp Function .Fn gelf_getehdr stores a translated copy of the header for ELF file .Ar elf into the descriptor pointed to by argument .Ar dst . It returns argument .Ar dst if successful or .Dv NULL in case of failure. .Sh RETURN VALUES These functions return a pointer to a translated header descriptor if successful, or NULL on failure. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT The argument .Ar elf was null. .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was not a descriptor for an ELF file. .It Bq Er ELF_E_ARGUMENT The elf class of descriptor .Ar elf was not recognized. .It Bq Er ELF_E_ARGUMENT Argument .Ar dst was null. .It Bq Er ELF_E_CLASS The ELF class of descriptor .Ar elf did not match that of the API function being called. .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf does not have an associated header. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected during execution. +.It Bq Er ELF_E_SECTION +The ELF descriptor in argument +.Ar elf +did not adhere to the conventions used for extended numbering. .It Bq Er ELF_E_VERSION The ELF descriptor .Ar elf had an unsupported ELF version number. .El .Sh SEE ALSO .Xr elf 3 , .Xr elf32_newehdr 3 , .Xr elf64_newehdr 3 , .Xr elf_flagehdr 3 , .Xr elf_getident 3 , .Xr gelf 3 , .Xr gelf_newehdr 3 , .Xr elf 5 Index: head/lib/libelf/gelf_getphdr.3 =================================================================== --- head/lib/libelf/gelf_getphdr.3 (revision 165535) +++ head/lib/libelf/gelf_getphdr.3 (revision 165536) @@ -1,137 +1,141 @@ .\" Copyright (c) 2006 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" This software is provided by Joseph Koshy ``as is'' and .\" any express or implied warranties, including, but not limited to, the .\" implied warranties of merchantability and fitness for a particular purpose .\" are disclaimed. in no event shall Joseph Koshy be liable .\" for any direct, indirect, incidental, special, exemplary, or consequential .\" damages (including, but not limited to, procurement of substitute goods .\" or services; loss of use, data, or profits; or business interruption) .\" however caused and on any theory of liability, whether in contract, strict .\" liability, or tort (including negligence or otherwise) arising in any way .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" .\" $FreeBSD$ .\" -.Dd August 25, 2006 +.Dd December 16, 2006 .Os .Dt GELF_GETPHDR 3 .Sh NAME .Nm elf32_getphdr , .Nm elf64_getphdr , .Nm gelf_getphdr .Nd retrieve an ELF program header table .Sh LIBRARY .Lb libelf .Sh SYNOPSIS .In libelf.h .Ft "Elf32_Phdr *" .Fn elf32_getphdr "Elf *elf" .Ft "Elf64_Phdr *" .Fn elf64_getphdr "Elf *elf" .In gelf.h .Ft "GElf_Phdr *" .Fn gelf_getphdr "Elf *elf" "int index" "GElf_Phdr *dst" .Sh DESCRIPTION These functions retrieve and translate ELF program header information from an ELF descriptor, if this information exists. .Pp Functions .Fn elf32_getphdr and .Fn elf64_getphdr return a pointer to an array of translated .Vt Elf32_Phdr and .Vt Elf64_Phdr descriptors respectively. These descriptors are described in .Xr elf 5 . The number of entries in this array is specified by the .Va e_phnum field of the executable header for ELF descriptor .Ar elf . .Pp Function .Fn gelf_getphdr will retrieve the program header table entry at index .Ar index from ELF descriptor .Ar elf. The translated program header table entry will be written to the address pointed to be argument .Ar dst . .Pp Applications may inform the library of modifications to a program header table entry by using the .Xr elf_flagphdr 3 API. Applications using the .Xr gelf 3 interface need to use the .Xr gelf_update_phdr 3 API to copy modifications to a program header entry back to the underlying ELF descriptor. .Sh RETURN VALUES The functions a valid pointer if successful, or NULL in case an error was encountered. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was NULL. .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was not a descriptor for an ELF object. .It Bq Er ELF_E_ARGUMENT Argument .Ar dst was NULL. .It Bq Er ELF_E_ARGUMENT Index .Ar index was out of range. .It Bq Er ELF_E_CLASS The class of ELF descriptor .Ar elf did not match the expected class of the function being called. .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf did not possess an executable header. .It Bq Er ELF_E_HEADER ELF descriptor .Ar elf had a corrupt executable header. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected. +.It Bq Er ELF_E_SECTION +The ELF descriptor in argument +.Ar elf +did not adhere to the conventions used for extended numbering. .It Bq Er ELF_VERSION ELF descriptor .Ar elf was of an unsupported version. .El .Sh SEE ALSO .Xr elf 3 , .Xr elf32_getehdr 3 , .Xr elf32_newphdr 3 , .Xr elf64_getehdr 3 , .Xr elf64_newphdr 3 , .Xr elf_flagphdr 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 , .Xr gelf_newphdr 3 , .Xr gelf_update_phdr 3 , .Xr elf 5 Index: head/lib/libelf/gelf_newehdr.3 =================================================================== --- head/lib/libelf/gelf_newehdr.3 (revision 165535) +++ head/lib/libelf/gelf_newehdr.3 (revision 165536) @@ -1,181 +1,185 @@ .\" Copyright (c) 2006 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" This software is provided by Joseph Koshy ``as is'' and .\" any express or implied warranties, including, but not limited to, the .\" implied warranties of merchantability and fitness for a particular purpose .\" are disclaimed. in no event shall Joseph Koshy be liable .\" for any direct, indirect, incidental, special, exemplary, or consequential .\" damages (including, but not limited to, procurement of substitute goods .\" or services; loss of use, data, or profits; or business interruption) .\" however caused and on any theory of liability, whether in contract, strict .\" liability, or tort (including negligence or otherwise) arising in any way .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" .\" $FreeBSD$ .\" -.Dd July 6, 2006 +.Dd December 16, 2006 .Os .Dt GELF_NEWEHDR 3 .Sh NAME .Nm elf32_newehdr , .Nm elf64_newehdr , .Nm gelf_newehdr .Nd retrieve or allocate the object file header .Sh LIBRARY .Lb libelf .Sh SYNOPSIS .In libelf.h .Ft "Elf32_Ehdr *" .Fn elf32_newehdr "Elf *elf" .Ft "Elf64_Ehdr *" .Fn elf64_newehdr "Elf *elf" .In gelf.h .Ft "void *" .Fn gelf_newehdr "Elf *elf" "int elfclass" .Sh DESCRIPTION These functions retrieve the ELF header from the ELF descriptor .Ar elf , allocating a new header if needed. File data structures are translated to their in-memory representations as described in .Xr elf 3 . .Pp Function .Fn elf32_newehdr returns a pointer to a 32 bit .Vt Elf32_Ehdr structure. Function .Fn elf64_newehdr returns a pointer to a 64 bit .Vt Elf64_Ehdr structure. .Pp When argument .Ar elfclass has value .Dv ELFCLASS32 , function .Fn gelf_newehdr returns the value returned by .Fn elf32_newehdr "elf" . When argument .Ar elfclass has value .Dv ELFCLASS64 it returns the value returned by .Fn elf64_newehdr "elf" . .Pp If a fresh header structure is allocated, the members of the structure are initialized as follows: .Bl -tag -width indent .It Va "e_ident[EI_MAG0..EI_MAG3]" Identification bytes at offsets .Dv EI_MAG0 , .Dv EI_MAG1 , .Dv EI_MAG2 and .Dv EI_MAG3 are set to the ELF signature. .It Va "e_ident[EI_CLASS]" The identification byte at offset .Dv EI_CLASS is set to the ELF class associated with the function being called or to argument .Ar elfclass for function .Fn gelf_newehdr . .It Va "e_ident[EI_DATA]" The identification byte at offset .Dv EI_DATA is set to .Dv ELFDATANONE . .It Va "e_ident[EI_VERSION]" The identification byte at offset .Dv EI_VERSION is set to the ELF library's operating version set by a prior call to .Xr elf_version 3 . .It Va e_machine is set to .Dv EM_NONE . .It Va e_type is set to .Dv ELF_K_NONE . .It Va e_version is set to the ELF library's operating version set by a prior call to .Xr elf_version 3 . .El .Pp Other members of the header are set to zero. The application is responsible for changing these values as needed before calling .Fn elf_update . .Pp If successful, these three functions set the .Dv ELF_F_DIRTY bit on ELF descriptor .Ar elf . .Sh RETURN VALUES These functions return a pointer to a translated header descriptor if successful, or NULL on failure. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" .It Bq Er ELF_E_ARGUMENT The argument .Ar elf was null. .It Bq Er ELF_E_ARGUMENT Argument .Ar elf was not a descriptor for an ELF object. .It Bq Er ELF_E_ARGUMENT Argument .Ar elfclass had an unsupported value. .It Bq Er ELF_E_ARGUMENT The class of the ELF descriptor .Ar elf did not match that of the requested operation. .It Bq Er ELF_E_ARGUMENT For function .Fn gelf_newehdr , the class of argument .Ar elf was not .Dv ELFCLASSNONE and did not match the argument .Ar elfclass . .It Bq Er ELF_E_CLASS The ELF class of descriptor .Ar elf did not match that of the API function being called. .It Bq Er ELF_E_HEADER A malformed ELF header was detected. .It Bq Er ELF_E_RESOURCE An out of memory condition was detected during execution. +.It Bq Er ELF_E_SECTION +The ELF descriptor in argument +.Ar elf +did not adhere to the conventions used for extended numbering. .It Bq Er ELF_E_VERSION The ELF descriptor .Ar elf had an unsupported ELF version number. .El .Sh SEE ALSO .Xr elf 3 , .Xr elf32_getehdr 3 , .Xr elf64_getehdr 3 , .Xr elf_flagdata 3 , .Xr elf_getident 3 , .Xr elf_update 3 , .Xr elf_version 3 , .Xr gelf 3 , .Xr gelf_getehdr 3 , .Xr elf 5