• v0.11.0 Stable

    petrbalvin released this 2026-07-16 18:52:20 +00:00 | 269 commits to main since this release

    Linkable object output: external symbols and relocatable ELF / Mach-O
    objects.

    Added

    • asm: object-file emission. gasm asm --format elf writes an
      ELF64 relocatable object and --format macho a 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
      TEXT and GLOBL (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
      GLOBL in 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 asm takes a --format raw|elf|macho flag selecting what -o
      writes; without --format the behaviour is unchanged (the concatenated
      image).
    Downloads