ElfBuilder.addSection

uint addSection(string name, uint type, ulong flags, const(ubyte)[] data = null, uint link = 0, uint info = 0, ulong addralign = 1, ulong entsize = 0)

Add a section to the ELF file.

The null section (index 0) is automatically added as the first section. The section name is automatically added to the section header string table.

Parameters

nameThe section name.
typeThe section type.
flagsThe section flags.
dataThe section data (can be null for NOBITS sections).
linkThe section link field (default: 0).
infoThe section info field (default: 0).
addralignThe section alignment (default: 1).
entsizeThe entry size if section contains entries (default: 0).

Returns

The section index.