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 the object file header
39 .Fn elf32_getehdr "Elf *elf"
41 .Fn elf64_getehdr "Elf *elf"
44 .Fn gelf_getehdr "Elf *elf" "GElf_Ehdr *dst"
46 These functions retrieve the ELF object file
47 header from the ELF descriptor
49 and return a translated header descriptor to their callers.
55 return a pointer to the appropriate class-specific header descriptor
56 if it exists in the file referenced by descriptor
58 These functions return
60 if an ELF header was not found in file
65 stores a translated copy of the header for ELF file
67 into the descriptor pointed to by argument
75 These functions return a pointer to a translated header descriptor
76 if successful, or NULL on failure.
78 These functions can fail with the following errors:
79 .Bl -tag -width "[ELF_E_RESOURCE]"
80 .It Bq Er ELF_E_ARGUMENT
84 .It Bq Er ELF_E_ARGUMENT
87 was not a descriptor for an ELF file.
88 .It Bq Er ELF_E_ARGUMENT
89 The elf class of descriptor
92 .It Bq Er ELF_E_ARGUMENT
97 The ELF class of descriptor
99 did not match that of the API function being called.
100 .It Bq Er ELF_E_HEADER
103 does not have an associated header.
104 .It Bq Er ELF_E_RESOURCE
105 An out of memory condition was detected during execution.
106 .It Bq Er ELF_E_SECTION
107 The ELF descriptor in argument
109 did not adhere to the conventions used for extended numbering.
110 .It Bq Er ELF_E_VERSION
113 had an unsupported ELF version number.
117 .Xr elf32_newehdr 3 ,
118 .Xr elf64_newehdr 3 ,