3 .\" Copyright (c) 2006,2007 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 .\" $FreeBSD: src/lib/libelf/elf_flagdata.3,v 1.3.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $
38 .Nd manipulate flags associated with ELF(3) data structures
44 .Fn elf_flagdata "Elf_Data *data" "Elf_Cmd cmd" "unsigned int flags"
46 .Fn elf_flagehdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
48 .Fn elf_flagelf "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
50 .Fn elf_flagphdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
52 .Fn elf_flagscn "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
54 .Fn elf_flagshdr "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
56 These functions are used to query, set or reset flags on data
57 structures associated with an ELF file.
64 denote the data structures whose flags need to be changed.
65 These values are allowed to be NULL to simplify error handling in
70 may have the following values:
71 .Bl -tag -width ELF_C_SET
75 specifies the flags to be cleared.
79 specifies the flags to be set.
84 is allowed to have the following flags set:
85 .Bl -tag -width ELF_F_LAYOUT
87 Mark the associated data structure as needing to be written back
88 to the underlying file.
91 will resynchronize the library's internal data structures.
93 This flag is only valid with the
96 It informs the library that the application will take
97 responsibility for the layout of the file and that the library is
98 not to insert any padding in between sections.
101 Marking a given data structure as
103 affects all of its contained elements.
104 Thus marking an ELF descriptor
107 .Fn elf_flagelf "elf" "ELF_C_SET" "ELF_F_DIRTY"
108 means that the entire contents of the descriptor are
111 Using a value of zero for argument
113 will return the current set of flags for the data structure being
116 These functions return the updated flags is successful, and zero if
117 an error is detected.
119 These functions may fail with the following errors:
120 .Bl -tag -width "[ELF_E_RESOURCE]"
121 .It Bq Er ELF_E_ARGUMENT
122 An unsupported value was used for the
125 .It Bq Er ELF_E_ARGUMENT
128 had unsupported flags set.
129 .It Bq Er ELF_E_ARGUMENT
132 was not a descriptor for an ELF object.
133 .It Bq Er ELF_E_SEQUENCE
136 was called without an executable header being allocated.
137 .It Bq Er ELF_E_SEQUENCE
140 was called without a program header being allocated.
144 .Xr elf32_newehdr 3 ,
145 .Xr elf32_newphdr 3 ,
146 .Xr elf32_newshdr 3 ,
147 .Xr elf64_newehdr 3 ,
148 .Xr elf64_newphdr 3 ,
149 .Xr elf64_newshdr 3 ,
156 .Xr gelf_update_dyn 3 ,
157 .Xr gelf_update_move 3 ,
158 .Xr gelf_update_rel 3 ,
159 .Xr gelf_update_rela 3 ,
160 .Xr gelf_update_sym 3 ,
161 .Xr gelf_update_syminfo 3