2 .\" Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ELF32_GETEHDR 3ELF "Jun 19, 2002"
8 elf32_getehdr, elf32_newehdr, elf64_getehdr, elf64_newehdr \- retrieve
9 class-dependent object file header
13 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
16 \fBElf32_Ehdr *\fR\fBelf32_getehdr\fR(\fBElf *\fR\fIelf\fR);
21 \fBElf32_Ehdr *\fR\fBelf32_newehdr\fR(\fBElf *\fR\fIelf\fR);
26 \fBElf64_Ehdr *\fR\fBelf64_getehdr\fR(\fBElf *\fR\fIelf\fR);
31 \fBElf64_Ehdr *\fR\fBelf64_newehdr\fR(\fBElf *\fR\fIelf\fR);
37 For a 32-bit class file, \fBelf32_getehdr()\fR returns a pointer to an
38 \fBELF\fR header, if one is available for the \fBELF\fR descriptor \fIelf\fR.
39 If no header exists for the descriptor, \fBelf32_newehdr()\fR allocates a clean
40 one, but it otherwise behaves the same as \fBelf32_getehdr()\fR. It does not
41 allocate a new header if one exists already. If no header exists for
42 \fBelf32_getehdr()\fR, one cannot be created for \fBelf32_newehdr()\fR, a
43 system error occurs, the file is not a 32-bit class file, or \fIelf\fR is
44 \fINULL\fR, both functions return a null pointer.
47 For the 64\(mibit class, replace 32 with 64 as appropriate.
50 The header includes the following members:
54 unsigned char e_ident[EI_NIDENT];
63 Elf32_Half e_phentsize;
65 Elf32_Half e_shentsize;
67 Elf32_Half e_shstrndx;
73 The \fBelf32_newehdr()\fR function automatically sets the \fBELF_F_DIRTY\fR
74 bit. See \fBelf_flagdata\fR(3ELF).
77 An application can use \fBelf_getident()\fR to inspect the identification bytes
81 An application can use \fBelf_getshnum()\fR and \fBelf_getshstrndx()\fR to
82 obtain section header information. The location of this section header
83 information differs between standard \fBELF\fR files to those that require
88 See \fBattributes\fR(5) for descriptions of the following attributes:
96 ATTRIBUTE TYPE ATTRIBUTE VALUE
98 Interface Stability Stable
106 \fBelf\fR(3ELF), \fBelf_begin\fR(3ELF), \fBelf_flagdata\fR(3ELF),
107 \fBelf_getident\fR(3ELF), \fBelf_getshnum\fR(3ELF),
108 \fBelf_getshstrndx\fR(3ELF), \fBlibelf\fR(3LIB), \fBattributes\fR(5)