1 .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
33 .Nd retrieve an ELF program header table
39 .Fn elf32_getphdr "Elf *elf"
41 .Fn elf64_getphdr "Elf *elf"
44 .Fn gelf_getphdr "Elf *elf" "int index" "GElf_Phdr *dst"
46 These functions retrieve and translate ELF program header information
47 from an ELF descriptor, if this information exists.
53 return a pointer to an array of translated
57 descriptors respectively.
58 These descriptors are described in
60 The number of entries in this array may be determined using the
66 will retrieve the program header table entry at index
70 The translated program header table entry will be written to the
71 address pointed to be argument
74 Applications may inform the library of modifications to a program header table entry
78 Applications using the
80 interface need to use the
81 .Xr gelf_update_phdr 3
82 API to copy modifications to a program header entry back to the underlying
85 The functions a valid pointer if successful, or NULL in case an error
88 These functions may fail with the following errors:
89 .Bl -tag -width "[ELF_E_RESOURCE]"
90 .It Bq Er ELF_E_ARGUMENT
94 .It Bq Er ELF_E_ARGUMENT
97 was not a descriptor for an ELF object.
98 .It Bq Er ELF_E_ARGUMENT
102 .It Bq Er ELF_E_ARGUMENT
106 .It Bq Er ELF_E_CLASS
107 The class of ELF descriptor
109 did not match the expected class of the function being called.
110 .It Bq Er ELF_E_HEADER
113 did not possess an executable header.
114 .It Bq Er ELF_E_HEADER
117 had a corrupt executable header.
118 .It Bq Er ELF_E_RESOURCE
119 An out of memory condition was detected.
120 .It Bq Er ELF_E_SECTION
121 The ELF descriptor in argument
123 did not adhere to the conventions used for extended numbering.
124 .It Bq Er ELF_VERSION
127 was of an unsupported version.
131 .Xr elf32_getehdr 3 ,
132 .Xr elf32_newphdr 3 ,
133 .Xr elf64_getehdr 3 ,
134 .Xr elf64_newphdr 3 ,
140 .Xr gelf_update_phdr 3 ,