6#include "../dumper/dumper.h"
7#include "../linker/module.h"
8#include "../linker/segment.h"
9#include "../linker/segment_manager.h"
10#include "../linker/writer.h"
52 ::EndianType endiantype;
62 magic_type magic = magic_type(0);
76 cpu_type cpu = UNKNOWN;
78 ::EndianType GetEndianType()
const;
80 unsigned GetWordSize()
const;
82 uint32_t code_size = 0;
83 uint32_t data_size = 0;
84 uint32_t bss_size = 0;
85 uint32_t symbol_table_size = 0;
86 uint32_t entry_address = 0;
87 uint32_t code_relocation_size = 0;
88 uint32_t data_relocation_size = 0;
89 std::map<uint32_t, uint32_t> code_relocations, data_relocations;
91 std::shared_ptr<Linker::Image> code, data, bss;
94 bool AttemptFetchMagic(uint8_t signature[4]);
96 bool AttemptReadFile(
Linker::Reader& rd, uint8_t signature[4], offset_t image_size);
103 uint16_t unknown = 0;
104 uint16_t name_offset = 0;
109 std::vector<Symbol> symbols;
136 system_type system = system_type(0);
138 static std::shared_ptr<AOutFormat> CreateWriter(system_type system, magic_type magic);
140 static std::shared_ptr<AOutFormat> CreateWriter(system_type system);
150 void SetOptions(std::map<std::string, std::string>& options)
override;
152 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
154 void CreateDefaultSegments();
160 std::shared_ptr<Linker::Segment> GetCodeSegment();
162 std::shared_ptr<Linker::Segment> GetDataSegment();
164 std::shared_ptr<Linker::Segment> GetBssSegment();
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
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