-
v0.11.0 Stable
released this
2026-07-16 18:52:20 +00:00 | 269 commits to main since this releaseLinkable object output: external symbols and relocatable ELF / Mach-O
objects.Added
asm: object-file emission.gasm asm --format elfwrites an
ELF64 relocatable object and--format machoa Mach-O x86-64
MH_OBJECT: a code section (.text/__TEXT,__text) and a data
section (.data/__DATA,__data), a symbol table with one symbol per
TEXTandGLOBL(file-local<>symbols local, the rest global), and
one PC-relative relocation per static-symbol reference
(R_X86_64_PC32/X86_64_RELOC_SIGNED, the −4 addend the form needs).
The ELF output is verified end-to-end: a gasm-emitted object links with
a C driver and runs, resolving both a file-local constant and an
external symbol; the Mach-O output is verified structurally with
debug/macho.asm: external symbol references. A reference to a symbol no
GLOBLin the file defines no longer aborts assembly — it is recorded
as an external relocation (Image.Externals,FuncLayout.Relocs) and
becomes an undefined global symbol in the object output. The raw image
format (--format raw, the default) still reports them: only an object
file can represent a reference the linker must resolve.
Changed
gasm asmtakes a--format raw|elf|machoflag selecting what-o
writes; without--formatthe behaviour is unchanged (the concatenated
image).
Downloads