]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: allow frag address wrapping in absolute section
authorAlan Modra <amodra@gmail.com>
Thu, 9 Mar 2023 06:05:12 +0000 (16:35 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 9 Mar 2023 12:17:51 +0000 (22:47 +1030)
This:
 .struct -1
x:
 .fill 1
y:
results in an internal error in frag_new due to abs_section_offset
wrapping from -1 to 0.  Frags in the absolute section don't do much so
I think we can allow the address wrap.

* frags.c (frag_new): Allow address wrap in absolute section.

gas/frags.c

index 2a2806da8354f0cd95d75ef81f7144702588230b..016d857ded6623113157a9abac8822d7241aeca2 100644 (file)
@@ -166,7 +166,8 @@ frag_new (size_t old_frags_var_max_size
 
   /* Fix up old frag's fr_fix.  */
   frag_now->fr_fix = frag_now_fix_octets ();
-  gas_assert (frag_now->fr_fix >= old_frags_var_max_size);
+  gas_assert (frag_now->fr_fix >= old_frags_var_max_size
+             || now_seg == absolute_section);
   frag_now->fr_fix -= old_frags_var_max_size;
   /* Make sure its type is valid.  */
   gas_assert (frag_now->fr_type != 0);