1 .\" Copyright (c) 2006-2008 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
37 .Nd manipulate flags associated with ELF(3) data structures
43 .Fn elf_flagarhdr "Elf_Arhdr *arhdr" "Elf_Cmd cmd" "unsigned int flags"
45 .Fn elf_flagdata "Elf_Data *data" "Elf_Cmd cmd" "unsigned int flags"
47 .Fn elf_flagehdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
49 .Fn elf_flagelf "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
51 .Fn elf_flagphdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
53 .Fn elf_flagscn "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
55 .Fn elf_flagshdr "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
57 These functions are used to query, set or reset flags on data
58 structures associated with an ELF file.
66 denote the data structures whose flags need to be changed.
67 These values are allowed to be NULL to simplify error handling in
72 may have the following values:
73 .Bl -tag -width ELF_C_SET
77 specifies the flags to be cleared.
81 specifies the flags to be set.
86 is allowed to have the following flags set:
87 .Bl -tag -width ELF_F_ARCHIVE_SYSV
89 This flag is only valid with the
92 It informs the library that the application desires to create an
97 should have been opened for writing using the
101 .It Dv ELF_F_ARCHIVE_SYSV
102 This flag is used in conjunction with the
104 flag to indicate that library should create archives that conform
105 to System V layout rules.
106 The default is to create BSD style archives.
108 Mark the associated data structure as needing to be written back
109 to the underlying file.
112 will resynchronize the library's internal data structures.
114 This flag is only valid with the
117 It informs the library that the application will take
118 responsibility for the layout of the file and that the library is
119 not to insert any padding in between sections.
122 Marking a given data structure as
124 affects all of its contained elements.
125 Thus marking an ELF descriptor
128 .Fn elf_flagelf "elf" "ELF_C_SET" "ELF_F_DIRTY"
129 means that the entire contents of the descriptor are
132 Using a value of zero for argument
134 will return the current set of flags for the data structure being
137 These functions return the updated flags is successful, and zero if
138 an error is detected.
145 .Dv ELF_F_ARCHIVE_SYSV
146 flags are an extension to the ELF(3) API.
148 These functions may fail with the following errors:
149 .Bl -tag -width "[ELF_E_RESOURCE]"
150 .It Bq Er ELF_E_ARGUMENT
151 An unsupported value was used for the
154 .It Bq Er ELF_E_ARGUMENT
157 had unsupported flags set.
158 .It Bq Er ELF_E_ARGUMENT
161 was not a descriptor for an ELF object.
165 flag was used with an ELF descriptor that had not been opened for writing.
166 .It Bq Er ELF_E_SEQUENCE
169 was called without an executable header being allocated.
170 .It Bq Er ELF_E_SEQUENCE
173 was called without a program header being allocated.
177 .Xr elf32_newehdr 3 ,
178 .Xr elf32_newphdr 3 ,
179 .Xr elf32_newshdr 3 ,
180 .Xr elf64_newehdr 3 ,
181 .Xr elf64_newphdr 3 ,
182 .Xr elf64_newshdr 3 ,
189 .Xr gelf_update_dyn 3 ,
190 .Xr gelf_update_move 3 ,
191 .Xr gelf_update_rel 3 ,
192 .Xr gelf_update_rela 3 ,
193 .Xr gelf_update_sym 3 ,
194 .Xr gelf_update_syminfo 3