Fork me on GitHub

go-coff

Pure-Go PE/COFF tooling for UEFI โ€” turn relocatable objects or a PIE into a PE32+/EFI image, assemble UKIs, and sign for Secure Boot, all without binutils, LLD or objcopy.

no binutils / LLD / objcopy / sbsign amd64 ยท arm64 ยท riscv64 ยท loongarch64 zero third-party deps 100% coverage on the core
zsh
$ go get github.com/go-coff/peln@latest
$ go get github.com/go-coff/pectl@latest
$ go get github.com/go-coff/efipack@latest
$ go get github.com/go-coff/stub@latest
One organisation, 4 repositories

go-coff is a pure-Go toolchain for the PE/COFF object and executable format as used by UEFI. The peln library links relocatable .o files (or a position-independent ELF) into a self-contained PE32+/EFI application — the pure-Go replacement for lld-link /subsystem:efi_application — appends sections to an existing PE for UKI assembly (the objcopy --add-section equivalent), and emits non-UEFI bare-metal images (flat binary, Motorola SREC, Intel HEX, U-Boot uImage).

No C toolchain required. pectl is the single-static-binary reference CLI over peln — link, convert, objcopy, append, pack and Authenticode-sign — and efipack wraps an EFI binary into a self-extracting PE32+/EFI image (a UPX-equivalent for the format; host side shipped, runtime stub still to come). The core modules hold 100% statement coverage as a CI gate.

Repositories

peln lib

PE/COFF linker + section appender + bare-metal image formats

objects/PIE โ†’ PE32+ EFI (amd64 ยท arm64 ยท riscv64 ยท loongarch64)

pure-Go PE/COFF tooling for UEFI without binutils or LLD: linker (relocatable .o or PIE โ†’ PE32+/EFI, the lld-link /subsystem:efi_application replacement), appender (add sections to an existing PE โ€” objcopy --add-section, for UKI assembly), and fwimg for non-UEFI bare-metal images (ELF โ†’ flat binary, Motorola SREC, Intel HEX, U-Boot uImage). Zero third-party deps, 100% coverage.

CI coverage 100%

pectl cli

Reference CLI: link / convert / append / pack / sign

single static binary, no binutils / LLD / objcopy / sbsign

Cobra-based reference CLI over the peln library: links relocatable objects โ†’ PE32+/EFI, converts a PIE ELF โ†’ PE32+/EFI, runs objcopy-style ELF conversions, appends PE sections (UKI assembly), packs EFI binaries (via efipack), and Authenticode-signs for Secure Boot. Pure Go, no C toolchain. 100% coverage.

CI coverage 100%

efipack lib

Self-extracting PE32+/EFI compressor (UPX-equivalent)

host side only โ€” runtime decompressor stub is future work

pure-Go library that wraps a PE32+/EFI binary into a self-extracting PE32+/EFI image โ€” a UPX-equivalent for the EFI format, intended to mitigate the EDK2 OVMF amd64 CpuPageTableLib #GP on LoadImage/StartImage of large EFI binaries (cloud-boot M6.2). Current revision ships the host side: compression API, PE32+/EFI envelope assembly, arch detection (amd64/arm64/riscv64/loong64) and round-trip tests. The runtime per-arch decompressor stub is not yet implemented, so the output is not yet a runnable EFI.

CI

stub firmware

A UEFI Unified Kernel Image stub, in TinyGo

x86_64 ยท aarch64, booted under OVMF

The piece that removes systemd as a BUILD-TIME dependency for anybody assembling a UKI: pair it with peln and pectl and the whole pipeline runs without binutils and without systemd-stub. Written in TinyGo plus a thin assembly shim. <strong>Phase 3 (basic)</strong>: it boots under OVMF on both architectures, prints a banner through SimpleTextOutput, walks its own PE section table through EFI_LOADED_IMAGE_PROTOCOL, and chain-loads a .linux section through BootServices.LoadImage when one is present.

CI coverage 100%

Every module is pure Go with CGO_ENABLED=0 and no third-party dependencies. The peln library and the pectl CLI are held at 100% statement coverage as a CI gate; efipack ships its host side first and gates at 95% while the runtime decompressor stub is still in progress. PE32+/EFI output targets amd64, arm64, riscv64 and loongarch64.