RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Amiga::HunkFormat::RelocatableBlock Class Referenceabstract

Represents the block that gives the memory loaded contents of the hunk (segment) More...

#include <hunk.h>

Inheritance diagram for Amiga::HunkFormat::RelocatableBlock:
Amiga::HunkFormat::Block Amiga::HunkFormat::BssBlock Amiga::HunkFormat::LoadBlock

Public Types

enum  {
  FlagMask = 0xE0000000 , BitAdvisory = 0x20000000 , BitChipMem = 0x40000000 , BitFastMem = 0x80000000 ,
  BitAdditional = 0xC0000000
}
 
enum  flag_type {
  LoadAny = 0x00000000 , LoadPublic = 0x00000001 , LoadChipMem = 0x00000002 , LoadFastMem = 0x00000004 ,
  LoadLocalMem = 0x00000008 , Load24BitDma = 0x00000010 , LoadClear = 0x00010000
}
 
- Public Types inherited from Amiga::HunkFormat::Block
enum  block_type {
  HUNK_UNIT = 0x3E7 , HUNK_NAME = 0x3E8 , HUNK_CODE = 0x3E9 , HUNK_DATA = 0x3EA ,
  HUNK_BSS = 0x3EB , HUNK_ABSRELOC32 = 0x3EC , HUNK_RELRELOC16 = 0x3ED , HUNK_RELRELOC8 = 0x3EE ,
  HUNK_EXT = 0x3EF , HUNK_SYMBOL = 0x3F0 , HUNK_DEBUG = 0x3F1 , HUNK_END = 0x3F2 ,
  HUNK_HEADER = 0x3F3 , HUNK_OVERLAY = 0x3F5 , HUNK_BREAK = 0x3F6 , HUNK_DRELOC32 = 0x3F7 ,
  HUNK_DRELOC16 = 0x3F8 , HUNK_DRELOC8 = 0x3F9 , HUNK_LIB = 0x3FA , HUNK_INDEX = 0x3FB ,
  HUNK_RELOC32SHORT = 0x3FC , HUNK_RELRELOC32 = 0x3FD , HUNK_ABSRELOC16 = 0x3FE , HUNK_PPC_CODE = 0x4E9 ,
  HUNK_RELRELOC26 = 0x4EC , HUNK_V37_RELOC32SHORT = 0x3F7
}
 

Public Member Functions

 RelocatableBlock (block_type type, uint32_t flags=LoadAny)
 
uint32_t GetSizeField () const
 Returns the 32-bit longword that stores the size of the segment plus 2 flag bits.
 
bool RequiresAdditionalFlags () const
 Returns true if an additional 32-bit longword is needed for flags.
 
uint32_t GetAdditionalFlags () const
 The contents of an additional 32-bit longword is needed for flags.
 
void Read (Linker::Reader &rd) override
 Reads the rest of the block after the type word.
 
void Write (Linker::Writer &wr) const override
 Writes the entire block into a file.
 
offset_t FileSize () const override
 Returns the size of the block as stored inside a file.
 
void AddExtraFields (Dumper::Region &region, const Module &module, const Hunk *hunk, unsigned index, offset_t current_offset) const override
 
- Public Member Functions inherited from Amiga::HunkFormat::Block
 Block (block_type type, bool is_executable=false)
 
virtual void Dump (Dumper::Dumper &dump, const Module &module, const Hunk *hunk, unsigned index, offset_t current_offset) const
 
void AddCommonFields (Dumper::Region &region, unsigned index) const
 

Public Attributes

flag_type flags
 
bool loaded_with_additional_flags = false
 
- Public Attributes inherited from Amiga::HunkFormat::Block
block_type type
 
bool is_executable = false
 Required because V37 executables define HUNK_DRELOC32 as HUNK_RELOC32SHORT, must block types ignore this field and it is not stored.
 

Protected Member Functions

virtual uint32_t GetSize () const =0
 The actual size of the segment data, as a count of 32-bit longwords.
 
virtual void ReadBody (Linker::Reader &rd, uint32_t longword_count)
 Reads the segment data (if any)
 
virtual void WriteBody (Linker::Writer &wr) const
 Writes the segment data (if any)
 

Additional Inherited Members

- Static Public Member Functions inherited from Amiga::HunkFormat::Block
static std::shared_ptr< BlockReadBlock (Linker::Reader &rd, bool is_executable=false)
 Reads a single block from file.
 

Detailed Description

Represents the block that gives the memory loaded contents of the hunk (segment)

Member Function Documentation

◆ AddExtraFields()

void HunkFormat::RelocatableBlock::AddExtraFields ( Dumper::Region & region,
const Module & module,
const Hunk * hunk,
unsigned index,
offset_t current_offset ) const
overridevirtual

Reimplemented from Amiga::HunkFormat::Block.

◆ FileSize()

offset_t HunkFormat::RelocatableBlock::FileSize ( ) const
overridevirtual

Returns the size of the block as stored inside a file.

Reimplemented from Amiga::HunkFormat::Block.

◆ GetSize()

virtual uint32_t Amiga::HunkFormat::RelocatableBlock::GetSize ( ) const
protectedpure virtual

The actual size of the segment data, as a count of 32-bit longwords.

Implemented in Amiga::HunkFormat::LoadBlock, and Amiga::HunkFormat::BssBlock.

◆ Read()

void HunkFormat::RelocatableBlock::Read ( Linker::Reader & rd)
overridevirtual

Reads the rest of the block after the type word.

Reimplemented from Amiga::HunkFormat::Block.

◆ ReadBody()

void HunkFormat::RelocatableBlock::ReadBody ( Linker::Reader & rd,
uint32_t longword_count )
protectedvirtual

Reads the segment data (if any)

Reimplemented in Amiga::HunkFormat::LoadBlock, and Amiga::HunkFormat::BssBlock.

◆ Write()

void HunkFormat::RelocatableBlock::Write ( Linker::Writer & wr) const
overridevirtual

Writes the entire block into a file.

Reimplemented from Amiga::HunkFormat::Block.

◆ WriteBody()

void HunkFormat::RelocatableBlock::WriteBody ( Linker::Writer & wr) const
protectedvirtual

Writes the segment data (if any)

Reimplemented in Amiga::HunkFormat::LoadBlock.


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