RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
Stores an absolute address along with the containing segment or address space. More...
#include <position.h>
Public Member Functions | |
Position (offset_t address=0, std::shared_ptr< Segment > segment=nullptr) | |
offset_t | GetSegmentOffset () const |
Returns the offset from the start of the segment. | |
Position & | operator+= (offset_t value) |
Arithmetic on the address. | |
Position & | operator-= (offset_t value) |
Arithmetic on the address. | |
Public Attributes | |
offset_t | address |
The address of the position, independent of segment it belongs to. | |
std::shared_ptr< Segment > | segment |
The segment or address space of the position. | |
Stores an absolute address along with the containing segment or address space.
When linking in large models, it is important to track if symbols belong to different segments/address spaces, so that a corresponding relocation can be generated for them. This class makes it easier to check whether the target and reference frame of a relocation is in the same address space.