5#include "../linker/linker.h"
22 unsigned FormatAdditionalSectionFlags(std::string section_name)
const override;
37 FLAG_TRANSPARENT = 0x8000,
42 uint32_t total_length;
44 AbstractSegment(
unsigned access = TYPE_DATA,
unsigned flags = 0, uint32_t total_length = 0)
45 : access((access_type)access), flags((flag_type)flags), total_length(total_length)
77 std::shared_ptr<Linker::Segment> image;
79 Segment(std::shared_ptr<Linker::Segment> segment,
unsigned access = TYPE_DATA,
unsigned flags = 0)
94 DummySegment(uint32_t total_length,
unsigned access = TYPE_DATA,
unsigned flags = 0)
136 bool option_force_relocations =
true;
140 EXP_FLAG_RELOCATABLE = 0x0001,
142 exp_flag_type exp_flags = exp_flag_type(0);
146 OPTION_RELOCATIONS = 0x1000,
148 option_type options = option_type(0);
150 std::map<uint16_t, std::set<uint16_t> > relocations;
152 offset_t MeasureRelocations();
154 using LinkerManager::SetLinkScript;
156 void SetOptions(std::map<std::string, std::string>& options)
override;
158 offset_t file_size = 0;
159 offset_t min_extra = 0;
160 offset_t max_extra = 0;
161 uint16_t ss = 0, sp = 0, cs = 0, ip = 0, relocsel = 0;
162 uint16_t runtime_gdt_length = 0xFFFF;
163 uint16_t version = 0;
164 uint32_t next_header_offset = 0;
165 uint32_t debug_info_offset = 0;
166 uint16_t first_selector = 0x0080;
167 uint32_t private_xm = 0;
168 uint16_t ext_reserve = 0;
169 uint16_t transparent_stack = 0;
170 uint32_t program_size = 0;
171 uint8_t default_memory_strategy = 0;
172 uint16_t transfer_buffer_size = 0;
173 std::string exp_name;
175 std::vector<std::unique_ptr<AbstractSegment>> segments;
176 std::map<std::shared_ptr<Linker::Segment>,
size_t> segment_indices;
177 int default_data = 0;
179 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
185 size_t GetDefaultDataIndex();
A helper class to collect sections into segments.
Definition linker.h:19
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:20
A helper class, encapsulating functionality needed to import binary data.
Definition reader.h:16
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15