Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

elf_strptr(3) [netbsd man page]

ELF_STRPTR(3)						   BSD Library Functions Manual 					     ELF_STRPTR(3)

NAME
elf_strptr -- retrieve a string pointer in a string table LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> char * elf_strptr(Elf *elf, size_t scndx, size_t stroffset); DESCRIPTION
Function elf_strptr() allows an application to convert a string table offset to a string pointer, correctly translating the offset in the presence of multiple Elf_Data descriptors covering the contents of the section. Argument elf is a descriptor for an ELF object. Argument scndx is the section index for an ELF string table. Argument stroffset is the index of the desired string in the string table. RETURN VALUES
Function elf_strptr() returns a valid pointer on success or NULL in case an error was encountered. ERRORS
[ELF_E_ARGUMENT] Argument elf was NULL [ELF_E_ARGUMENT] Argument elf was not a descriptor for an ELF object. [ELF_E_ARGUMENT] Argument scndx was not the section index for a string table. [ELF_E_ARGUMENT] Argument stroffset exceeeded the size of the string table. [ELF_E_ARGUMENT] Argument stroffset index an unallocated region of the string table. [ELF_E_DATA] Offset stroffset indexed a region that was not covered by any Elf_Data descriptor. [ELF_E_DATA] An erroneous Elf_Data descriptor was part of the section specified by argument scndx. [ELF_E_HEADER] ELF descriptor elf contained an invalid section header. [ELF_E_RESOURCE] An out of memory condition was detected. [ELF_E_SECTION] Section scndx contained a malformed section header. [ELF_E_SECTION] The ELF descriptor in argument elf did not adhere to the conventions used for extended numbering. SEE ALSO
elf(3), elf32_getshdr(3), elf64_getshdr(3), elf_getdata(3), elf_rawdata(3), gelf(3), gelf_getshdr(3) BSD
December 16, 2006 BSD

Check Out this Related Man Page

ELF_GETSCN(3)						   BSD Library Functions Manual 					     ELF_GETSCN(3)

NAME
elf_getscn, elf_ndxscn, elf_newscn, elf_nextscn -- get/allocate section information for an ELF object LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> Elf_Scn * elf_getscn(Elf *elf, size_t index); size_t elf_ndxscn(Elf_Scn *scn); Elf_Scn * elf_newscn(Elf *elf); Elf_Scn * elf_nextscn(Elf *elf, Elf_Scn *scn); DESCRIPTION
These functions are used to iterate through the sections associated with an ELF descriptor. Function elf_getscn() will return a section descriptor for the section at index index in the object denoted by ELF descriptor elf. An error will be signalled if the specified section does not exist. Function elf_ndxscn() returns the section table index associated with section descriptor scn. Function elf_newscn() creates a new section and appends it to the list of sections associated with descriptor elf. The library will automat- ically increment the e_shnum field of the ELF header associated with descriptor elf, and will set the ELF_F_DIRTY flag on the returned sec- tion descriptor. For ELF descriptors opened for writing, the ELF library will automatically create an empty section at index zero (SHN_UNDEF) on the first call to elf_newscn(). Function elf_nextscn() takes a section descriptor scn and returns a pointer to the section descriptor at the next higher index. Argument scn is allowed to be NULL, in which case this function will return a pointer to the section descriptor at index 1. If no further sections are present, function elf_nextscn() will return a NULL pointer. RETURN VALUES
Functions elf_getscn(), elf_newscn() and elf_nextscn() return a valid pointer to a section descriptor if successful, or NULL if an error occurs. Function elf_ndxscn() returns a valid section table index if successful, or SHN_UNDEF if an error occurs. ERRORS
These functions may fail with the following errors: [ELF_E_ARGUMENT] Arguments elf or scn were NULL. [ELF_E_ARGUMENT] Argument index exceeded the current number of sections in the ELF object. [ELF_E_ARGUMENT] Argument elf was not a descriptor for an ELF file. [ELF_E_ARGUMENT] Section descriptor scn was not associated with ELF descriptor elf. [ELF_E_CLASS] Descriptor elf was of an unknown ELF class. [ELF_E_SECTION] Argument elf specified extended section numbering in the ELF header with the section header at index SHN_UNDEF not being of type SHT_NULL. SEE ALSO
elf(3), elf_flagdata(3), elf_flagscn(3), elf_getdata(3), elf_getshdr(3), gelf(3) BSD
October 22, 2007 BSD
Man Page