6#include "../dumper/dumper.h"
7#include "../linker/module.h"
8#include "../linker/options.h"
9#include "../linker/segment.h"
10#include "../linker/segment_manager.h"
11#include "../linker/writer.h"
53 ::EndianType endiantype;
63 magic_type magic = magic_type(0);
77 cpu_type cpu = UNKNOWN;
79 ::EndianType GetEndianType()
const;
81 unsigned GetWordSize()
const;
83 uint32_t code_size = 0;
84 uint32_t data_size = 0;
85 uint32_t bss_size = 0;
86 uint32_t symbol_table_size = 0;
87 uint32_t entry_address = 0;
88 uint32_t code_relocation_size = 0;
89 uint32_t data_relocation_size = 0;
90 std::map<uint32_t, uint32_t> code_relocations, data_relocations;
92 std::shared_ptr<Linker::Image> code, data, bss;
95 bool AttemptFetchMagic(uint8_t signature[4]);
97 bool AttemptReadFile(
Linker::Reader& rd, uint8_t signature[4], offset_t image_size);
104 uint16_t unknown = 0;
105 uint16_t name_offset = 0;
110 std::vector<Symbol> symbols;
135 InitializeFields(stub);
148 system_type system = system_type(0);
150 static std::shared_ptr<AOutFormat> CreateWriter(system_type system, magic_type magic);
152 static std::shared_ptr<AOutFormat> CreateWriter(system_type system);
162 static std::vector<Linker::OptionDescription<void> *> ParameterNames;
165 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
167 void SetOptions(std::map<std::string, std::string>& options)
override;
169 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
171 void CreateDefaultSegments();
177 std::shared_ptr<Linker::Segment> GetCodeSegment();
179 std::shared_ptr<Linker::Segment> GetDataSegment();
181 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
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