1 .\" Copyright (c) 2006 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
36 .Nd manipulate flags associated with ELF(3) data structures
42 .Fn elf_flagdata "Elf_Data *data" "Elf_Cmd cmd" "unsigned int flags"
44 .Fn elf_flagehdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
46 .Fn elf_flagelf "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
48 .Fn elf_flagphdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
50 .Fn elf_flagscn "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
52 .Fn elf_flagshdr "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
54 These functions are used to query, set or reset flag bits on data
55 structures associated with an ELF file.
62 denote the data structures whose status bits need to be changed.
63 These values are allowed to be NULL to simplify error handling in
68 may have the following values:
69 .Bl -tag -width ELF_C_SET
73 specifies the bits to be cleared.
77 specifies the bits to be set.
82 is allowed to have the following bits set:
83 .Bl -tag -width ELF_F_LAYOUT
85 Mark the associated data structure as needing to be written back
86 to the underlying file.
89 will resynchronize the library's internal data structures.
91 This flag is only valid with the
94 It informs the library that the application will take
95 responsibility for the layout of the file and that the library is
96 not to insert any padding in between sections.
99 Marking a given data structure as
101 affects all of its contained elements.
102 Thus marking an ELF descriptor
105 .Fn elf_flagelf "elf" "ELF_C_SET" "ELF_F_DIRTY"
106 means that the entire contents of the descriptor are
109 Using a value of zero for argument
111 will return the current set of flags for the data structure being
114 These functions return the updated bits is successful, and zero if
115 an error is detected.
117 These functions may fail with the following errors:
118 .Bl -tag -width "[ELF_E_RESOURCE]"
119 .It Bq Er ELF_E_ARGUMENT
120 An unsupported value was used for the
123 .It Bq Er ELF_E_ARGUMENT
126 had unsupported flag bits set.
127 .It Bq Er ELF_E_ARGUMENT
130 was not a descriptor for an ELF object.
131 .It Bq Er ELF_E_SEQUENCE
134 was called without an executable header being allocated.
135 .It Bq Er ELF_E_SEQUENCE
138 was called without a program header being allocated.
142 .Xr elf32_newehdr 3 ,
143 .Xr elf32_newphdr 3 ,
144 .Xr elf32_newshdr 3 ,
145 .Xr elf64_newehdr 3 ,
146 .Xr elf64_newphdr 3 ,
147 .Xr elf64_newshdr 3 ,
154 .Xr gelf_update_dyn 3 ,
155 .Xr gelf_update_move 3 ,
156 .Xr gelf_update_rel 3 ,
157 .Xr gelf_update_rela 3 ,
158 .Xr gelf_update_sym 3 ,
159 .Xr gelf_update_syminfo 3