RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
PharLap::P3FormatContainer Class Reference

Container for Phar Lap "P2"/"P3" .exp files, used when reading in a P2/P3 file. More...

#include <pharlap.h>

Inheritance diagram for PharLap::P3FormatContainer:
Linker::OutputFormat Linker::Format Linker::Image

Public Member Functions

void ReadFile (Linker::Reader &rd) override
 Loads file into memory.
 
bool FormatSupportsSegmentation () const override
 Whether the format supports multiple segments.
 
void SetOptions (std::map< std::string, std::string > &options) override
 Passes command line parameters as settings over to format object.
 
std::string GetDefaultExtension (Linker::Module &module, std::string filename) const override
 Appends a default extension to the filename.
 
void ProcessModule (Linker::Module &module) override
 Processes the module object and initializes format fields.
 
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.
 
offset_t WriteFile (Linker::Writer &wr) const override
 Stores data in memory to file.
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
- Public Member Functions inherited from Linker::OutputFormat
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.
 
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 GenerateFile (std::string filename, Module &module)
 The main function that handles processing, calculating and generating the final image.
 
virtual std::string GetDefaultExtension (Module &module) const
 Provides a default filename for the output file.
 
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 Member Functions inherited from Linker::Format
 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.
 
- Public Member Functions inherited from Linker::Image
virtual std::shared_ptr< const ActualImageAsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< ActualImageAsImage ()
 Retrieves a randomly accessible image.
 

Public Attributes

std::unique_ptr< P3Formatcontents
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 

Detailed Description

Container for Phar Lap "P2"/"P3" .exp files, used when reading in a P2/P3 file.

Member Function Documentation

◆ CalculateValues()

void P3FormatContainer::CalculateValues ( )
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.

◆ Dump()

void P3FormatContainer::Dump ( Dumper::Dumper & dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ FormatSupportsSegmentation()

bool P3FormatContainer::FormatSupportsSegmentation ( ) const
overridevirtual

Whether the format supports multiple segments.

This is typically true for Intel 8086 targets and false for non-Intel targets. The ELF parser uses this to provide extended relocations, including the following:

  • $$SEG$<section name>
  • $$SEGOF$<symbol name>
  • $$SEGAT$<symbol name>
  • $$WRTSEG$<symbol name>$<section name>
  • $$SEGDIF$<section name>$<section name>

Reimplemented from Linker::OutputFormat.

◆ GetDefaultExtension()

std::string P3FormatContainer::GetDefaultExtension ( Linker::Module & module,
std::string filename ) const
overridevirtual

Appends a default extension to the filename.

A typical behavior would be to append .exe at the end of the filename. The default action is to leave it intact.

Reimplemented from Linker::OutputFormat.

◆ ProcessModule()

void P3FormatContainer::ProcessModule ( Linker::Module & object)
overridevirtual

Processes the module object and initializes format fields.

Reimplemented from Linker::OutputFormat.

◆ ReadFile()

void P3FormatContainer::ReadFile ( Linker::Reader & rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ SetOptions()

void P3FormatContainer::SetOptions ( std::map< std::string, std::string > & options)
overridevirtual

Passes command line parameters as settings over to format object.

Reimplemented from Linker::OutputFormat.

◆ WriteFile()

offset_t P3FormatContainer::WriteFile ( Linker::Writer & wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.


The documentation for this class was generated from the following files: