6#include "../linker/linker.h"
7#include "../linker/module.h"
8#include "../linker/segment.h"
9#include "../linker/writer.h"
51 ::EndianType endiantype;
61 magic_type magic = magic_type(0);
75 cpu_type cpu = UNKNOWN;
77 ::EndianType GetEndianType()
const;
79 unsigned GetWordSize()
const;
81 uint32_t code_size = 0;
82 uint32_t data_size = 0;
83 uint32_t bss_size = 0;
84 uint32_t symbol_table_size = 0;
85 uint32_t entry_address = 0;
86 uint32_t code_relocation_size = 0;
87 uint32_t data_relocation_size = 0;
88 std::map<uint32_t, uint32_t> code_relocations, data_relocations;
90 std::shared_ptr<Linker::Writable> code, data, bss;
93 bool AttemptFetchMagic(uint8_t signature[4]);
95 bool AttemptReadFile(
Linker::Reader& rd, uint8_t signature[4], offset_t image_size);
102 uint16_t unknown = 0;
103 uint16_t name_offset = 0;
108 std::vector<Symbol> symbols;
130 system_type system = system_type(0);
132 static std::shared_ptr<AOutFormat> CreateWriter(system_type system, magic_type magic);
134 static std::shared_ptr<AOutFormat> CreateWriter(system_type system);
144 void SetOptions(std::map<std::string, std::string>& options)
override;
146 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
148 void CreateDefaultSegments();
154 std::shared_ptr<Linker::Segment> GetCodeSegment();
156 std::shared_ptr<Linker::Segment> GetDataSegment();
158 std::shared_ptr<Linker::Segment> GetBssSegment();
164 using LinkerManager::SetLinkScript;
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