5#include "../linker/linker.h"
6#include "../linker/module.h"
7#include "../linker/segment.h"
8#include "../linker/writer.h"
32 unsigned FormatAdditionalSectionFlags(std::string section_name)
const override;
44 HUNK_PPC_CODE = 0x4E9,
46 uint32_t cpu = HUNK_CODE;
55 LoadPublic = 0x00000001,
56 LoadChipMem = 0x00000002,
57 LoadFastMem = 0x00000004,
58 LoadLocalMem = 0x00000008,
59 Load24BitDma = 0x00000010,
60 LoadClear = 0x00010000,
63 std::shared_ptr<Linker::Segment> image;
65 Hunk(uint32_t hunk_type, std::string name =
"image",
unsigned flags = LoadAny)
66 : hunk_type(hunk_type),
flags((flag_type)
flags), image(std::make_shared<Linker::Segment>(name))
70 Hunk(uint32_t hunk_type, std::shared_ptr<Linker::Segment> segment,
unsigned flags = LoadAny)
71 : hunk_type(hunk_type),
flags((flag_type)
flags), image(segment)
75 std::map<uint32_t, std::vector<uint32_t> > relocations;
77 uint32_t GetSizeField();
79 bool RequiresAdditionalFlags();
81 uint32_t GetAdditionalFlags();
84 std::vector<Hunk> hunks;
85 std::map<std::shared_ptr<Linker::Segment>,
size_t> segment_index;
87 using LinkerManager::SetLinkScript;
89 void SetOptions(std::map<std::string, std::string>& options)
override;
91 void AddHunk(
const Hunk& hunk);
93 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
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
@ CustomFlag
Other flags.
Definition section.h:101
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15