Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gelf_getshdr(3) [freebsd man page]

GELF_GETSHDR(3) 					   BSD Library Functions Manual 					   GELF_GETSHDR(3)

NAME
elf32_getshdr, elf64_getshdr, gelf_getshdr -- retrieve the class-dependent section header LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <libelf.h> Elf32_Shdr * elf32_getshdr(Elf_Scn *scn); Elf64_Shdr * elf64_getshdr(Elf_Scn *scn); #include <gelf.h> GElf_Shdr * gelf_getshdr(Elf_Scn *scn, GElf_Shdr *shdr); DESCRIPTION
These functions return a pointer to the ELF Section Header data structure associated with section descriptor scn. Function elf32_getshdr() retrieves a pointer to an Elf32_Shdr structure. Section descriptor scn must be associated with an ELF descriptor of class ELFCLASS32. Function elf64_getshdr() retrieves a pointer to an Elf64_Shdr structure. Section descriptor scn must be associated with an ELF descriptor of class ELFCLASS64. Function gelf_getshdr() copies the values in the section header associated with argument scn to the structure pointed to be argument dst. The GElf_Shdr data structure is described in gelf(3). RETURN VALUES
Functions elf32_getshdr() and elf64_getshdr() return a valid pointer to the appropriate section header on success or NULL if an error was encountered. Function gelf_getshdr() returns argument dst if successful, or NULL if an error was encountered. ERRORS
These functions may fail with the following errors: [ELF_E_ARGUMENT] Arguments scn or shdr were NULL. [ELF_E_ARGUMENT] Argument scn was not associated a descriptor for an ELF object. [ELF_E_CLASS] The ELF class associated with the section descriptor scn did not match the class expected by the API. SEE ALSO
elf(3), elf_getscn(3), gelf(3), gelf_update_shdr(3) BSD
August 27, 2006 BSD

Check Out this Related Man Page

GELF_UPDATE_EHDR(3)					   BSD Library Functions Manual 				       GELF_UPDATE_EHDR(3)

NAME
gelf_update_ehdr, gelf_update_phdr, gelf_update_shdr -- update underlying ELF data structures LIBRARY
ELF Access Library (libelf, -lelf) SYNOPSIS
#include <gelf.h> int gelf_update_ehdr(Elf *elf, GElf_Ehdr *ehdr); int gelf_update_phdr(Elf *elf, int ndx, GElf_Phdr *phdr); int gelf_update_shdr(Elf_Scn *scn, GElf_Shdr *shdr); DESCRIPTION
These functions are used to update ELF data structures on the underlying ELF descriptor. Class-dependent data structures in the underlying ELF descriptor are updated using the data in the class-independent GElf descriptors and the underlying ELF data structures are marked ``dirty''. The conversion process signals an error if the values being copied to the target ELF data structure would exceed representation limits. GElf descriptors are described in gelf(3). Function gelf_update_ehdr() updates the ELF Executable Header with the values in the class-independent executable header ehdr. Function gelf_update_phdr() updates the ELF Program Header structure at index ndx with the values in the class-independent program header phdr. Function gelf_update_shdr() updates the ELF Section Header structure associated with section descriptor scn with the values in argument shdr. RETURN VALUES
These functions return a non-zero integer on success, or zero in case of an error. ERRORS
These functions may fail with the following errors: [ELF_E_ARGUMENT] Arguments elf, ehdr, phdr, scn, or shdr were NULL. [ELF_E_ARGUMENT] Argument elf was not a descriptor for an ELF object. [ELF_E_ARGUMENT] Argument elf had an unsupported ELF class. [ELF_E_ARGUMENT] Argument ndx exceeded the number of entries in the program header table. [ELF_E_ARGUMENT] Section descriptor scn was not associated with an ELF descriptor. [ELF_E_MODE] ELF descriptor elf was not opened for writing or updating. [ELF_E_RESOURCE] An out of memory condition was detected. SEE ALSO
elf(3), elf_flagelf(3), elf_flagphdr(3), elf_flagshdr(3), gelf(3), gelf_getehdr(3), gelf_getphdr(3), gelf_getshdr(3) BSD
August 27, 2006 BSD
Man Page