1 .\" $NetBSD: gelf_getphdr.3,v 1.2 2014/03/09 16:58:04 christos Exp $
3 .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" This software is provided by Joseph Koshy ``as is'' and
15 .\" any express or implied warranties, including, but not limited to, the
16 .\" implied warranties of merchantability and fitness for a particular purpose
17 .\" are disclaimed. in no event shall Joseph Koshy be liable
18 .\" for any direct, indirect, incidental, special, exemplary, or consequential
19 .\" damages (including, but not limited to, procurement of substitute goods
20 .\" or services; loss of use, data, or profits; or business interruption)
21 .\" however caused and on any theory of liability, whether in contract, strict
22 .\" liability, or tort (including negligence or otherwise) arising in any way
23 .\" out of the use of this software, even if advised of the possibility of
26 .\" Id: gelf_getphdr.3 189 2008-07-20 10:38:08Z jkoshy
35 .Nd retrieve an ELF program header table
41 .Fn elf32_getphdr "Elf *elf"
43 .Fn elf64_getphdr "Elf *elf"
46 .Fn gelf_getphdr "Elf *elf" "int index" "GElf_Phdr *dst"
48 These functions retrieve and translate ELF program header information
49 from an ELF descriptor, if this information exists.
55 return a pointer to an array of translated
59 descriptors respectively.
60 These descriptors are described in
62 The number of entries in this array may be determined using the
68 will retrieve the program header table entry at index
72 The translated program header table entry will be written to the
73 address pointed to be argument
76 Applications may inform the library of modifications to a program header table entry
80 Applications using the
82 interface need to use the
83 .Xr gelf_update_phdr 3
84 API to copy modifications to a program header entry back to the underlying
87 The functions a valid pointer if successful, or NULL in case an error
90 These functions may fail with the following errors:
91 .Bl -tag -width "[ELF_E_RESOURCE]"
92 .It Bq Er ELF_E_ARGUMENT
96 .It Bq Er ELF_E_ARGUMENT
99 was not a descriptor for an ELF object.
100 .It Bq Er ELF_E_ARGUMENT
104 .It Bq Er ELF_E_ARGUMENT
108 .It Bq Er ELF_E_CLASS
109 The class of ELF descriptor
111 did not match the expected class of the function being called.
112 .It Bq Er ELF_E_HEADER
115 did not possess an executable header.
116 .It Bq Er ELF_E_HEADER
119 had a corrupt executable header.
120 .It Bq Er ELF_E_RESOURCE
121 An out of memory condition was detected.
122 .It Bq Er ELF_E_SECTION
123 The ELF descriptor in argument
125 did not adhere to the conventions used for extended numbering.
126 .It Bq Er ELF_VERSION
129 was of an unsupported version.
133 .Xr elf32_getehdr 3 ,
134 .Xr elf32_newphdr 3 ,
135 .Xr elf64_getehdr 3 ,
136 .Xr elf64_newphdr 3 ,
142 .Xr gelf_update_phdr 3 ,