Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ elf32_newphdr(3E) — IRIX 6.5.3f

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

elf(3E)



ELFGETPHDR(3E)                                                ELFGETPHDR(3E)



NAME
     elfgetphdr: elf32getphdr, elf32newphdr, elf64getphdr, elf64newphdr -
     retrieve class-dependent program header table

SYNOPSIS
     cc [flag ...] file ...  -lelf [library ...]

     #include <libelf.h>

Elf32Phdr *elf32getphdr(Elf *elf);
Elf32Phdr *elf32newphdr(Elf *elf, sizet count);
Elf64Phdr *elf64getphdr(Elf *elf);
Elf64Phdr *elf64newphdr(Elf *elf, sizet count); DESCRIPTION For a 32-bit class file, elf32getphdr returns a pointer to the program execution header table, if one is available for the ELF descriptor elf. elf32newphdr allocates a new table with count entries, regardless of whether one existed previously, and sets the ELFFDIRTY bit for the table [see elfflag(3E)]. Specifying a zero count deletes an existing table. Note this behavior differs from that of elf32newehdr [see elf32getehdr(3E)], allowing a program to replace or delete the program header table, changing its size if necessary. If no program header table exists, the file is not a 32-bit class file, an error occurs, or elf is null, both functions return a null pointer. Additionally, elf32newphdr returns a null pointer if count is zero. The table is an array of Elf32Phdr structures, each of which includes the following members. Elf32Word ptype; Elf32Off poffset; Elf32Addr pvaddr; Elf32Addr ppaddr; Elf32Word pfilesz; Elf32Word pmemsz; Elf32Word pflags; Elf32Word palign; The ELF header's ephnum member tells how many entries the program header table has [see elfgetehdr(3E)]. A program may inspect this value to determine the size of an existing table; elf32newphdr automatically sets the member's value to count. If the program is building a new file, it is responsible for creating the file's ELF header before creating the program header table. The 64-bit class works identically, simply replacing all instances of 32 in the description and table with 64. Page 1


ELFGETPHDR(3E)                                                ELFGETPHDR(3E)



SEE ALSO
     elf(3E), elfbegin(3E), elfflag(3E), elfgetehdr(3E).





















































                                                                        Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026