RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Amiga::HunkFormat::Hunk Class Reference

The smallest loadable unit of a Hunk file is the hunk, it roughly corresponds to a segment in other file formats. More...

#include <hunk.h>

Public Types

enum  hunk_type : uint32_t {
  Undefined = 0 , Invalid = uint32_t(-1) , Code = Block::HUNK_CODE , CodePPC = Block::HUNK_PPC_CODE ,
  Data = Block::HUNK_DATA , Bss = Block::HUNK_BSS
}

Public Member Functions

 Hunk (hunk_type type, std::string name="image", unsigned flagsflags=LoadBlock::LoadAny)
 Hunk (hunk_type type, std::shared_ptr< Linker::Segment > segment, unsigned flagsflags=LoadBlock::LoadAny)
void ProduceBlocks (HunkFormat &fmt, Module &module)
 Converts the data collected by the linker into hunk blocks.
uint32_t GetMemorySize () const
 The amount of memory this hunk will take up after loading.
uint32_t GetFileSize () const
 The amount of bytes this hunk will take up in the file.
uint32_t GetSizeField (HunkFormat &fmt, Module &module)
 Retrieves the size field of the first block, to be stored in a header block.
void AppendBlock (std::shared_ptr< Block > block)
 Appends a new block to the block sequence and updates the internal structure of the hunk, used for reading.

Public Attributes

std::vector< std::shared_ptr< Block > > blocks
 The sequence of blocks the hunk is stored as.
hunk_type type = Undefined
LoadBlock::flag_type flags = LoadBlock::LoadPublic
std::shared_ptr< Linker::Contentsimage
 The memory image, if stored in a file (that is, a non-bss segment).
offset_t image_size = 0
 Size of the memory image, if it is a zero filled segment (bss).
std::string name
std::map< uint32_t, std::set< Relocation > > relocations
 Internal relocations, grouped according to addressed hunk number.
std::map< std::string, std::set< Relocation > > externals
 External relocations, grouped according to name of symbol (only for object files).

Detailed Description

The smallest loadable unit of a Hunk file is the hunk, it roughly corresponds to a segment in other file formats.


The documentation for this class was generated from the following files: