8#include "../dumper/dumper.h"
9#include "../linker/module.h"
10#include "../linker/segment.h"
11#include "../linker/segment_manager.h"
12#include "../linker/writer.h"
18 typedef char OSType[4];
20 static constexpr uint32_t OSTypeToUInt32(
char type0,
char type1,
char type2,
char type3)
23 (uint32_t(uint8_t(type0)) << 24)
24 | (uint32_t(uint8_t(type1)) << 16)
25 | (uint32_t(uint8_t(type2)) << 8)
26 | uint32_t(uint8_t(type3));
29 uint32_t OSTypeToUInt32(
const OSType& type);
30 void UInt32ToOSType(OSType& type, uint32_t value);
58 format_type type = DOUBLE;
72 hfs_type home_file_system;
74 hfs_type GetHomeFileSystem()
const;
75 void SetHomeFileSystem(hfs_type type);
77 char home_file_system_string[16] =
"";
83 offset_t file_offset = 0;
84 offset_t image_size = 0;
92 static std::shared_ptr<Entry> ReadEntry(
Linker::Reader& rd, hfs_type home_file_system);
101 virtual void CalculateValues();
107 std::shared_ptr<Linker::Image> image;
123 void CalculateValues()
override;
127 static const char TXT_undefined[16];
128 static const char TXT_Macintosh[16];
129 static const char TXT_ProDOS[16];
130 static const char TXT_MS_DOS[16];
131 static const char TXT_UNIX[16];
132 static const char TXT_VAX_VMS[16];
135 std::vector<std::shared_ptr<Entry>> entries;
136 offset_t image_size = offset_t(-1);
149 ID_MacintoshFileInfo,
159 SetHomeFileSystem(HFS_UNDEFINED);
162 AppleSingleDouble(format_type type,
unsigned version, hfs_type home_file_system)
163 : type(type), version(version)
165 assert(type == SINGLE || type == DOUBLE);
166 SetHomeFileSystem(version == 1 ? home_file_system : HFS_UNDEFINED);
169 AppleSingleDouble(format_type type, hfs_type home_file_system)
170 : type(type), version(1), home_file_system(home_file_system)
172 assert(type == SINGLE || type == DOUBLE);
173 SetHomeFileSystem(home_file_system);
176 AppleSingleDouble(format_type type,
unsigned version = 2)
177 : type(type), version(version), home_file_system(HFS_UNDEFINED)
179 assert(type == SINGLE || type == DOUBLE);
180 SetHomeFileSystem(HFS_UNDEFINED);
184 explicit AppleSingleDouble(AppleSingleDouble& other, format_type type)
185 : type(type), version(other.version), home_file_system(other.home_file_system)
187 SetHomeFileSystem(other.GetHomeFileSystem());
188 if(type == SINGLE && other.type == DOUBLE)
192 for(
auto entry : other.entries)
194 if(type == DOUBLE && entry->id == ID_DataFork)
196 entries.push_back(entry);
200 explicit AppleSingleDouble(AppleSingleDouble& other)
201 : type(other.type), version(other.version), home_file_system(other.home_file_system)
203 for(
auto entry : other.entries)
205 entries.push_back(entry);
209 void SetOptions(std::map<std::string, std::string>& options)
override;
211 void SetModel(std::string model)
override;
212 void SetLinkScript(std::string script_file, std::map<std::string, std::string>& options)
override;
214 std::shared_ptr<const Entry> FindEntry(uint32_t
id)
const;
215 std::shared_ptr<Entry> FindEntry(uint32_t
id);
218 std::shared_ptr<Entry> GetFileDatesInfo();
219 std::shared_ptr<Entry> GetMacintoshFileInfo();
220 std::shared_ptr<Entry> GetAUXFileInfo();
221 std::shared_ptr<Entry> GetProDOSFileInfo();
222 std::shared_ptr<Entry> GetMSDOSFileInfo();
224 std::shared_ptr<Entry> GetDataFork();
225 std::shared_ptr<Entry> GetResourceFork();
226 std::shared_ptr<Entry> GetFinderInfo();
229 void SetCreationDate(uint32_t CreationDate);
230 void SetModificationDate(uint32_t ModificationDate);
231 void SetBackupDate(uint32_t BackupDate);
232 void SetAccessDate(uint32_t AccessDate);
233 void SetMacintoshAttributes(uint32_t Attributes);
234 void SetProDOSAccess(uint16_t Access);
235 void SetProDOSFileType(uint16_t FileType);
236 void SetProDOSAUXType(uint32_t AUXType);
237 void SetMSDOSAttributes(uint16_t Attributes);
239 uint32_t GetCreationDate();
240 uint32_t GetModificationDate();
241 uint32_t GetMacintoshAttributes();
249 std::string PrefixFilename(std::string prefix, std::string filename);
250 std::string PrefixFilename(std::string prefix, std::string filename,
size_t limit);
251 std::string ReplaceExtension(std::string filename, std::string extension,
size_t limit);
253 std::string GetUNIXDoubleFilename(std::string filename);
254 std::string GetMacOSXDoubleFilename(std::string filename);
255 std::string GetProDOSDoubleFilename(std::string filename);
256 std::string GetMSDOSDoubleFilename(std::string filename);
267 std::shared_ptr<Linker::Image> image;
270 : Entry(AppleSingleDouble::ID_DataFork)
283 void CalculateValues()
override;
307 memory_model_t memory_model = MODEL_DEFAULT;
309 void SetOptions(std::map<std::string, std::string>& options)
override;
311 static std::vector<Linker::OptionDescription<void>> MemoryModelNames;
313 void SetModel(std::string model)
override;
323 virtual std::unique_ptr<Dumper::Region> CreateRegion(std::string name, offset_t offset, offset_t length,
unsigned display_width)
const;
326 Resource(
const char type[4], uint16_t
id, uint8_t attributes = 0)
327 : id(
id), attributes(attributes)
329 memcpy(this->type, type, 4);
332 Resource(
const char type[4], uint16_t
id, std::string name, uint8_t attributes = 0)
333 : id(
id), name(name), attributes(attributes)
335 memcpy(this->type, type, 4);
342 std::optional<std::string> name;
356 std::shared_ptr<Linker::Image> image;
370 std::unique_ptr<Dumper::Region> CreateRegion(std::string name, offset_t offset, offset_t length,
unsigned display_width)
const override;
387 uint32_t above_a5 = 0;
388 uint32_t below_a5 = 0;
389 uint32_t jump_table_offset = 32;
390 std::vector<Entry> near_entries;
391 std::vector<Entry> far_entries;
401 MOVE_DATA_SP = 0x3F3C,
411 void Dump(
Dumper::Dumper& dump, offset_t file_offset)
const override;
418 static constexpr uint32_t OSType = OSTypeToUInt32(
'C',
'O',
'D',
'E');
420 std::shared_ptr<JumpTableCodeResource> jump_table;
421 std::shared_ptr<Linker::Image> image;
422 uint32_t zero_fill = 0;
424 CodeResource(uint16_t
id, std::shared_ptr<JumpTableCodeResource> jump_table =
nullptr)
425 :
Resource(
"CODE",
id), jump_table(jump_table)
430 uint32_t a5_address = 0;
431 uint32_t base_address = 0;
434 std::set<uint16_t> near_entries;
435 uint16_t near_entry_count = 0;
437 std::set<uint32_t> far_entries;
438 uint16_t far_entry_count = 0;
439 std::set<uint32_t> a5_relocations;
440 std::set<uint32_t> segment_relocations;
443 uint32_t first_near_entry_offset;
444 uint32_t first_far_entry_offset;
445 uint32_t a5_relocation_offset;
446 uint32_t segment_relocation_offset;
447 uint32_t resource_size;
458 uint32_t MeasureRelocations(std::set<uint32_t>& relocations)
const;
460 void ReadRelocations(
Linker::Reader& rd, std::set<uint32_t>& relocations)
const;
461 void WriteRelocations(
Linker::Writer& wr,
const std::set<uint32_t>& relocations)
const;
466 void Dump(
Dumper::Dumper& dump, offset_t file_offset)
const override;
468 std::unique_ptr<Dumper::Region> CreateRegion(std::string name, offset_t offset, offset_t length,
unsigned display_width)
const override;
479 uint16_t name_offset = 0xFFFF;
480 std::optional<std::string> name;
481 uint8_t attributes = 0;
482 uint32_t data_offset = 0;
483 std::shared_ptr<Resource> data;
488 OSType type { 0, 0, 0, 0 };
491 std::vector<ResourceReference> references;
496 uint16_t attributes = 0;
503 std::map<uint32_t, std::map<uint16_t, std::shared_ptr<Resource>>>
resources;
506 uint32_t data_offset = 0, data_length = 0, map_offset = 0, map_length = 0;
507 uint16_t resource_type_list_offset = 28;
508 uint16_t name_list_offset = 0;
511 std::shared_ptr<JumpTableCodeResource> jump_table;
512 std::vector<std::shared_ptr<CodeResource>> codes;
513 std::map<std::shared_ptr<Linker::Segment>, std::shared_ptr<CodeResource>> segments;
514 std::shared_ptr<Linker::Segment> a5world;
516 void AddResource(std::shared_ptr<Resource> resource);
518 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
526 void CalculateValues()
override;
549 : Entry(AppleSingleDouble::ID_RealName), name(name)
567 : Entry(AppleSingleDouble::ID_Comment)
586 : Entry(AppleSingleDouble::ID_IconBW)
605 : Entry(AppleSingleDouble::ID_IconColor)
625 : Entry(AppleSingleDouble::ID_FileInfo)
639 uint32_t CreationDate;
640 uint32_t ModificationDate;
641 uint32_t LastBackupDate;
645 uint32_t ModificationDate = 0,
646 uint32_t LastBackupDate = 0,
647 uint32_t Attributes = 0)
648 : CreationDate(CreationDate), ModificationDate(ModificationDate), LastBackupDate(LastBackupDate), Attributes(Attributes)
665 uint32_t CreationDate;
666 uint32_t ModificationDate;
671 ProDOS(uint32_t CreationDate = 0,
672 uint32_t ModificationDate = 0,
674 uint16_t FileType = 0,
675 uint32_t AUXType = 0)
676 : CreationDate(CreationDate), ModificationDate(ModificationDate), Access(Access), FileType(FileType), AUXType(AUXType)
693 uint32_t ModificationDate;
696 MSDOS(uint32_t ModificationDate = 0,
697 uint16_t Attributes = 0)
698 : ModificationDate(ModificationDate), Attributes(Attributes)
715 uint32_t CreationDate;
717 uint32_t ModificationDate;
719 AUX(uint32_t CreationDate = 0,
720 uint32_t AccessDate = 0,
721 uint32_t ModificationDate = 0)
722 : CreationDate(CreationDate), AccessDate(AccessDate), ModificationDate(ModificationDate)
740 uint32_t CreationDate;
741 uint32_t ModificationDate;
746 uint32_t CreationDate = 0,
747 uint32_t ModificationDate = 0,
748 uint32_t BackupDate = 0,
749 uint32_t AccessDate = 0)
750 : Entry(AppleSingleDouble::ID_FileDatesInfo),
751 CreationDate(CreationDate), ModificationDate(ModificationDate), BackupDate(BackupDate), AccessDate(AccessDate)
773 char Type[4] = {
'?',
'?',
'?',
'?' };
774 char Creator[4] = {
'?',
'?',
'?',
'?' };
776 Point Location = { 0, 0 };
779 : Entry(AppleSingleDouble::ID_FinderInfo)
801 : Entry(AppleSingleDouble::ID_MacintoshFileInfo), Attributes(Attributes)
824 uint16_t FileType = 0,
825 uint32_t AUXType = 0)
826 : Entry(AppleSingleDouble::ID_ProDOSFileInfo), Access(Access), FileType(FileType), AUXType(AUXType)
847 : Entry(AppleSingleDouble::ID_MSDOSFileInfo), Attributes(Attributes)
866 : Entry(AppleSingleDouble::ID_AFPShortName)
886 : Entry(AppleSingleDouble::ID_AFPFileInfo)
906 : Entry(AppleSingleDouble::ID_AFPDirectoryID)
935 version_t version, minimum_version;
937 uint16_t secondary_header_size = 0;
938 mutable uint16_t crc = 0;
940 uint8_t attributes = 0;
941 uint32_t creation = 0;
942 uint32_t modification = 0;
944 std::string generated_file_name;
947 :
AppleSingleDouble(AppleSingleDouble::DOUBLE), version(version), minimum_version(version <= MACBIN2 ? version : MACBIN2)
951 MacBinary(version_t version, version_t minimum_version)
952 :
AppleSingleDouble(AppleSingleDouble::DOUBLE), version(version), minimum_version(version < minimum_version ? version : minimum_version)
957 :
AppleSingleDouble(apple, AppleSingleDouble::DOUBLE), version(version), minimum_version(version < minimum_version ? version : minimum_version)
962 static uint16_t crc_step[256];
964 void CRC_Initialize()
const;
966 void CRC_Step(uint8_t
byte = 0)
const;
970 void WriteData(
Linker::Writer& wr,
size_t count,
const void * data)
const;
972 void WriteData(
Linker::Writer& wr,
size_t count, std::string text)
const;
974 void WriteWord(
Linker::Writer& wr,
size_t bytes, uint64_t value)
const;
1001 enum target_format_t
1005 TARGET_RESOURCE_FORK,
1006 TARGET_APPLE_SINGLE,
1009 target_format_t target;
1012 enum produce_format_t
1014 PRODUCE_RESOURCE_FORK = 1 << 0,
1015 PRODUCE_FINDER_INFO = 1 << 1,
1016 PRODUCE_APPLE_DOUBLE = 1 << 2,
1017 PRODUCE_MAC_BINARY = 1 << 3,
1019 produce_format_t produce;
1028 unsigned apple_single_double_version = 2;
1030 AppleSingleDouble::hfs_type home_file_system = AppleSingleDouble::HFS_UNDEFINED;
1032 MacBinary::version_t macbinary_version = MacBinary::MACBIN3, macbinary_minimum_version = MacBinary::MACBIN2;
1034 MacDriver(target_format_t target = TARGET_DATA_FORK)
1036 produce(target == TARGET_NONE ? PRODUCE_MAC_BINARY
1037 : target == TARGET_DATA_FORK ? PRODUCE_APPLE_DOUBLE
1038 : produce_format_t(0))
1042 MacDriver(target_format_t target,
int produce)
1043 : target(target), produce(produce_format_t(produce))
1053 std::shared_ptr<ResourceFork>,
1054 std::shared_ptr<AppleSingleDouble>
1058 std::shared_ptr<const ResourceFork> GetResourceFork()
const;
1059 std::shared_ptr<ResourceFork> GetResourceFork();
1060 std::shared_ptr<const AppleSingleDouble> GetAppleSingleDouble()
const;
1061 std::shared_ptr<AppleSingleDouble> GetAppleSingleDouble();
1062 std::shared_ptr<const MacBinary> GetMacBinary()
const;
1063 std::shared_ptr<MacBinary> GetMacBinary();
1065 std::map<std::string, std::string> options;
1067 std::string script_file;
1068 std::map<std::string, std::string> script_options;
1071 void SetOptions(std::map<std::string, std::string>& options)
override;
1074 void SetModel(std::string model)
override;
1076 void SetLinkScript(std::string script_file, std::map<std::string, std::string>& options)
override;
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2334
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2318
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2323
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2328
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2300
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2305
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2311
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2295
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2272
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2288
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2282
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2277
offset_t WriteFile(Linker::Writer &out) const override=0
Stores data in memory to file.
offset_t ImageSize() const override=0
Retrieves size of stored data.
void ReadFile(Linker::Reader &rd) override=0
Loads file into memory.
void Dump(Dumper::Dumper &dump) const override=0
Display file contents in a nice manner.
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:265
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:247
offset_t WriteFile(Linker::Writer &out) const override
Stores data in memory to file.
Definition macos.cc:252
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:242
AppleSingle & AppleDouble.
Definition macos.h:46
void SetOptions(std::map< std::string, std::string > &options) override
Passes command line parameters as settings over to format object.
Definition macos.cc:283
bool FormatSupportsResources() const override
Whether the format supports resources.
Definition macos.cc:121
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:68
void ProcessModule(Linker::Module &module) override
Processes the module object and initializes format fields.
Definition macos.cc:771
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition macos.cc:901
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:831
void SetModel(std::string model) override
Sets the way memory is organized, typically modifying a built-in script.
Definition macos.cc:295
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:31
std::vector< Linker::OptionDescription< void > > GetMemoryModelNames() override
Returns a list of the supported memory models, used for documentation.
Definition macos.cc:290
std::string GetDefaultExtension(Linker::Module &module) const override
Provides a default filename for the output file.
Definition macos.cc:937
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:810
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition macos.cc:797
void SetLinkScript(std::string script_file, std::map< std::string, std::string > &options) override
Selects a script file to use for linking.
Definition macos.cc:300
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:949
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:967
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:944
offset_t WriteFile(Linker::Writer &out) const override
Stores data in memory to file.
Definition macos.cc:954
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2140
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2130
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2151
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2135
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2103
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2108
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2113
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2123
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2082
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2077
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2087
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2096
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2025
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2030
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2041
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2020
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2058
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2070
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2053
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2048
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2163
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2158
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2168
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2182
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1974
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1979
offset_t WriteFile(Linker::Writer &out) const override
Stores data in memory to file.
Definition macos.cc:1984
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:1990
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2002
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1997
offset_t WriteFile(Linker::Writer &out) const override
Stores data in memory to file.
Definition macos.cc:2007
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2013
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2257
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2252
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2247
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2265
MacBinary is an alternative format to AppleSingle for representing a Macintosh file on a non-Macintos...
Definition macos.h:925
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition macos.cc:2496
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2509
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2536
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition macos.cc:2547
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2504
This is not actually a file format, but an interface to permit generating multiple binary outputs for...
Definition macos.h:998
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2805
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2879
bool FormatSupportsResources() const override
Whether the format supports resources.
Definition macos.cc:2555
std::vector< Linker::OptionDescription< void > > GetMemoryModelNames() override
Returns a list of the supported memory models, used for documentation.
Definition macos.cc:2650
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2859
void SetLinkScript(std::string script_file, std::map< std::string, std::string > &options) override
Selects a script file to use for linking.
Definition macos.cc:2661
bool AddSupplementaryOutputFormat(std::string subformat) override
If the output format actually drives multiple output formats (resource file, apple double,...
Definition macos.cc:2560
void SetModel(std::string model) override
Sets the way memory is organized, typically modifying a built-in script.
Definition macos.cc:2656
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition macos.cc:2667
void SetOptions(std::map< std::string, std::string > &options) override
Passes command line parameters as settings over to format object.
Definition macos.cc:2645
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2195
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2205
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2200
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2213
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:2220
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:2225
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:2240
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:2230
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1926
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:1944
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1931
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:1936
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:1355
void ProcessModule(Linker::Module &module) override
Processes the module object and initializes format fields.
Definition macos.cc:1217
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition macos.cc:1221
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1322
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1242
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1049
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:1064
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition macos.cc:1045
void ProcessModule(Linker::Module &module) override
Processes the module object and initializes format fields.
Definition macos.cc:1041
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1054
void ProcessModule(Linker::Module &module) override
Processes the module object and initializes format fields.
Definition macos.cc:1074
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:1139
void CalculateValues() override
Intermediate step between processing module and generating output file to set up headers and manageme...
Definition macos.cc:1078
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1091
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1103
offset_t ImageSize() const override=0
Retrieves size of stored data.
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:1015
A Macintosh resource fork.
Definition macos.h:295
std::map< uint32_t, std::map< uint16_t, std::shared_ptr< Resource > > > resources
A convenient collection of resources.
Definition macos.h:503
std::string GetDefaultExtension(Linker::Module &module) const override
Provides a default filename for the output file.
Definition macos.cc:1898
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition macos.cc:1888
offset_t ImageSize() const override
Retrieves size of stored data.
Definition macos.cc:1671
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 macos.cc:1418
void SetModel(std::string model) override
Sets the way memory is organized, typically modifying a built-in script.
Definition macos.cc:996
void SetOptions(std::map< std::string, std::string > &options) override
Passes command line parameters as settings over to format object.
Definition macos.cc:980
std::vector< Linker::OptionDescription< void > > GetMemoryModelNames() override
Returns a list of the supported memory models, used for documentation.
Definition macos.cc:991
bool FormatSupportsResources() const override
Whether the format supports resources.
Definition macos.h:297
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition macos.cc:1676
std::vector< std::string > resource_names
A list of all resource names, as stored in the file.
Definition macos.h:500
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition macos.cc:1809
std::vector< ResourceType > resource_types
A list of all resource types, as stored in the file.
Definition macos.h:498
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition macos.cc:1751
An abstract interface that separates structure and presentation of the data inside a file.
Definition dumper.h:586
A record that represents a region within the file.
Definition dumper.h:485
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