source: rtems-tools/rtemstoolkit/elftoolchain/libelf/elf_flagdata.3 @ 0c5db2d

5
Last change on this file since 0c5db2d was 0c5db2d, checked in by Chris Johns <chrisj@…>, on 04/29/18 at 01:55:37

rtemstoolkit: Update elftoolchain to the latest code.

The update is taken from https://github.com/elftoolchain/elftoolchain.

Update #3417

  • Property mode set to 100644
File size: 5.4 KB
Line 
1.\" Copyright (c) 2006-2008 Joseph Koshy.  All rights reserved.
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
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.
11.\"
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
22.\" such damage.
23.\"
24.\" $Id$
25.\"
26.Dd October 22, 2007
27.Os
28.Dt ELF_FLAGDATA 3
29.Sh NAME
30.Nm elf_flagarhdr ,
31.Nm elf_flagdata ,
32.Nm elf_flagehdr ,
33.Nm elf_flagelf ,
34.Nm elf_flagphdr ,
35.Nm elf_flagscn ,
36.Nm elf_flagshdr
37.Nd manipulate flags associated with ELF(3) data structures
38.Sh LIBRARY
39.Lb libelf
40.Sh SYNOPSIS
41.In libelf.h
42.Ft "unsigned int"
43.Fn elf_flagarhdr "Elf_Arhdr *arhdr" "Elf_Cmd cmd" "unsigned int flags"
44.Ft "unsigned int"
45.Fn elf_flagdata "Elf_Data *data" "Elf_Cmd cmd" "unsigned int flags"
46.Ft "unsigned int"
47.Fn elf_flagehdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
48.Ft "unsigned int"
49.Fn elf_flagelf "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
50.Ft "unsigned int"
51.Fn elf_flagphdr "Elf *elf" "Elf_Cmd cmd" "unsigned int flags"
52.Ft "unsigned int"
53.Fn elf_flagscn "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
54.Ft "unsigned int"
55.Fn elf_flagshdr "Elf_Scn *scn" "Elf_Cmd cmd" "unsigned int flags"
56.Sh DESCRIPTION
57These functions are used to query, set or reset flags on data
58structures associated with an ELF file.
59.Pp
60Arguments
61.Ar arhdr ,
62.Ar data ,
63.Ar elf
64and
65.Ar scn
66denote the data structures whose flags need to be changed.
67These values are allowed to be NULL to simplify error handling in
68application code.
69.Pp
70Argument
71.Ar cmd
72may have the following values:
73.Bl -tag -width ELF_C_SET
74.It Dv ELF_C_CLR
75The argument
76.Ar flags
77specifies the flags to be cleared.
78.It Dv ELF_C_SET
79The argument
80.Ar flags
81specifies the flags to be set.
82.El
83.Pp
84The argument
85.Ar flags
86is allowed to have the following flags set:
87.Bl -tag -width ELF_F_ARCHIVE_SYSV
88.It Dv ELF_F_ARCHIVE
89This flag is only valid with the
90.Fn elf_flagelf
91API.
92It informs the library that the application desires to create an
93.Xr ar 1
94archive.
95Argument
96.Ar elf
97should have been opened for writing using the
98.Dv ELF_C_WRITE
99command to function
100.Fn elf_begin .
101.It Dv ELF_F_ARCHIVE_SYSV
102This flag is used in conjunction with the
103.Dv ELF_F_ARCHIVE
104flag to indicate that library should create archives that conform
105to System V layout rules.
106The default is to create BSD style archives.
107.It Dv ELF_F_DIRTY
108Mark the associated data structure as needing to be written back
109to the underlying file.
110A subsequent call to
111.Xr elf_update 3
112will resynchronize the library's internal data structures.
113.It Dv ELF_F_LAYOUT
114This flag is only valid with the
115.Fn elf_flagelf
116API.
117It informs the library that the application will take
118responsibility for the layout of the file and that the library is
119not to insert any padding in between sections.
120.El
121.Pp
122Marking a given data structure as
123.Dq dirty
124affects all of its contained elements.
125Thus marking an ELF descriptor
126.Ar elf
127with
128.Fn elf_flagelf "elf" "ELF_C_SET" "ELF_F_DIRTY"
129means that the entire contents of the descriptor are
130.Dq dirty .
131.Pp
132Using a value of zero for argument
133.Ar flags
134will return the current set of flags for the data structure being
135queried.
136.Sh RETURN VALUES
137These functions return the updated flags is successful, and zero if
138an error is detected.
139.Sh COMPATIBILITY
140The
141.Fn elf_flagarhdr
142function and the
143.Dv ELF_F_ARCHIVE
144and
145.Dv ELF_F_ARCHIVE_SYSV
146flags are an extension to the ELF(3) API.
147.Sh ERRORS
148These functions may fail with the following errors:
149.Bl -tag -width "[ELF_E_RESOURCE]"
150.It Bq Er ELF_E_ARGUMENT
151An unsupported value was used for the
152.Ar cmd
153argument.
154.It Bq Er ELF_E_ARGUMENT
155Argument
156.Ar flags
157had unsupported flags set.
158.It Bq Er ELF_E_ARGUMENT
159The argument
160.Ar elf
161was not a descriptor for an ELF object.
162.It Bq Er ELF_E_MODE
163The
164.Dv ELF_F_ARCHIVE
165flag was used with an ELF descriptor that had not been opened for writing.
166.It Bq Er ELF_E_SEQUENCE
167Function
168.Fn elf_flagehdr
169was called without an executable header being allocated.
170.It Bq Er ELF_E_SEQUENCE
171Function
172.Fn elf_flagphdr
173was called without a program header being allocated.
174.El
175.Sh SEE ALSO
176.Xr elf 3 ,
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 ,
183.Xr elf_newdata 3 ,
184.Xr elf_update 3 ,
185.Xr gelf 3 ,
186.Xr gelf_newehdr 3 ,
187.Xr gelf_newphdr 3 ,
188.Xr gelf_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
Note: See TracBrowser for help on using the repository browser.