RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
UNIX archive format. More...
#include <arch.h>
Classes | |
class | File |
class | FileReader |
Public Types | |
typedef std::shared_ptr< Linker::Image > | file_reader_type(Linker::Reader &rd, offset_t size) |
typedef std::shared_ptr< Linker::Image > | file_reader1_type(Linker::Reader &rd) |
Public Member Functions | |
void | SetFileReader (std::shared_ptr< FileReader > file_reader) |
void | SetFileReader (std::shared_ptr< Linker::Image >(*file_reader)(Linker::Reader &rd, offset_t size)) |
void | SetFileReader (std::shared_ptr< Linker::Image >(*file_reader)(Linker::Reader &rd)) |
ArchiveFormat (std::shared_ptr< FileReader > file_reader=nullptr) | |
ArchiveFormat (std::shared_ptr< Linker::Image >(*file_reader)(Linker::Reader &rd, offset_t size)) | |
ArchiveFormat (std::shared_ptr< Linker::Image >(*file_reader)(Linker::Reader &rd)) | |
void | ReadFile (Linker::Reader &rd) override |
Loads file into memory. | |
offset_t | WriteFile (Linker::Writer &wr) const override |
Stores data in memory to file. | |
offset_t | ImageSize () const override |
Retrieves size of stored data. | |
void | Dump (Dumper::Dumper &dump) const override |
Display file contents in a nice manner. | |
void | GenerateModule (Linker::ModuleCollector &linker, std::string file_name, bool is_library=false) const override |
Loads the information into a module object. | |
void | CalculateValues () override |
Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields. | |
![]() | |
virtual void | SetupOptions (std::shared_ptr< OutputFormat > format) |
Initializes the reader for linking purposes. | |
virtual void | ProduceModule (ModuleCollector &linker, Reader &rd, std::string file_name) |
Reads a file and loads the information into a module object. | |
virtual void | ProduceModule (Module &module, Reader &rd) |
Reads a file and loads the information into a module object, a convenience method when there is a single module generated. | |
virtual void | GenerateModule (Module &module) const |
Loads the information into a module object, a convenience method when there is a single module generated. | |
virtual bool | FormatProvidesSegmentation () const |
Whether the format enables multiple x86 segments. | |
virtual bool | FormatRequiresDataStreamFix () const |
Whether the generated file might contain bugs that require fixing. | |
virtual bool | FormatProvidesResources () const |
Whether the format supports resources. | |
virtual bool | FormatProvidesLibraries () const |
Whether the format enables importing/exporting libraries. | |
![]() | |
Format (offset_t file_offset=0) | |
virtual void | Clear () |
Resets all fields to their default values, deallocate memory. | |
offset_t | ImageSize () const override |
Retrieves size of stored data. | |
offset_t | WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override |
Writes data of non-zero filled sections. | |
![]() | |
virtual std::shared_ptr< const ActualImage > | AsImage () const |
Retrieves a randomly accessible image. | |
std::shared_ptr< ActualImage > | AsImage () |
Retrieves a randomly accessible image. | |
![]() | |
virtual bool | AddSupplementaryOutputFormat (std::string subformat) |
If the output format actually drives multiple output formats (resource file, apple double, etc.), specify multiple types, return false if unknown. | |
virtual void | SetOptions (std::map< std::string, std::string > &options) |
Passes command line parameters as settings over to format object. | |
std::optional< std::string > | FetchOption (std::map< std::string, std::string > &options, std::string name) |
Convenience method to look up option by name. | |
std::string | FetchOption (std::map< std::string, std::string > &options, std::string name, std::string default_value) |
Convenience method to look up option by name, returning default value if name is missing. | |
std::optional< offset_t > | FetchIntegerOption (std::map< std::string, std::string > &options, std::string name) |
Convenience method to look up option by name and convert it to integer. | |
virtual void | SetModel (std::string model) |
Sets the way memory is organized, typically modifying a built-in script. | |
virtual void | SetLinkScript (std::string script_file, std::map< std::string, std::string > &options) |
Selects a script file to use for linking. | |
virtual void | ProcessModule (Module &object) |
Processes the module object and initializes format fields. | |
virtual void | GenerateFile (std::string filename, Module &module) |
The main function that handles processing, calculating and generating the final image. | |
virtual std::string | GetDefaultExtension (Module &module, std::string filename) const |
Appends a default extension to the filename. | |
virtual std::string | GetDefaultExtension (Module &module) const |
Provides a default filename for the output file. | |
virtual bool | FormatSupportsSegmentation () const |
Whether the format supports multiple segments. | |
virtual bool | FormatIs16bit () const |
Whether the format is 16-bit or not. | |
virtual bool | FormatIsLinear () const |
Whether the address space is linear or segmented. | |
virtual bool | FormatSupportsResources () const |
Whether the format supports resources. | |
virtual bool | FormatSupportsLibraries () const |
Whether the format supports libraries. | |
virtual unsigned | FormatAdditionalSectionFlags (std::string section_name) const |
Public Attributes | |
offset_t | file_offset = 0 |
offset_t | file_size = offset_t(-1) |
std::shared_ptr< FileReader > | file_reader = nullptr |
std::vector< File > | files |
![]() | |
offset_t | file_offset |
UNIX archive format.
|
overridevirtual |
Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
Display file contents in a nice manner.
Reimplemented from Linker::Format.
|
overridevirtual |
Loads the information into a module object.
Reimplemented from Linker::InputFormat.
|
overridevirtual |
Retrieves size of stored data.
Implements Linker::Image.
|
overridevirtual |
Loads file into memory.
Implements Linker::Format.
|
overridevirtual |
Stores data in memory to file.
Implements Linker::Format.