RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
huexe.h
1#ifndef HUEXE_H
2#define HUEXE_H
3
4#include "../common.h"
5#include "../linker/linker.h"
6#include "../linker/module.h"
7#include "../linker/segment.h"
8#include "../linker/writer.h"
9
10namespace X68000
11{
16 {
17 public:
18 void ReadFile(Linker::Reader& rd) override;
19
20 enum load_mode_type
21 {
22 MODE_NORMAL,
23 MODE_SMALLEST,
24 MODE_HIGHEST,
25 };
26 load_mode_type load_mode = MODE_NORMAL; /* TODO: make parameter */
27 uint32_t entry_address = 0;
28 bool option_no_relocation = false; /* TODO: make parameter */
29
30 /* filled in automatically */
31 std::shared_ptr<Linker::Segment> code, data, bss;
32 uint32_t relocation_size = 0;
33 std::map<uint32_t, unsigned char> relocations;
34
35 using LinkerManager::SetLinkScript;
36
37 void SetOptions(std::map<std::string, std::string>& options) override;
38
39 void OnNewSegment(std::shared_ptr<Linker::Segment> segment) override;
40
41 void CreateDefaultSegments();
42
43 std::unique_ptr<Script::List> GetScript(Linker::Module& module);
44
45 void Link(Linker::Module& module);
46
47 void ProcessModule(Linker::Module& module) override;
48
49 void CalculateValues() override;
50
51 void WriteFile(Linker::Writer& wr) override;
52
53 void GenerateFile(std::string filename, Linker::Module& module) override;
54
55 std::string GetDefaultExtension(Linker::Module& module, std::string filename) override;
56 };
57
58}
59
60#endif /* HUEXE_H */
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 class that provides a general interface to setting up generation for a format.
Definition format.h:56
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
Human68k "HU" .X file.
Definition huexe.h:16
void ProcessModule(Linker::Module &module) override
Processes the module object and initializes format fields.
Definition huexe.cc:95
void WriteFile(Linker::Writer &wr) override
Stores data in memory to file.
Definition huexe.cc:161
void OnNewSegment(std::shared_ptr< Linker::Segment > segment) override
Callback function when allocating a new segment When the linker script runs, it creates segments cons...
Definition huexe.cc:16
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition huexe.cc:146
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition huexe.cc:200
void SetOptions(std::map< std::string, std::string > &options) override
Passes command line parameters as settings over to format object.
Definition huexe.cc:11
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition huexe.cc:6
std::string GetDefaultExtension(Linker::Module &module, std::string filename) override
Appends a default extension to the filename.
Definition huexe.cc:210