binutils Newspaper
JUNE 15, 2026
x86/intel Proposed

x86/Intel: Avoid infinite recursion in i386_intel_simplify_symbol()

Fixes potential infinite recursion in symbol simplification for x86/Intel assembly, but the proposed fix is suspected to be incorrect.

This patch attempts to fix a potential infinite recursion issue in the i386_intel_simplify_symbol() function within the binutils assembler, specifically for x86/Intel syntax. Alan Modra suspects that the proposed fix is not correct. The original bug can cause the assembler to enter an infinite loop when simplifying complex symbol expressions.

In the Thread 1 participant
  1. Alan Modra <amodra@gmail.com> reviewer

    Expresses concern that the proposed fix may be incorrect and provides a test case to illustrate the issue related to symbol simplification.

    “I suspect that trying to cut the loop like this is wrong.”

In Details

The i386_intel_simplify_symbol() function in as attempts to simplify symbol expressions in Intel syntax. This patch attempts to prevent infinite recursion when the symbol definitions form a cycle. The reviewer suspects the fix is wrong.

For Context

The GNU assembler (as) translates assembly language into machine code. This patch addresses a potential infinite loop within the assembler's x86/Intel syntax processing logic. When the assembler encounters complex or circular symbol definitions, a bug can cause it to get stuck in an infinite loop while trying to simplify the expression.

Filed Under: assemblerrecursionx86intelsymbol