Documentation
¶
Overview ¶
Package linker provides a general-purpose in-memory linker, that is used to assemble the output buffer within the compiler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Linker ¶
type Linker struct {
// contains filtered or unexported fields
}
Linker implements a primitive linker, for writing symbols to an output buffer and resolving relocations at the very end.
A zero value is ready to use.
type Rel ¶
type Rel struct { Symbol any // The name of the symbol this relocation references. Offset uintptr // Offset of the relocation within [Sym.data]. Kind Kind }
Rel is a relocation within a [Symbol].
type Sym ¶
type Sym struct {
// contains filtered or unexported fields
}
Sym is all of the metadata associated with a symbol in Linker.
func (*Sym) At ¶
At returns a mutable reference to the data in the given range.
Pushing more data to this symbol may cause this to become invalidated.
func (*Sym) Push ¶
Push appends a value to this symbol, ensuring that it is correctly-aligned.
Returns the offset of the pushed data.
func (*Sym) PushBytes ¶
Push appends raw bytes to this symbol, ensuring that it is correctly-aligned.
Returns the offset of the pushed data.