These functions are used to iterate through the sections associated with an ELF descriptor.
Function
elf_getscn() will return a section descriptor for the section at index
index in the object denoted by ELF descriptor
elf. An error will be signalled if the specified section does not exist.
Function
elf_ndxscn() returns the section table index associated with section descriptor
scn.
Function
elf_newscn() creates a new section and appends it to the list of sections associated with descriptor
elf. The library will automatically increment the
e_shnum field of the ELF header associated with descriptor
elf, and will set the
ELF_F_DIRTY flag on the returned section descriptor. For ELF descriptors opened for writing, the ELF library will automatically create an empty section at index zero (
SHN_UNDEF) on the first call to
elf_newscn().
Function
elf_nextscn() takes a section descriptor
scn and returns a pointer to the section descriptor at the next higher index. Argument
scn is allowed to be NULL, in which case this function will return a pointer to the section descriptor at index 1. If no further sections are present, function
elf_nextscn() will return a NULL pointer.