9#include "../linker/module.h"
10#include "../linker/options.h"
11#include "../linker/segment.h"
12#include "../linker/segment_manager.h"
13#include "../linker/writer.h"
14#include "../dumper/dumper.h"
16namespace DigitalResearch
112 std::shared_ptr<Linker::Image>
image =
nullptr;
116 virtual void Clear();
139 std::string GetDefaultName()
const;
164 bool operator==(
const relocation_source& other)
const;
165 bool operator<(
const relocation_source& other)
const;
168 typedef relocation_source relocation_target;
176 uint16_t paragraph = 0;
184 Relocation(uint8_t source, uint16_t paragraph, uint16_t offset, uint8_t target)
185 : source(source), paragraph(paragraph), offset(offset), target(target)
190 : source(source.segment), paragraph(source.offset >> 4), offset(source.offset & 0xF), target(target)
194 operator bool()
const;
221 static constexpr uint16_t RSX_TERMINATE = 0xFFFF;
222 static constexpr uint16_t RSX_DYNAMIC = 0x0000;
238 offset_t GetFullFileSize()
const;
239 void SetOffset(offset_t new_offset);
273 library_id(
const library_id& lib) =
default;
278 bool operator ==(
const library_id& other)
const;
320 library(
const library_id& lib)
341 void Clear()
override;
352 bool IsFastLoadFormat()
const;
355 library& FetchImportedLibrary(std::string name_dot_version);
387 uint16_t reserved = 0;
394 std::vector<ldt_descriptor> ldt;
396 void Clear()
override;
479 void Clear()
override;
546 uint16_t GetRelocationSizeParas()
const;
548 size_t CountValidGroups();
550 number_t FindSegmentGroup(
unsigned group)
const;
552 void CheckValidSegmentGroup(
unsigned group);
554 bool IsFastLoadFormat()
const;
555 bool IsSharedRunTimeLibrary()
const;
561 offset_t MeasureRelocations();
570 offset_t GetFullFileSize()
const;
582 Linker::Option<bool> sharedcode{
"sharedcode",
"Make the code segment shared (descriptor type 9)"};
584 Linker::Option<bool> fixupgroup{
"fixupgroup",
"Generates group descriptor for fixups (FlexOS)"};
585 Linker::Option<std::optional<std::string>> srtl{
"srtl",
"Generate shared run-time library, parameter: <library name>.<major version>.<minor version>[.<optional flags as hexadecimal value>] (TODO: untested)"};
597 InitializeFields(noreloc, sharedcode, rsx_file_names, fixupgroup, srtl, x87, directvideo, mpmlock, nobank, f1, f2, f3, f4);
630 unsigned FormatAdditionalSectionFlags(std::string section_name)
const override;
632 std::vector<std::shared_ptr<Linker::Segment>>& Segments();
640 unsigned GetSegmentNumber(std::shared_ptr<Linker::Segment> segment);
642 static std::vector<Linker::OptionDescription<void>> MemoryModelNames;
646 void SetModel(std::string model)
override;
648 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
650 void SetOptions(std::map<std::string, std::string>& options)
override;
An abstract interface that separates structure and presentation of the data inside a file.
Definition dumper.h:586
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:24
Helper class that contains the options interpreted by the format.
Definition options.h:308
Documents and handles command line options.
Definition options.h:196
A helper class, encapsulating functionality needed to import binary data.
Definition reader.h:16
A helper class to collect sections into segments.
Definition segment_manager.h:32
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15