ELFGETSHDR(3E) ELFGETSHDR(3E)
NAME
elfgetshdr: elf32getshdr, elf64getshdr - retrieve class-dependent
section header
SYNOPSIS
cc [flag ...] file ... -lelf [library ...]
#include <libelf.h>
Elf32Shdr *elf32getshdr(ElfScn *scn);
Elf64Shdr *elf32getshdr(ElfScn *scn);
DESCRIPTION
For a 32-bit class file, elf32getshdr returns a pointer to a section
header for the section descriptor scn. Otherwise, the file is not a 32-
bit class file, scn was null, or an error occurred; elf32getshdr then
returns null.
The header includes the following members.
Elf32Word shname;
Elf32Word shtype;
Elf32Word shflags;
Elf32Addr shaddr;
Elf32Off shoffset;
Elf32Word shsize;
Elf32Word shlink;
Elf32Word shinfo;
Elf32Word shaddralign;
Elf32Word shentsize;
If the program is building a new file, it is responsible for creating the
file's ELF header before creating sections.
The 64-bit class works identically, simply replacing all instances of 32
in the description and table with 64.
SEE ALSO
elf(3E), elfflag(3E), elfgetscn(3E), elfstrptr(3E).
Page 1