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.

CGO_ENABLED=0 no binutils / LLD / objcopy / sbsign amd64 · arm64 · riscv64 · loongarch64 zero third-party deps 100% coverage on the core
Documentation GitHub

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

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. BSD-3-Clause throughout.