'\" te .\" Copyright 1989 AT&T Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights Reserved. .TH elf_flagdata 3ELF "8 September 2014" "SunOS 5.11" "ELF Library Functions" .SH NAME elf_flagdata, elf_flagehdr, elf_flagelf, elf_flagphdr, elf_flagscn, elf_flagshdr \- manipulate flags .SH SYNOPSIS .LP .nf cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lelf\fR [ \fIlibrary\fR ... ] #include \fBuint_t\fR \fBelf_flagdata\fR(\fBElf_Data *\fR\fIdata\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .LP .nf \fBuint_t\fR \fBelf_flagehdr\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .LP .nf \fBuint_t\fR \fBelf_flagelf\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .LP .nf \fBuint_t\fR \fBelf_flagphdr\fR(\fBElf *\fR\fIelf\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .LP .nf \fBuint_t\fR \fBelf_flagscn\fR(\fBElf_Scn *\fR\fIscn\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .LP .nf \fBuint_t\fR \fBelf_flagshdr\fR(\fBElf_Scn *\fR\fIscn\fR, \fBElf_Cmd\fR \fIcmd\fR, \fBuint_t\fR \fIflags\fR); .fi .SH DESCRIPTION .sp .LP These functions manipulate the flags associated with various structures of an \fBELF\fR file. Given an \fBELF\fR descriptor (\fIelf\fR), a data descriptor (\fIdata\fR), or a section descriptor (\fIscn\fR), the functions may set or clear the associated status bits, returning the updated bits. A null descriptor is allowed, to simplify error handling; all functions return \fB0\fR for this degenerate case. .sp .LP \fIcmd\fR may have the following values: .sp .ne 2 .mk .na \fB\fBELF_C_CLR\fR\fR .ad .RS 13n .rt The functions clear the bits that are asserted in \fIflags\fR. Only the non-zero bits in \fIflags\fR are cleared; zero bits do not change the status of the descriptor. .RE .sp .ne 2 .mk .na \fB\fBELF_C_SET\fR\fR .ad .RS 13n .rt The functions set the bits that are asserted in \fIflags\fR. Only the non-zero bits in \fIflags\fR are set; zero bits do not change the status of the descriptor. .RE .sp .LP Descriptions of the defined \fIflags\fR bits appear below: .sp .ne 2 .mk .na \fB\fBELF_F_DIRTY\fR\fR .ad .RS 16n .rt When the program intends to write an \fBELF\fR file, this flag asserts the associated information needs to be written to the file. Thus, for example, a program that wished to update the \fBELF\fR header of an existing file would call \fBelf_flagehdr()\fR with this bit set in \fIflags\fR and \fIcmd\fR equal to \fBELF_C_SET\fR. A later call to \fBelf_update()\fR would write the marked header to the file. .RE .sp .ne 2 .mk .na \fB\fBELF_F_LAYOUT\fR\fR .ad .RS 16n .rt Normally, the library decides how to arrange an output file. That is, it automatically decides where to place sections, how to align them in the file, etc. If this bit is set for an \fBELF\fR descriptor, the program assumes responsibility for determining all file positions. This bit is meaningful only for \fBelf_flagelf()\fR and applies to the entire file associated with the descriptor. .RE .sp .LP When a flag bit is set for an item, it affects all the subitems as well. Thus, for example, if the program sets the \fBELF_F_DIRTY\fR bit with \fBelf_flagelf()\fR, the entire logical file is ``dirty.'' .SH EXAMPLES .LP \fBExample 1 \fRA sample display of calling the \fBelf_flagdata()\fR function. .sp .LP The following fragment shows how one might mark the \fBELF\fR header to be written to the output file: .sp .in +2 .nf /* dirty ehdr \|.\|.\|. */ ehdr = elf32_getehdr(elf); elf_flagehdr(elf, ELF_C_SET, ELF_F_DIRTY); .fi .in -2 .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBelf\fR(3ELF), \fBelf32_getehdr\fR(3ELF), \fBelf_getdata\fR(3ELF), \fBelf_update\fR(3ELF), \fBattributes\fR(5)