]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
weakref gas internal error
authorAlan Modra <amodra@gmail.com>
Sat, 31 May 2025 04:19:24 +0000 (13:49 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 1 Jun 2025 03:51:00 +0000 (13:21 +0930)
This horrible testcase (cleaned up from oss-fuzz)
 r=x*2
 x=r-r
 .weakref r,x
 r=r-5
triggers resolve_symbol_value "gas_assert (final_val == 0)" in weakref
handling.

* read.c (assign_symbol): Clear weakrefr.

gas/read.c

index 145a39c8652eea002c3c9cbefcae9a747d229bb8..c9cbd224a7d50c5d6e2e18b4f60b9001c5744448 100644 (file)
@@ -3306,6 +3306,7 @@ assign_symbol (char *name, int mode)
         retain the value of the symbol at the point of use.  */
       else if (S_IS_VOLATILE (symbolP))
        symbolP = symbol_clone (symbolP, 1);
+      S_CLEAR_WEAKREFR (symbolP);
     }
 
   if (mode == 0)