From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id D4D1C3857C44; Thu, 9 Mar 2023 12:18:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4D1C3857C44 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] gas: allow frag address wrapping in absolute section X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: f2be4eeb6ce93e4dfab259587bcaf5cb861fc25b X-Git-Newrev: 2dc2dfa7d7a53aae58da4a51a77e9ad996cd2937 Message-Id: <20230309121843.D4D1C3857C44@sourceware.org> Date: Thu, 9 Mar 2023 12:18:43 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2023 12:18:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2dc2dfa7d7a5= 3aae58da4a51a77e9ad996cd2937 commit 2dc2dfa7d7a53aae58da4a51a77e9ad996cd2937 Author: Alan Modra Date: Thu Mar 9 16:35:12 2023 +1030 gas: allow frag address wrapping in absolute section =20 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. =20 * frags.c (frag_new): Allow address wrap in absolute section. Diff: --- gas/frags.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gas/frags.c b/gas/frags.c index 2a2806da835..016d857ded6 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -166,7 +166,8 @@ frag_new (size_t old_frags_var_max_size =20 /* Fix up old frag's fr_fix. */ frag_now->fr_fix =3D frag_now_fix_octets (); - gas_assert (frag_now->fr_fix >=3D old_frags_var_max_size); + gas_assert (frag_now->fr_fix >=3D old_frags_var_max_size + || now_seg =3D=3D absolute_section); frag_now->fr_fix -=3D old_frags_var_max_size; /* Make sure its type is valid. */ gas_assert (frag_now->fr_type !=3D 0);