binutils Newspaper
OCTOBER 6, 2026
gas — Proposed

gas: support for .previous, .pushsection and .popsection pseudo ops for coff

Adds support for .previous, .pushsection, and .popsection pseudo-ops to the COFF target in gas.

This patch introduces support for the .previous, .pushsection, and .popsection pseudo-operations in the gas assembler for COFF targets. These pseudo-ops control section manipulation, similar to their ELF counterparts. This enhancement is a necessary step towards enabling the compilation of the Linux kernel as a Windows/ReactOS driver, indicating its importance for cross-platform development and compatibility.

In the Thread 1 participant
  1. Johannes Khoshnazar-Thoma proposer

    Submits a patch to add support for .previous, .pushsection, and .popsection pseudo-ops to the COFF target in the gas assembler.

    “This patch adds support for the .previous, .pushsection and .popsection pseudo-ops for COFF targets. The semantics are the same as their ELF counterparts.”

In Details

This patch extends the gas assembler's functionality for COFF object file formats by implementing section management pseudo-operations (.previous, .pushsection, .popsection). These directives are standard in ELF object file generation and allow finer control over section placement and grouping. Their addition to COFF is crucial for scenarios where code originating from or targeting ELF-like build processes needs to be compatible with COFF, such as building the Linux kernel for Windows environments (e.g., as a driver).

For Context
gas
The GNU Assembler, a component of the binutils package responsible for converting assembly language code into machine code.
COFF
Common Object File Format, an older standard for object files used on some Unix systems and by Windows.
pseudo-ops
Assembler directives that do not generate machine code but control the assembly process, such as defining sections or macros.
ELF
Executable and Linkable Format, a common standard file format for object files, executables, and shared libraries on Unix-like systems.
section
A distinct part of an object file or executable, such as the text (code), data, or BSS (uninitialized data) sections.
Filed Under: gasCOFFELFsectionscross-platform