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

Intel Relocatable Object Module for the Intel MCS-96. More...

#include <omf.h>

Inheritance diagram for OMF::OMF96Format:
OMF::OMFFormat Linker::InputFormat Linker::Format Linker::Format Linker::Contents Linker::Contents

Classes

class  BlockDefinitionRecord
 
class  ExternalDefinition
 
class  ExternalDefinitionsRecord
 
class  Module
 
class  ModuleAncestorRecord
 
class  ModuleEndRecord
 
class  ModuleHeaderRecord
 
class  RelocationRecord
 
class  SegmentDefinition
 
class  SegmentDefinitionsRecord
 
class  SymbolDefinition
 
class  SymbolDefinitionsRecord
 
class  TypeDefinitionRecord
 
class  TypeIndex
 

Public Types

enum  record_type_t : uint8_t {
  ModuleHeader = OMF80Format::ModuleHeader , ModuleEnd = OMF80Format::ModuleEnd , Content = OMF80Format::Content , LineNumbers = OMF80Format::LineNumbers ,
  BlockDefinition = 0x0A , BlockEnd = 0x0C , EndOfFile = OMF80Format::EndOfFile , ModuleAncestor = OMF80Format::ModuleAncestor ,
  LocalSymbols = OMF80Format::LocalSymbols , TypeDefinition = 0x14 , PublicDefinitions = OMF80Format::PublicDefinitions , ExternalDefinitions = OMF80Format::ExternalDefinitions ,
  SegmentDefinitions = 0x20 , Relocations = OMF80Format::Relocations , LibraryModuleLocations = OMF80Format::LibraryModuleLocations , LibraryModuleNames = OMF80Format::LibraryModuleNames ,
  LibraryDictionary = OMF80Format::LibraryDictionary , LibraryHeader = 0x2E
}
 
enum  alignment_t { AlignByte = 0 , AlignWord = 1 , AlignLong = 2 }
 
typedef uint16_t index_t
 
using Record = OMFFormat::Record< record_type_t, OMF96Format, Module >
 
using UnknownRecord = OMFFormat::UnknownRecord< record_type_t, OMF96Format, Module >
 
using EmptyRecord = OMFFormat::EmptyRecord< record_type_t, OMF96Format, Module >
 
using ContentRecord = OMFFormat::ContentRecord< record_type_t, OMF96Format, Module >
 
using LineNumbersRecord = OMFFormat::LineNumbersRecord< record_type_t, OMF96Format, Module >
 
using LibraryHeaderRecord = OMFFormat::LibraryHeaderRecord< record_type_t, OMF96Format, Module >
 
using LibraryModuleNamesRecord = OMFFormat::LibraryModuleNamesRecord< record_type_t, OMF96Format, Module >
 
using LibraryModuleLocationsRecord = OMFFormat::LibraryModuleLocationsRecord< record_type_t, OMF96Format, Module >
 
using LibraryDictionaryRecord = OMFFormat::LibraryDictionaryRecord< record_type_t, OMF96Format, Module >
 
typedef uint8_t segment_id_t
 
- Public Types inherited from OMF::OMFFormat
typedef uint16_t index_t
 An index referring to an element or definition in the file, typically stored as 1 or 2 bytes, used for OMF86 and OMF96.
 

Public Member Functions

std::shared_ptr< Record > ReadRecord (const std::shared_ptr< Linker::Reader > &rd)
 Parses and returns an instance of the next record.
 
void ReadFile (const std::shared_ptr< Linker::Reader > &rd) override
 Loads file into memory.
 
offset_t WriteFile (const std::shared_ptr< 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.
 
void GenerateModule (Linker::Module &module) const override
 Loads the information into a module object, a convenience method when there is a single module generated.
 
- 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 SetFileOffset (offset_t new_offset)
 Attempts to alter the offset to the first byte of the format from the beginning of the file.
 
offset_t ImageSize () const override
 Retrieves the offset of the byte after the last one belonging to this format from the first one.
 
- Public Member Functions inherited from Linker::Contents
virtual std::shared_ptr< const Image > AsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< Image > AsImage ()
 Retrieves a randomly accessible image.
 
- Public Member Functions inherited from Linker::InputFormat
virtual void SetupOptions (std::shared_ptr< OutputFormat > format)
 Initializes the reader for linking purposes.
 
virtual void ProduceModule (ModuleCollector &linker, const std::shared_ptr< Reader > &rd, std::string file_name)
 Reads a file and loads the information into a module object.
 
virtual void ProduceModule (Module &module, const std::shared_ptr< 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 (ModuleCollector &linker, std::string file_name, bool is_library=false) const
 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 FormatProvidesTransitionVectors () const
 Whether the format supports generating transition vectors.
 
virtual bool FormatProvidesResources () const
 Whether the format supports resources.
 
virtual bool FormatProvidesLibraries () const
 Whether the format enables importing/exporting libraries.
 
virtual bool FormatProvidesEntryTable () const
 Whether the format supports a structure containing addresses of methods.
 

Static Public Member Functions

static std::shared_ptr< OMF96Format > ReadOMFFile (const std::shared_ptr< Linker::Reader > &rd)
 Parses an OMF96 file.
 
static void DumpAddFields (const Record *record, Dumper::Dumper &dump, Dumper::Region &region, const OMF96Format *omf, const Module *mod, size_t record_index, Dumper::display_option &options)
 
- Static Public Member Functions inherited from OMF::OMFFormat
static std::string ReadString (const std::shared_ptr< Linker::Reader > &rd, size_t max_bytes=size_t(-1))
 Reads a string prefixed with a length byte.
 
static void WriteString (const std::shared_ptr< ChecksumWriter > &wr, std::string text)
 Writes a string prefixed with a length byte.
 
static index_t ReadIndex (const std::shared_ptr< Linker::Reader > &rd)
 Parses a 1 or 2 byte index value.
 
static void WriteIndex (const std::shared_ptr< ChecksumWriter > &wr, index_t index)
 Produces a 1 or 2 byte index value.
 
static size_t IndexSize (index_t index)
 Determines if the index value requires 1 or 2 bytes to store.
 
static std::shared_ptr< OMFFormat > ReadOMFFile (const std::shared_ptr< Linker::Reader > &rd)
 Attempts to parse an OMF file, whether OMF80, OMF86, OMF51 or OMF96.
 

Public Attributes

std::vector< std::shared_ptr< Record > > records
 The ordered collection of records contained in the file.
 
std::vector< Module > modules
 List of modules appearing in an OMF file, typically only one for an object file.
 
- Public Attributes inherited from OMF::OMFFormat
offset_t file_size = 0
 Used to calculate record offsets when generating OMF file.
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 The offset of the first byte used by this format in the file it is stored in.
 

Static Public Attributes

static const std::map< offset_t, std::string > RecordTypeNames
 
static constexpr segment_id_t CodeSegment = 0
 
static constexpr segment_id_t DataSegment = 1
 
static constexpr segment_id_t RegisterSegment = 2
 
static constexpr segment_id_t OverlaySegment = 3
 
static constexpr segment_id_t StackSegment = 4
 
static constexpr segment_id_t DynamicSymbol = 5
 
static constexpr segment_id_t NullSegment = 6
 
static constexpr segment_id_t SegmentTypeMask = 7
 
static constexpr segment_id_t FlagBasedVariable = 0x40
 
static constexpr segment_id_t FlagRelocatableSegment = 0x80
 

Detailed Description

Intel Relocatable Object Module for the Intel MCS-96.

Member Function Documentation

◆ Dump()

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

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ GenerateModule()

void OMF96Format::GenerateModule ( Linker::Module &  module) const
overridevirtual

Loads the information into a module object, a convenience method when there is a single module generated.

Reimplemented from Linker::InputFormat.

◆ ReadFile()

void OMF96Format::ReadFile ( const std::shared_ptr< Linker::Reader > &  rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ WriteFile()

offset_t OMF96Format::WriteFile ( const std::shared_ptr< Linker::Writer > &  wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.

Member Data Documentation

◆ RecordTypeNames

const std::map< offset_t, std::string > OMF96Format::RecordTypeNames
static
Initial value:
=
{
{ OMF96Format::ModuleHeader, "Module header record" },
{ OMF96Format::ModuleEnd, "Module end record" },
{ OMF96Format::Content, "Content record" },
{ OMF96Format::LineNumbers, "Line numbers record" },
{ OMF96Format::BlockDefinition, "Block definition record" },
{ OMF96Format::BlockEnd, "Block end record" },
{ OMF96Format::EndOfFile, "End of file record" },
{ OMF96Format::ModuleAncestor, "Module ancestor record" },
{ OMF96Format::LocalSymbols, "Local symbols record" },
{ OMF96Format::TypeDefinition, "Type definition record" },
{ OMF96Format::PublicDefinitions, "Public definitions record" },
{ OMF96Format::ExternalDefinitions, "External definitions record" },
{ OMF96Format::SegmentDefinitions, "Segment definitions record" },
{ OMF96Format::Relocations, "Fixup record" },
{ OMF96Format::LibraryModuleLocations, "Library module locations record" },
{ OMF96Format::LibraryModuleNames, "Library module names record" },
{ OMF96Format::LibraryDictionary, "Library dictionary record" },
{ OMF96Format::LibraryHeader, "Library header record" },
}

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