binutils Newspaper
JUNE 15, 2026
binutils Proposed

macho gas support

A developer reports progress on Mach-O assembler support, noting some test failures and relocation issues on darwin17.

A developer provides an update on their work to support the Mach-O object file format in the GNU assembler (gas). They report that they were able to build gas for the i686-apple-darwin17 target (32-bit macOS), and that some tests now pass. They also note that some tests are still failing, and that there are issues with generating correct relocations for section differences. This work aims to allow gas to assemble code that can be linked into Mach-O binaries, which is useful for building software on macOS and other Apple platforms.

In the Thread 1 participant
  1. Iain Sandoe other

    Reports progress on Mach-O assembler support, noting some test failures and relocation issues on darwin17.

    “OK .. so I worked on darwin17 which is the last OS version to support native 32b officially (albeit deprecated). I built bfd, binutils and gas as 32b exes, using GCC-10.5 (unfortunately, the system clang does not build binutils on that platform). $ ./gas/as-new --version GNU assembler (GNU Binutils) 2.46.50.20260526 …”

In Details

The discussion concerns the effort to add Mach-O object file format support to the GNU assembler (gas). Mach-O is the object file format used by macOS and other Apple operating systems. The report highlights progress made in building gas for a 32-bit macOS target (darwin17) and identifies remaining test failures and relocation issues. The focus is on as-new, the new implementation of the assembler, and its ability to generate correct relocations for section differences in Mach-O binaries.

For Context

The GNU assembler (gas) is a crucial part of the toolchain that translates assembly code into machine code. This discussion involves adding support for the Mach-O object file format, which is used by macOS. The goal is to enable gas to assemble code that can be linked into applications and libraries on macOS. The developer is working on getting the assembler to generate the correct output and relocation information so that the resulting code can be linked correctly. Relocations are adjustments that the linker makes to the code to account for the final memory addresses of different parts of the program.

Filed Under: machogasassemblerbinutilsrelocation