CensoredUsername/dynasm-rs

Make the Relocation API more strict

CensoredUsername opened this issue · 0 comments

Each implementer of DynasmLabelApi defines a Relocation type which should be used by the plugin to inform the runtime what kind of relocation is needed. Unfortunately, currently it is not possible to construct the associated type properly in the plugin code generation stage as is it only aware of the name that the assembler struct is bound to, and not the correct associated type. While future additions to rust might make this possible (in a typeof or decltype like manner), currently this means that the Relocation type is limited to being a simple type like a tuple of primitives, and that invalid values in these will cause an error at runtime.