2 .\" Copyright 1989 AT&T Copyright (c) 1996, 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 ELF_FLAGDATA 3ELF "Jul 11, 2001"
8 elf_flagdata, elf_flagehdr, elf_flagelf, elf_flagphdr, elf_flagscn,
9 elf_flagshdr \- manipulate flags
13 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ]
16 \fBunsigned\fR \fBelf_flagdata\fR(\fBElf_Data *\fR\fIdata\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
21 \fBunsigned\fR \fBelf_flagehdr\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
26 \fBunsigned\fR \fBelf_flagelf\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
31 \fBunsigned\fR \fBelf_flagphdr\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
36 \fBunsigned\fR \fBelf_flagscn\fR(\fBElf_Scn *\fR\fIscn\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
41 \fBunsigned\fR \fBelf_flagshdr\fR(\fBElf_Scn *\fR\fIscn\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBunsigned\fR \fIflags\fR);
47 These functions manipulate the flags associated with various structures of an
48 \fBELF\fR file. Given an \fBELF\fR descriptor (\fIelf\fR), a data descriptor
49 (\fIdata\fR), or a section descriptor (\fIscn\fR), the functions may set or
50 clear the associated status bits, returning the updated bits. A null descriptor
51 is allowed, to simplify error handling; all functions return \fB0\fR for this
55 \fIcmd\fR may have the following values:
62 The functions clear the bits that are asserted in \fIflags\fR. Only the
63 non-zero bits in \fIflags\fR are cleared; zero bits do not change the status of
73 The functions set the bits that are asserted in \fIflags\fR. Only the non-zero
74 bits in \fIflags\fR are set; zero bits do not change the status of the
80 Descriptions of the defined \fIflags\fR bits appear below:
84 \fB\fBELF_F_DIRTY\fR\fR
87 When the program intends to write an \fBELF\fR file, this flag asserts the
88 associated information needs to be written to the file. Thus, for example, a
89 program that wished to update the \fBELF\fR header of an existing file would
90 call \fBelf_flagehdr()\fR with this bit set in \fIflags\fR and \fIcmd\fR equal
91 to \fBELF_C_SET\fR. A later call to \fBelf_update()\fR would write the marked
98 \fB\fBELF_F_LAYOUT\fR\fR
101 Normally, the library decides how to arrange an output file. That is, it
102 automatically decides where to place sections, how to align them in the file,
103 etc. If this bit is set for an \fBELF\fR descriptor, the program assumes
104 responsibility for determining all file positions. This bit is meaningful only
105 for \fBelf_flagelf()\fR and applies to the entire file associated with the
111 When a flag bit is set for an item, it affects all the subitems as well. Thus,
112 for example, if the program sets the \fBELF_F_DIRTY\fR bit with
113 \fBelf_flagelf()\fR, the entire logical file is ``dirty.''
116 \fBExample 1 \fRA sample display of calling the \fBelf_flagdata()\fR function.
119 The following fragment shows how one might mark the \fBELF\fR header to be
120 written to the output file:
125 \fB/* dirty ehdr \|.\|.\|. */
126 ehdr = elf32_getehdr(elf);
127 elf_flagehdr(elf, ELF_C_SET, ELF_F_DIRTY);\fR
134 See \fBattributes\fR(5) for descriptions of the following attributes:
142 ATTRIBUTE TYPE ATTRIBUTE VALUE
144 Interface Stability Stable
152 \fBelf\fR(3ELF), \fBelf32_getehdr\fR(3ELF), \fBelf_getdata\fR(3ELF),
153 \fBelf_update\fR(3ELF), \fBattributes\fR(5)