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

A single record inside the segment body, also represents an END record. More...

#include <gsos.h>

Inheritance diagram for Apple::OMFFormat::Segment::Record:
Apple::OMFFormat::Segment::DataRecord Apple::OMFFormat::Segment::EntryRecord Apple::OMFFormat::Segment::ExpressionRecord Apple::OMFFormat::Segment::LabelRecord Apple::OMFFormat::Segment::RangeRecord Apple::OMFFormat::Segment::RelocationRecord Apple::OMFFormat::Segment::StringRecord Apple::OMFFormat::Segment::SuperCompactRecord Apple::OMFFormat::Segment::ValueRecord

Public Types

enum  record_type {
  OPC_END = 0x00 , OPC_CONST_BASE = 0x00 , OPC_CONST_FIRST = 0x01 , OPC_CONST_LAST = 0xDF ,
  OPC_ALIGN = 0xE0 , OPC_ORG = 0xE1 , OPC_RELOC = 0xE2 , OPC_INTERSEG = 0xE3 ,
  OPC_USING = 0xE4 , OPC_STRONG = 0xE5 , OPC_GLOBAL = 0xE6 , OPC_GEQU = 0xE7 ,
  OPC_MEM = 0xE8 , OPC_EXPR = 0xEB , OPC_ZEXPR = 0xEC , OPC_BEXPR = 0xED ,
  OPC_RELEXPR = 0xEE , OPC_LOCAL = 0xEF , OPC_EQU = 0xF0 , OPC_DS = 0xF1 ,
  OPC_LCONST = 0xF2 , OPC_LEXPR = 0xF3 , OPC_ENTRY = 0xF4 , OPC_C_RELOC = 0xF5 ,
  OPC_C_INTERSEG = 0xF6 , OPC_SUPER = 0xF7
}
 

Public Member Functions

 Record (record_type type)
 
virtual offset_t GetLength (const Segment &segment) const
 Returns the size of the record, as stored in the file.
 
virtual offset_t GetMemoryLength (const Segment &segment, offset_t current_address) const
 Returns the amount of memory the record occupies when loaded into memory. Most records have a length of 0.
 
virtual void ReadFile (Segment &segment, Linker::Reader &rd)
 
virtual void WriteFile (const Segment &segment, Linker::Writer &wr) const
 
virtual void Dump (Dumper::Dumper &dump, const OMFFormat &omf, const Segment &segment, unsigned index, offset_t file_offset, offset_t address) const
 Displays information pertaining to this record.
 
virtual void AddFields (Dumper::Dumper &dump, Dumper::Region &region, const OMFFormat &omf, const Segment &segment, unsigned index, offset_t file_offset, offset_t address) const
 Adds any further fields to the file region that encompasses this record.
 
virtual void AddSignals (Dumper::Block &block, offset_t current_segment_offset) const
 If this is a relocation record, add the relocation signals to the block.
 
virtual void ReadData (size_t bytes, offset_t offset, void *buffer) const
 Attempts to read data from the in-memory image, if possible, it can be assumed that offset + bytes <= GetMemoryLength()
 

Public Attributes

record_type type
 

Detailed Description

A single record inside the segment body, also represents an END record.

Member Function Documentation

◆ AddFields()

void OMFFormat::Segment::Record::AddFields ( Dumper::Dumper & dump,
Dumper::Region & region,
const OMFFormat & omf,
const Segment & segment,
unsigned index,
offset_t file_offset,
offset_t address ) const
virtual

◆ AddSignals()

void OMFFormat::Segment::Record::AddSignals ( Dumper::Block & block,
offset_t current_segment_offset ) const
virtual

If this is a relocation record, add the relocation signals to the block.

Reimplemented in Apple::OMFFormat::Segment::RelocationRecord, and Apple::OMFFormat::Segment::SuperCompactRecord.

◆ Dump()

void OMFFormat::Segment::Record::Dump ( Dumper::Dumper & dump,
const OMFFormat & omf,
const Segment & segment,
unsigned index,
offset_t file_offset,
offset_t address ) const
virtual

Displays information pertaining to this record.

Parameters
dumpThe dumper interface
omfThe entire file
segmentThe segment the record is part of
index0-based index of the record within the segment
file_offsetFull file offset, including segment start offset, that this record starts at
addressThe current memory pointer when this record is interpreted

Reimplemented in Apple::OMFFormat::Segment::DataRecord, and Apple::OMFFormat::Segment::SuperCompactRecord.

◆ GetLength()

offset_t OMFFormat::Segment::Record::GetLength ( const Segment & segment) const
virtual

◆ GetMemoryLength()

offset_t OMFFormat::Segment::Record::GetMemoryLength ( const Segment & segment,
offset_t current_address ) const
virtual

Returns the amount of memory the record occupies when loaded into memory. Most records have a length of 0.

Parameters
segmentThe segment the record is part of

Reimplemented in Apple::OMFFormat::Segment::DataRecord, Apple::OMFFormat::Segment::ValueRecord, and Apple::OMFFormat::Segment::ExpressionRecord.

◆ ReadData()

void OMFFormat::Segment::Record::ReadData ( size_t bytes,
offset_t offset,
void * buffer ) const
virtual

Attempts to read data from the in-memory image, if possible, it can be assumed that offset + bytes <= GetMemoryLength()

Reimplemented in Apple::OMFFormat::Segment::DataRecord, Apple::OMFFormat::Segment::ValueRecord, and Apple::OMFFormat::Segment::ExpressionRecord.


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