ELF_FLAGDATA(3ELF) | ELF Library Functions | ELF_FLAGDATA(3ELF) |
elf_flagdata, elf_flagehdr, elf_flagelf, elf_flagphdr, elf_flagscn, elf_flagshdr - manipulate flags
cc [ flag ... ] file ... -lelf [ library ... ] #include <libelf.h> unsigned elf_flagdata(Elf_Data *data, Elf_Cmd cmd, unsigned flags);
unsigned elf_flagehdr(Elf *elf, Elf_Cmd cmd, unsigned flags);
unsigned elf_flagelf(Elf *elf, Elf_Cmd cmd, unsigned flags);
unsigned elf_flagphdr(Elf *elf, Elf_Cmd cmd, unsigned flags);
unsigned elf_flagscn(Elf_Scn *scn, Elf_Cmd cmd, unsigned flags);
unsigned elf_flagshdr(Elf_Scn *scn, Elf_Cmd cmd, unsigned flags);
These functions manipulate the flags associated with various structures of an ELF file. Given an ELF descriptor (elf), a data descriptor (data), or a section descriptor (scn), the functions may set or clear the associated status bits, returning the updated bits. A null descriptor is allowed, to simplify error handling; all functions return 0 for this degenerate case.
cmd may have the following values:
ELF_C_CLR
ELF_C_SET
Descriptions of the defined flags bits appear below:
ELF_F_DIRTY
ELF_F_LAYOUT
When a flag bit is set for an item, it affects all the subitems as well. Thus, for example, if the program sets the ELF_F_DIRTY bit with elf_flagelf(), the entire logical file is ``dirty.''
Example 1 A sample display of calling the elf_flagdata() function.
The following fragment shows how one might mark the ELF header to be written to the output file:
/* dirty ehdr ... */ ehdr = elf32_getehdr(elf); elf_flagehdr(elf, ELF_C_SET, ELF_F_DIRTY);
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Stable |
MT-Level | MT-Safe |
elf(3ELF), elf32_getehdr(3ELF), elf_getdata(3ELF), elf_update(3ELF), attributes(7)
July 11, 2001 | OmniOS |