6001 strcat(9f) needs a manpage
[unleashed.git] / usr / src / man / man3elf / elf32_getshdr.3elf
blob62e2878e586cc5756e1a1e007ed1ee4b78aea8f6
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2001, 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_GETSHDR 3ELF "Jul 11, 2001"
7 .SH NAME
8 elf32_getshdr, elf64_getshdr \- retrieve class-dependent section header
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
13 #include <libelf.h>
15 \fBElf32_Shdr *\fR\fBelf32_getshdr\fR(\fBElf_Scn *\fR\fIscn\fR);
16 .fi
18 .LP
19 .nf
20 \fBElf64_Shdr *\fR\fBelf64_getshdr\fR(\fBElf_Scn *\fR\fIscn\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 For a 32-bit class file, \fBelf32_getshdr()\fR returns a pointer to a section
27 header for the section descriptor \fIscn\fR. Otherwise, the file is not a
28 32-bit class file, \fIscn\fR was \fINULL,\fR or an error occurred;
29 \fBelf32_getshdr()\fR then returns \fINULL\fR.
30 .sp
31 .LP
32 The  \fBelf32_getshdr\fR header includes the following members:
33 .sp
34 .in +2
35 .nf
36 \fBElf32_Word   sh_name;
37 Elf32_Word      sh_type;
38 Elf32_Word      sh_flags;
39 Elf32_Addr      sh_addr;
40 Elf32_Off       sh_offset;
41 Elf32_Word      sh_size;
42 Elf32_Word      sh_link;
43 Elf32_Word      sh_info;
44 Elf32_Word      sh_addralign;
45 Elf32_Word      sh_entsize;\fR
46 .fi
47 .in -2
49 .sp
50 .LP
51 while the  \fBelf64_getshdr\fR header includes the following members:
52 .sp
53 .in +2
54 .nf
55 \fBElf64_Word   sh_name;
56 Elf64_Word      sh_type;
57 Elf64_Xword     sh_flags;
58 Elf64_Addr      sh_addr;
59 Elf64_Off       sh_offset;
60 Elf64_Xword     sh_size;
61 Elf64_Word      sh_link;
62 Elf64_Word      sh_info;
63 Elf64_Xword     sh_addralign;
64 Elf64_Xword     sh_entsize;\fR
65 .fi
66 .in -2
68 .sp
69 .LP
70 For the 64\(mibit class, replace 32 with 64 as appropriate.
71 .sp
72 .LP
73 If the program is building a new file, it is responsible for creating the
74 file's \fBELF\fR header before creating sections.
75 .SH ATTRIBUTES
76 .sp
77 .LP
78 See \fBattributes\fR(5) for descriptions of the following attributes:
79 .sp
81 .sp
82 .TS
83 box;
84 c | c
85 l | l .
86 ATTRIBUTE TYPE  ATTRIBUTE VALUE
88 Interface Stability     Stable
90 MT-Level        MT-Safe
91 .TE
93 .SH SEE ALSO
94 .sp
95 .LP
96 \fBelf\fR(3ELF), \fBelf_flagdata\fR(3ELF), \fBelf_getscn\fR(3ELF),
97 \fBelf_strptr\fR(3ELF), \fBlibelf\fR(3LIB), \fBattributes\fR(5)