29 std::variant<Location, SymbolName>
target;
46 Target(SymbolName symbol,
bool segment_of =
false)
64 bool Displace(
const Displacement& displacement);
80 bool Lookup(Module&
object, Position& position);
83 bool operator==(
const Target& a,
const Target& b);
85 bool operator!=(
const Target& a,
const Target& b);
87 std::ostream& operator<<(std::ostream& out,
const Target& target);
Represents a single offset within a section, or an absolute location in memory if the section is null...
Definition location.h:17
Represents a possible target or reference frame of a relocation.
Definition target.h:24
bool ResolveLocals(Module &object)
If the target refers to an internal symbol, it gets resolved to a location.
Definition target.cc:21
bool segment_of
Whether the target is the segment, rather than the offset, of the location or symbol.
Definition target.h:33
std::variant< Location, SymbolName > target
The actual target, either an internal/absolute location, or an imported symbol.
Definition target.h:29
Target GetSegment()
Creates a new target that references the segment of this target.
Definition target.cc:7
bool Displace(const Displacement &displacement)
Recalculates target after a section has moved.
Definition target.cc:12
bool Lookup(Module &object, Position &position)
Returns a Position object for locations and internal symbols, if possible.
Definition target.cc:42