]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix tight loop on recursively-defined symbols
authorAlan Modra <amodra@gmail.com>
Fri, 15 May 2020 08:36:05 +0000 (18:06 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 15 May 2020 08:51:07 +0000 (18:21 +0930)
commit2a50b401465f74d7f3ee1654915b9070b4dc0fee
tree40b5b90d909e7fef28d2f4099d03f1a1ec5f84a8
parenta51951c25813b8d6c763f51d78d3756d9ca85ee1
Fix tight loop on recursively-defined symbols

This patch fixes a bug in GAS where the assembler enters a tight loop
when attempting to resolve recursively-defined symbols, e.g. when
trying to assemble "a=a".

This is a regression introduced between binutils 2.32 and 2.33,
by commit 1903f1385bff9

* symbols.c (struct local_symbol): Update comment.
(resolve_symbol_value): For resolved symbols equated to other
symbols, verify that the referenced symbol is not a local_symbol
before accessing sy_value.  Don't leave symbol loops during
finalize_syms resolution.
* testsuite/gas/all/assign-bad-recursive.d: New test.
* testsuite/gas/all/assign-bad-recursive.l: Error output for test.
* testsuite/gas/all/assign-bad-recursive.s: Assembly for test.
* testsuite/gas/all/gas.exp: Run it.
gas/ChangeLog
gas/symbols.c
gas/testsuite/gas/all/assign-bad-recursive.d [new file with mode: 0644]
gas/testsuite/gas/all/assign-bad-recursive.l [new file with mode: 0644]
gas/testsuite/gas/all/assign-bad-recursive.s [new file with mode: 0644]
gas/testsuite/gas/all/gas.exp