wavelength 1.0.0
Loading...
Searching...
No Matches
Tools::NameIrx Namespace Reference

Writer of the module name into the .iopmod header of an IRX. More...

Classes

struct  Error
 Failure returned through std::expected. More...

Functions

std::expected< std::vector< std::uint8_t >, Error > nameIrx (std::span< const std::uint8_t > data)
 Return the IRX with the module name written into its .iopmod header.

Detailed Description

Writer of the module name into the .iopmod header of an IRX.

Function Documentation

◆ nameIrx()

std::expected< std::vector< std::uint8_t >, Error > Tools::NameIrx::nameIrx ( std::span< const std::uint8_t > data)

Return the IRX with the module name written into its .iopmod header.

The name comes from the ModuleInfo record that the header points to. The rest of the file moves by the growth of the header, rounded to the alignment of the loadable segment, and the ELF, program, and section headers are adjusted to match.

Parameters
dataThe IRX file.
Returns
The rewritten file, or the input when the header already has a name. An ErrorCode::InvalidInput error when the file is not an IRX or its layout cannot be rewritten.