Fixes assembler symbol loop issue, adds test case
The assembler now correctly handles symbol definition loops, and a new test case prevents regressions.
The assembler had issues with symbol definition loops. This commit fixes this issue and adds a test case (gas/testsuite/gas/i386/intel-equ-loop.s) to ensure that the fix doesn’t regress. The test defines symbols in terms of themselves to create a loop and checks that the assembler reports an error.
In Details
This commit addresses PR30308, which involves symbol definition loops in the assembler. It introduces a new test case (intel-equ-loop.s) to gas/testsuite/gas/i386/ to prevent regressions. The test explicitly creates symbol definition loops using the .equ directive in Intel syntax.
For Context
The GNU Assembler (GAS) translates assembly language source code into machine code. Assembly code uses symbolic names (symbols) to represent memory locations or values. A symbol definition loop occurs when a symbol's definition depends on itself, either directly or indirectly. This commit fixes a bug in GAS that caused issues when encountering such loops, and adds a test to prevent regressions.