DWARF expressions are a part of DWARF information that are used for calculating the addresses of variables. They run on a simple stack machine. dwarbf

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-04-03 16:00:07

DWARF expressions are a part of DWARF information that are used for calculating the addresses of variables. They run on a simple stack machine.

dwarbf is a set of tools that embeds a Brainfuck interpreter inside the DWARF information for a Linux executable. The interpreter is implemented as a DWARF expression.

This will create a program executable in the current working directory. The executable will have a variable called dwarbf_program. Evaluating the address of this variable will execute the Brainfuck program using the embedded interpreter.

The dwarfas folder contains a DWARF expression assembler. It contains functions for assembling a string that holds a DWARF expression into a byte sequence that represents its binary encoding. It also has a function for creating an ELF executable that has the resulting DWARF expression embedded in the location information for a string variable.

The assembler supports comments on their own lines, prefixed with a #. It also supports labels for skip and bra instructions. Labels are of the form .label_name: and label references are of the form .label_name .

Leave a Comment