Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

link

std › bitter › link

Positions bitter defines when it links a program, the way a linker defines _end. span(image_start, image_end) is the image’s size in bytes, and span(image_start, label) is label’s offset into it, however many files the program spans: what an executable header needs.

from std.bitter.deferred import *
from std.bitter.link import image_start, image_end

macro size_byte() {
    @emit Positioned<8> { value: span(image_start, image_end) }
}

size_byte
size_byte
02 02

Labels

LabelDescription
image_startThe first byte of the linked image.
image_endJust past the last byte of the linked image.