|
RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
Intel Relocatable Object Module format, used by various 16/32-bit DOS based compilers and linkers, including 16-bit Microsoft compilers, Borland and Watcom compilers. More...
#include <omf.h>
Classes | |
| class | AliasDefinitionRecord |
| Record defining a replacement name for symbols, used for ALIAS (included in TIS) More... | |
| class | BackpatchRecord |
| A specialized relocation, used for BAKPAT (included in TIS) More... | |
| class | BaseSpecification |
| Specification for the group and segment of some reference, and the frame if both are 0. More... | |
| class | BlockDefinitionRecord |
| A record that defines a block, used for BLKDEF records (Intel only) More... | |
| class | BlockIndex |
| A rich container for indexes referring to a BLKDEF record. More... | |
| class | CommentRecord |
| class | DataBlock |
| Represents a sequence of data, with optional repeated parts, used by RelocatableDataRecord, PhysicalDataRecord and LogicalDataRecord. More... | |
| class | DebugSymbolsRecord |
| Record to store debug symbols, used for DEBSYM (Intel only) More... | |
| class | EndRecord |
| Record to signal termination of an overloay or block, used for ENDBLK (Intel only) More... | |
| class | ExportDefinitionRecord |
| class | ExternalAssociationRecord |
| class | ExternalIndex |
| A rich container for indexes referring to symbols in an EXTDEF, LEXTDEF, COMDEF, LCOMDEF, CEXTDEF record. More... | |
| class | ExternalName |
| An external name declaration, appearing in an EXTDEF, LEXTDEF, COMDEF, LCOMDEF or CEXTDEF record. More... | |
| class | ExternalNamesDefinitionRecord |
| A record defining several external or common symbols, used for EXTDEF, LEXTDEF, CEXTDEF, COMDEF and LCOMDEF. More... | |
| class | FixupRecord |
| A record containing relocation data, used for FIXUPP. More... | |
| class | GroupDefinitionRecord |
| A record that defines a segment group, used for GRPDEF records. More... | |
| class | GroupIndex |
| A rich container for indexes referring to a GRPDEF record. More... | |
| class | ImportDefinitionRecord |
| class | IncrementalCompilationRecord |
| class | InitializedCommunalDataRecord |
| Initialization data for common segments, used for COMDAT (included in TIS) More... | |
| class | LineNumber |
| Represents a line number, used by LineNumbersRecord and SymbolLineNumbersRecord. More... | |
| class | LineNumbersRecord |
| Stores as debugging data the line number information, used for LINNUM. More... | |
| class | LinkerDirectivesRecord |
| class | ListOfNamesRecord |
| A list of names to be referenced, used for LNAMES and LLNAMES records. More... | |
| class | LogicalDataRecord |
| Logical enumerated or iterated data, used for LEDATA and LIDATA. More... | |
| class | Module |
| Represents a single module inside the OMF file. More... | |
| class | ModuleEndRecord |
| Terminates a module, used for MODEND. More... | |
| class | ModuleHeaderRecord |
| A header record, used for THEADR and LHEADR. More... | |
| class | NamedBackpatchRecord |
| A specialized relocation for named common segments, used for NBKPAT (included in TIS) More... | |
| class | NameIndex |
| A rich container for indexes referring to a LNAME/LLNAME declaration. More... | |
| class | NoSegmentPaddingRecord |
| class | OMFExtensionRecord |
| class | OMFVersionNumberRecord |
| The version of the OMF format, used for VERNUM (included in TIS) More... | |
| class | OverlayDefinitionRecord |
| A record that defines an overlay, used for OVLDEF records. More... | |
| class | OverlayIndex |
| A rich container for indexes referring to a OVLDEF record. More... | |
| class | PhysicalDataRecord |
| Physical enumerated or iterated data, used for PEDATA and PIDATA (Intel only) More... | |
| class | Reference |
| Represents a reference for a relocation. More... | |
| class | RegisterInitializationRecord |
| Initialization values for registers, used for REGINT (Intel only) More... | |
| class | RelocatableDataRecord |
| Relocatable enumerated or iterated data, used for REDATA and RIDATA (Intel only) More... | |
| class | RModuleHeaderRecord |
| A header record for an R-Module, used for RHEADR (not part of TIS OMF) More... | |
| class | SegmentDefinitionRecord |
| A record that defines a segment, used for SEGDEF records. More... | |
| class | SegmentIndex |
| A rich container for indexes referring to a SEGDEF record. More... | |
| class | SymbolDefinition |
| Represents a symbol definition, used by SymbolDefinitionsRecord and DebugSymbolsRecord. More... | |
| class | SymbolLineNumbersRecord |
| Line numbers for common segments, used by LINSYM (included in TIS) More... | |
| class | SymbolsDefinitionRecord |
| A record that defines a symbol, used by PUBDEF, LPUBDEF, LOCSYM. More... | |
| class | TISLibraryEndRecord |
| class | TISLibraryHeaderRecord |
| class | TypeDefinitionRecord |
| A record that defines a data type, used for TYPDEF records. More... | |
| class | TypeIndex |
| A rich container for indexes referring to a TYPDEF record. More... | |
| struct | UsesAbsolute |
| Represents a MethodAbsolute value. More... | |
| struct | UsesSource |
| Represents a MethodSource value. More... | |
| struct | UsesTarget |
| Represents a MethodTarget value. More... | |
| class | VendorExtensionRecord |
| Vendor specific extension to the OMF format, used for VENDEXT (included in TIS) More... | |
Public Types | |
| enum | omf_version_t { OMF_VERSION_INTEL_40 = 1 , OMF_VERSION_PHARLAP , OMF_VERSION_MICROSOFT , OMF_VERSION_IBM , OMF_VERSION_TIS_11 } |
| Represents the various variants of the OMF file format, some of them are incompatible. More... | |
| enum | { MethodSegment = 0 , MethodGroup = 1 , MethodExternal = 2 , MethodFrame = 3 , MethodSource = 4 , MethodTarget = 5 , MethodAbsolute = 6 } |
| Reference types for relocations, for targets and frames. More... | |
| enum | record_type_t : uint8_t { RHEADR = 0x6E , REGINT = 0x70 , REDATA = 0x72 , RIDATA = 0x74 , OVLDEF = 0x76 , ENDREC = 0x78 , BLKDEF = 0x7A , BLKEND = 0x7C , DEBSYM = 0x7E , THEADR = 0x80 , LHEADR = 0x82 , PEDATA = 0x84 , PIDATA = 0x86 , COMENT = 0x88 , MODEND16 = 0x8A , MODEND = 0x8A , MODEND32 = 0x8B , EXTDEF = 0x8C , TYPDEF = 0x8E , PUBDEF16 = 0x90 , PUBDEF = 0x90 , PUBDEF32 = 0x91 , LOCSYM = 0x92 , LINNUM = 0x94 , LNAMES = 0x96 , SEGDEF = 0x98 , GRPDEF = 0x9A , FIXUPP16 = 0x9C , FIXUPP = 0x9C , FIXUPP32 = 0x9D , LEDATA16 = 0xA0 , LEDATA = 0xA0 , LEDATA32 = 0xA1 , LIDATA16 = 0xA2 , LIDATA = 0xA2 , LIDATA32 = 0xA3 , LIBHED = 0xA4 , LIBNAM = 0xA6 , LIBLOC = 0xA8 , LIBDIC = 0xAA , COMDEF = 0xB0 , BAKPAT16 = 0xB2 , BAKPAT = 0xB2 , BAKPAT32 = 0xB3 , LEXTDEF16 = 0xB4 , LEXTDEF = 0xB4 , LEXTDEF32 = 0xB5 , LPUBDEF16 = 0xB6 , LPUBDEF = 0xB6 , LPUBDEF32 = 0xB7 , LCOMDEF = 0xB8 , CEXTDEF = 0xBC , COMDAT16 = 0xC2 , COMDAT = 0xC2 , COMDAT32 = 0xC3 , LINSYM16 = 0xC4 , LINSYM = 0xC4 , LINSYM32 = 0xC5 , ALIAS = 0xC6 , NBKPAT16 = 0xC8 , NBKPAT = 0xC8 , NBKPAT32 = 0xC9 , LLNAMES = 0xCA , VERNUM = 0xCC , VENDEXT = 0xCE , LibraryHeader = 0xF0 , LibraryEnd = 0xF1 } |
| The recognized record types in an OMF86 file. | |
| typedef uint16_t | FrameNumber |
| Represents a MethodFrame value. | |
| using | Record = OMFFormat::Record<record_type_t, OMF86Format, Module> |
| using | UnknownRecord = OMFFormat::UnknownRecord<record_type_t, OMF86Format, Module> |
| using | EmptyRecord = OMFFormat::EmptyRecord<record_type_t, OMF86Format, Module> |
| using | LibraryHeaderRecord = OMFFormat::LibraryHeaderRecord<record_type_t, OMF86Format, Module> |
| using | LibraryModuleNamesRecord = OMFFormat::LibraryModuleNamesRecord<record_type_t, OMF86Format, Module> |
| using | LibraryModuleLocationsRecord = OMFFormat::LibraryModuleLocationsRecord<record_type_t, OMF86Format, Module> |
| using | LibraryDictionaryRecord = OMFFormat::LibraryDictionaryRecord<record_type_t, OMF86Format, Module> |
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 | |
| OMF86Format (omf_version_t omf_version=OMF_VERSION_MICROSOFT) | |
| std::shared_ptr< Record > | ReadRecord (Linker::Reader &rd) |
| Parses and returns an instance of the next record. | |
| void | ReadFile (Linker::Reader &rd) override |
| Loads file into memory. | |
| 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. | |
| 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. | |
| 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::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, Reader &rd, std::string file_name) |
| Reads a file and loads the information into a module object. | |
| virtual void | ProduceModule (Module &module, 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 | FormatProvidesResources () const |
| Whether the format supports resources. | |
| virtual bool | FormatProvidesLibraries () const |
| Whether the format enables importing/exporting libraries. | |
Static Public Member Functions | |
| static std::shared_ptr< OMF86Format > | ReadOMFFile (Linker::Reader &rd) |
| Parses an OMF86 file. | |
| static void | DumpAddFields (const Record *record, Dumper::Dumper &dump, Dumper::Region ®ion, const OMF86Format *omf, const Module *mod, size_t record_index) |
Static Public Member Functions inherited from OMF::OMFFormat | |
| static std::string | ReadString (Linker::Reader &rd, size_t max_bytes=size_t(-1)) |
| Reads a string prefixed with a length byte. | |
| static void | WriteString (ChecksumWriter &wr, std::string text) |
| Writes a string prefixed with a length byte. | |
| static index_t | ReadIndex (Linker::Reader &rd) |
| Parses a 1 or 2 byte index value. | |
| static void | WriteIndex (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 (Linker::Reader &rd) |
| Attempts to parse an OMF file, whether OMF80, OMF86, OMF51 or OMF96. | |
Public Attributes | |
| omf_version_t | omf_version |
| The variant of the OMF format, needed to handle certain fields. | |
| 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. | |
| uint16_t | page_size |
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 |
Intel Relocatable Object Module format, used by various 16/32-bit DOS based compilers and linkers, including 16-bit Microsoft compilers, Borland and Watcom compilers.
| anonymous enum |
Reference types for relocations, for targets and frames.
Represents the various variants of the OMF file format, some of them are incompatible.
|
overridevirtual |
Display file contents in a nice manner.
Reimplemented from Linker::Format.
|
overridevirtual |
Loads the information into a module object, a convenience method when there is a single module generated.
Reimplemented from Linker::InputFormat.
|
overridevirtual |
Loads file into memory.
Implements Linker::Format.
|
overridevirtual |
Stores data in memory to file.
Implements Linker::Format.