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

A record that defines a segment, used for SEGDEF records. More...

#include <omf.h>

Inheritance diagram for OMF::OMF86Format::SegmentDefinitionRecord:
OMF::OMFFormat::Record< RecordTypeByte, FormatType, ModuleType >

Classes

class  LoadTimeLocatable
 Additional data for LTL segment, not part of TIS. More...
 
struct  Relocatable
 Type representing a relocatable segment. More...
 

Public Types

enum  alignment_t : uint8_t {
  AlignAbsolute = 0 , Align1 = 1 , Align2 = 2 , Align16 = 3 ,
  AlignPage = 4 , AlignLTL16 = 6 , Align256 = FlagIntel | AlignPage , Align4096 = FlagTIS | AlignPage ,
  AlignUnnamed = FlagIntel | 5 , Align32 = FlagTIS | 5
}
 Alignment type for a segment. More...
 
enum  combination_t : uint8_t {
  Combination_Private = 0 , Combination_Merge_Highest = 1 , Combination_Append = 2 , Combination_Public = Combination_Append ,
  Combination_Join_Low = 4 , Combination_Public4 = FlagTIS | 4 , Combination_Join_High = FlagIntel | 5 , Combination_Stack = FlagTIS | 5 ,
  Combination_Merge_Low = FlagIntel | 6 , Combination_Common = FlagTIS | 6 , Combination_Merge_High = 7 , Combination_Public7 = FlagTIS | 4
}
 Describes how two segments of the same name and class name should be combined. More...
 
enum  access_t : uint8_t { AccessReadOnly = 0 , AccessExecuteOnly = 1 , AccessExecuteRead = 2 , AccessReadWrite = 3 }
 Represents an additional field used by Phar Lap.
 
typedef uint32_t Absolute
 Additional data used for absolute segments, type 0 or 5 if Intel version is used.
 

Public Member Functions

 SegmentDefinitionRecord (record_type_t record_type=record_type_t(0))
 
void ReadRecordContents (OMF86Format *omf, Module *mod, Linker::Reader &rd) override
 
uint16_t GetRecordSize (OMF86Format *omf, Module *mod) const override
 
void WriteRecordContents (OMF86Format *omf, Module *mod, ChecksumWriter &wr) const override
 
void CalculateValues (OMF86Format *omf, Module *mod) override
 
void ResolveReferences (OMF86Format *omf, Module *mod) override
 
- Public Member Functions inherited from OMF::OMFFormat::Record< RecordTypeByte, FormatType, ModuleType >
 Record (RecordTypeByte record_type=RecordTypeByte(0))
 
offset_t RecordEnd () const
 
virtual void ReadRecordContents (FormatType *omf, ModuleType *mod, Linker::Reader &rd)=0
 Reads the record contents, except for the type, length and checksum.
 
virtual uint16_t GetRecordSize (FormatType *omf, ModuleType *mod) const =0
 Calculates the required bytes to write the record, might be less than record_length.
 
virtual void WriteRecordContents (FormatType *omf, ModuleType *mod, ChecksumWriter &wr) const =0
 Writes the record contents, except for the type, length and checksum.
 
virtual void WriteRecord (FormatType *omf, ModuleType *mod, Linker::Writer &wr) const
 Writes the full record.
 
virtual void CalculateValues (FormatType *omf, ModuleType *mod)
 Updates all fields that will be used for writing an OMF module, should be called before output.
 
virtual void ResolveReferences (FormatType *omf, ModuleType *mod)
 Resolves any fields read from an OMF module, should be called after inpnut.
 
virtual void DumpAddFields (Dumper::Dumper &dump, Dumper::Region &region, const FormatType *omf, const ModuleType *mod, size_t record_index) const
 
virtual void Dump (Dumper::Dumper &dump, const FormatType *omf, const ModuleType *mod, size_t record_index) const
 
bool Is32Bit (FormatType *omf) const
 Records are 32-bit if the least significant bit of their record type is set (only meaningful for OMF86Format)
 
size_t GetOffsetSize (FormatType *omf) const
 The number of bytes in an offset appearing inside the record, 2 for 16-bit records, 4 for 32-bit records (only meaningful for OMF86Format)
 

Public Attributes

uint64_t segment_length
 The length of the segment (maximum 0x100000000)
 
alignment_t alignment
 Alignment of segment.
 
std::variant< Relocatable, Absolute, LoadTimeLocatablelocation = Relocatable{}
 Information on where the segment should be placed at runtime.
 
combination_t combination
 How segments of the same type should be combined.
 
bool page_resident = false
 Set if the segment should not cross a 256 byte page boundary (only Intel)
 
bool use32 = false
 Set if the USE32 directive is used for the segment. The field appears in different places for Phar Lap and TIS.
 
NameIndex segment_name
 The name of the segment (not used for AlignUnnamed)
 
NameIndex class_name
 The name of the segment's class (not used for AlignUnnamed)
 
NameIndex overlay_name
 The name of the overlay the segment appears in (not used for AlignUnnamed)
 
std::optional< access_taccess
 Represents the value of a Phar Lap specific extension word.
 
- Public Attributes inherited from OMF::OMFFormat::Record< RecordTypeByte, FormatType, ModuleType >
offset_t record_offset
 Offset of record within the file.
 
uint16_t record_length
 Length of record body file, excluding the type byte and 2-byte length field.
 
RecordTypeByte record_type
 A byte value identifying the type of record.
 

Detailed Description

A record that defines a segment, used for SEGDEF records.

Member Enumeration Documentation

◆ alignment_t

Alignment type for a segment.

Enumerator
AlignAbsolute 

Absolute segment, its position in memory is fixed.

Align1 

Relocatable segment, byte aligned.

Align2 

Relocatable segment, word (2-byte) aligned.

Align16 

Relocatable segment, paragraph (16-byte) aligned.

AlignPage 

Relocatable segment, page aligned, exact size depends on OMF version.

AlignLTL16 

Load-time locatable or, if not part of a group, paragraph (16-byte) aligned (Intel only)

Align256 

Relocatable segment, page (256-byte) aligned, as defined by Intel.

Align4096 

Relocatable segment, page (4096-byte) aligned, as used by IBM.

AlignUnnamed 

Unnamed absolute portion of the memory address space, type 5 as defined by Intel.

Align32 

Relocatable segment, double word (4-byte) aligned, type 5 as defined by TIS.

◆ combination_t

Describes how two segments of the same name and class name should be combined.

Enumerator
Combination_Private 

Do not combine segments, also known as Private.

Combination_Merge_Highest 

Like Combination_Merge_High, but also places the segment above all other segments (not used by TIS)

Combination_Append 

Appends the segments, also known as Public.

Combination_Join_Low 

Merges the two segments at their lowest address, adds their sizes (Intel interpretation)

Combination_Join_High 

Merges the two segments at their highest address, adds their sizes (Intel interpretation)

Combination_Stack 

Same as Public, but for stack segments.

Combination_Merge_Low 

Merges the two segments at their lowest address, their size is the maximum (Intel interpretation)

Combination_Merge_High 

Merges the two segments at their highest address, their size is the maximum (Intel interpretation)


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