RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
Represents a possible target or reference frame of a relocation. More...
#include <target.h>
Public Member Functions | |
Target (std::variant< Location, SymbolName > target=Location(), bool segment_of=false) | |
Target (Location location, bool segment_of=false) | |
Target (SymbolName symbol, bool segment_of=false) | |
Target | GetSegment () |
Creates a new target that references the segment of this target. | |
bool | Displace (const Displacement &displacement) |
Recalculates target after a section has moved. | |
bool | ResolveLocals (Module &object) |
If the target refers to an internal symbol, it gets resolved to a location. | |
bool | Lookup (Module &object, Position &position) |
Returns a Position object for locations and internal symbols, if possible. | |
Public Attributes | |
std::variant< Location, SymbolName > | target |
The actual target, either an internal/absolute location, or an imported symbol. | |
bool | segment_of |
Whether the target is the segment, rather than the offset, of the location or symbol. | |
Represents a possible target or reference frame of a relocation.
When resolving a symbol as part of calculating a relocation, there are many possible outcomes. A symbol might reference an internal location, or an imported symbol. For segmented platforms, it might also reference the segment of a symbol, instead of an offset.
This class provides a representation for this structure.
bool Target::Displace | ( | const Displacement & | displacement | ) |
Recalculates target after a section has moved.
If the target references a location, this function displaces it. It does nothing for imported symbols.
Target Target::GetSegment | ( | ) |
Creates a new target that references the segment of this target.
For segment targets, it returns an identical Target object.
bool Target::ResolveLocals | ( | Module & | object | ) |
If the target refers to an internal symbol, it gets resolved to a location.