1 .\" $NetBSD: gelf_getehdr.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_getehdr.3 189 2008-07-20 10:38:08Z jkoshy
35 .Nd retrieve the object file header
41 .Fn elf32_getehdr "Elf *elf"
43 .Fn elf64_getehdr "Elf *elf"
46 .Fn gelf_getehdr "Elf *elf" "GElf_Ehdr *dst"
48 These functions retrieve the ELF object file
49 header from the ELF descriptor
51 and return a translated header descriptor to their callers.
57 return a pointer to the appropriate class-specific header descriptor
58 if it exists in the file referenced by descriptor
60 These functions return
62 if an ELF header was not found in file
67 stores a translated copy of the header for ELF file
69 into the descriptor pointed to by argument
77 These functions return a pointer to a translated header descriptor
78 if successful, or NULL on failure.
80 These functions can fail with the following errors:
81 .Bl -tag -width "[ELF_E_RESOURCE]"
82 .It Bq Er ELF_E_ARGUMENT
86 .It Bq Er ELF_E_ARGUMENT
89 was not a descriptor for an ELF file.
90 .It Bq Er ELF_E_ARGUMENT
91 The elf class of descriptor
94 .It Bq Er ELF_E_ARGUMENT
99 The ELF class of descriptor
101 did not match that of the API function being called.
102 .It Bq Er ELF_E_HEADER
105 does not have an associated header.
106 .It Bq Er ELF_E_RESOURCE
107 An out of memory condition was detected during execution.
108 .It Bq Er ELF_E_SECTION
109 The ELF descriptor in argument
111 did not adhere to the conventions used for extended numbering.
112 .It Bq Er ELF_E_VERSION
115 had an unsupported ELF version number.
119 .Xr elf32_newehdr 3 ,
120 .Xr elf64_newehdr 3 ,