From 2a50b401465f74d7f3ee1654915b9070b4dc0fee Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 15 May 2020 18:06:05 +0930 Subject: 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gas/ChangeLog') diff --git a/gas/ChangeLog b/gas/ChangeLog index 3a1f406fd82..2a987616ece 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,16 @@ +2020-05-15 Alan Modra + Alex Coplan + + * 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. + 2020-05-14 Nick Clifton * po/sv.po: Updated Swedish translation. -- cgit v1.2.1