These functions are used to query, set or reset flags on data
structures associated with an ELF file.
Arguments
arhdr,
data,
elf
and
scn
denote the data structures whose flags need to be changed.
These values should have been returned by prior calls to
functions in the
elf(3)
API set:
These values are allowed to be NULL to simplify error handling in
application code.
Argument
cmd
may have the following values:
ELF_C_CLR
|
|
The argument
flags
specifies the flags to be cleared.
|
ELF_C_SET
|
|
The argument
flags
specifies the flags to be set.
|
The argument
flags
is allowed to have the following flags set:
ELF_F_ARCHIVE
|
This flag is only valid with the
elf_flagelf()
API.
It informs the library that the application desires to create an
ar(1)
archive.
Argument
elf
should have been opened for writing using the
ELF_C_WRITE
command to function
elf_begin().
|
ELF_F_ARCHIVE_SYSV
|
|
This flag is used in conjunction with the
ELF_F_ARCHIVE
flag to indicate that library should create archives that conform
to System V layout rules.
The default is to create BSD style archives.
|
ELF_F_DIRTY
|
Mark the associated data structure as needing to be written back
to the underlying file.
A subsequent call to
elf_update(3)
will resynchronize the library's internal data structures.
|
ELF_F_LAYOUT
|
This flag is only valid with the
elf_flagelf()
API.
It informs the library that the application will take
responsibility for the layout of the file and that the library is
not to insert any padding in between sections.
|
Marking a given data structure as
"dirty"
affects all of its contained elements.
Thus marking an ELF descriptor
elf
with
elf_flagelf(elf, ELF_C_SET, ELF_F_DIRTY)
means that the entire contents of the descriptor are
"dirty".
Using a value of zero for argument
flags
will return the current set of flags for the data structure being
queried.