binutils Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gas

Fix unbounded recursion in i386 Intel syntax symbol simplification.

Gas assembler prevents infinite loops when simplifying symbols in i386 Intel syntax.

This commit reverts a problematic change in the gas assembler’s i386 Intel syntax simplification logic, which inadvertently caused unbounded recursion and symbol loop issues (PR 30308). The fix introduces immediate failure detection for symbol loops and revises the simplification process to correctly handle cases where symbols are identical or equated, preventing simplification after a loop is detected.

In Details

This commit reverts commit 85fb82cc8c which incorrectly marked and cleared 'resolved' states for X_add_symbol in i386_intel_simplify. The new logic in tc-i386-intel.c causes an immediate NULL return from i386_intel_simplify_symbol upon detecting a symbol loop, preventing problematic simplifications. It also adjusts simplification for O_add operations after such a loop detection. This addresses PR 30308's second testcase.

For Context
gas
The GNU Assembler, a component of the GNU Binutils project that translates assembly language code into machine code.
i386 Intel syntax
A specific assembly language syntax variant used for the Intel x86 architecture, differing from AT&T syntax.
symbol simplification
The process of reducing complex expressions involving symbols or equates to simpler forms during assembly, potentially optimizing or resolving references.
unbounded recursion
A situation where a function calls itself repeatedly without a proper termination condition, leading to excessive stack usage and program crashes.
symbol loop
A problematic situation in assembly or linking where symbols directly or indirectly refer to themselves, creating an unavoidable dependency cycle.
equates
Assembly language directives that assign a symbolic name to a constant value or another symbol.
PR 30308
Problem Report number 30308, concerning issues with symbol simplification and recursion in the gas assembler.
X_add_symbol
An internal gas representation for an addition operation involving symbols.
O_add
Likely refers to an operation type related to addition within the assembler's internal data structures.
Filed Under: assemblerbugfixx86