Module dynasmrt::components

source ·
Expand description

This module provides several reusable compoments for implementing assemblers

Structs

A registry of labels. Contains all necessessities for keeping track of dynasm labels. This is useful when implementing your own assembler and can also be used to query assemblers for the offsets of labels.
Literal pool implementation. One can programmatically push items in this literal pool and retrieve offsets to them in the pool. Then later, the pool will be encoded into the instruction stream and items can be retrieved using the address of the literal pool. and the previously emitted offsets. Values are always at least aligned to their size.
A registry of relocations that have been encoded previously, but need to be adjusted when the address of the buffer they reside in changes.
This struct implements a protection-swapping assembling buffer
An abstraction of a relocation of type R, located at location.
A registry of relocations and the respective labels they point towards.
A static label represents either a local label or a global label reference. Global labels are unique names, which can be referenced multiple times, but only defined once. Local labels are non-unique names. They can be referenced multiple times, and any reference indicates if they refer to a label after the reference, or a label before the reference. A static label records how many local labels with the same name have been emitted beforehand so we can treat them as local labels as well.