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

A class that provides a general interface to loading a module. More...

#include <format.h>

Inheritance diagram for Linker::InputFormat:
Linker::Format AOut::AOutFormat AS86Obj::AS86ObjFormat COFF::COFFFormat ELF::ELFFormat O65::O65Format OMF::OMFFormat Microsoft::PEFormat

Public Member Functions

virtual void SetupOptions (std::shared_ptr< OutputFormat > format)
 Initializes the reader for linking purposes.
 
virtual void ProduceModule (Module &module, Reader &rd)=0
 Reads a file and loads the information into a module object.
 
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.
 
- 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.
 
virtual void ReadFile (Reader &in)=0
 Loads file into memory.
 
virtual void WriteFile (Writer &out)=0
 Stores data in memory to file.
 
virtual void Dump (Dumper::Dumper &dump)
 Display file contents in a nice manner.
 

Additional Inherited Members

- Public Attributes inherited from Linker::Format
offset_t file_offset
 

Detailed Description

A class that provides a general interface to loading a module.

Member Function Documentation

◆ FormatProvidesResources()

bool InputFormat::FormatProvidesResources ( ) const
virtual

Whether the format supports resources.

Formats such as NE, LE/LX, PE and the Macintosh classic support including resources in the final binary. To simplify writing resources, the ELF parser permits incorporating them directly in the binary image as $$RSRC$_<type>$<id>.

◆ FormatProvidesSegmentation()

bool InputFormat::FormatProvidesSegmentation ( ) const
virtual

Whether the format enables multiple x86 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>

◆ FormatRequiresDataStreamFix()

bool InputFormat::FormatRequiresDataStreamFix ( ) const
virtual

Whether the generated file might contain bugs that require fixing.

Reimplemented in COFF::COFFFormat.

◆ ProduceModule()

virtual void Linker::InputFormat::ProduceModule ( Module & module,
Reader & rd )
pure virtual

Reads a file and loads the information into a module object.

Implemented in AOut::AOutFormat, AS86Obj::AS86ObjFormat, COFF::COFFFormat, ELF::ELFFormat, O65::O65Format, and OMF::OMFFormat.

◆ SetupOptions()

void InputFormat::SetupOptions ( std::shared_ptr< OutputFormat > format)
virtual

Initializes the reader for linking purposes.

Parameters
formatThe output format that will be used. This is required to know which extra special features need to be implemented (such as segmentation).

Reimplemented in COFF::COFFFormat, and ELF::ELFFormat.


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