From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id C8ED1385841A for ; Wed, 1 Mar 2023 04:00:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8ED1385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62b.google.com with SMTP id u5so9276637plq.7 for ; Tue, 28 Feb 2023 20:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677643206; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=LWwWI9eE9758RNUI1P0ZsTRrZlZOIn2/3etRXeR8z0w=; b=UnoswiMevX2ICb+dE0vG7Hjy90DcQEKjtFCAW7sdtVbKcLxbAN2l9VPjMQUoBPZcBn bhBZeFFJlkrS95iYJ4yuLZ8kBtmQMNF4Nqoa2q9/qV1aGOdOnOUlUm8dz6wpLB2/gaNO 9bXkKM/2gEjtZZLtYKwIS07Uq2RRgUYfOQMDU0dNQZuSEJIbZ2b/4k7E2VT2dP18MkYc JjMAhYYdbEWTpyU8QIyTMXhsHz0+vXvCAiFkTZ3XyfKlsRaEhoTCf29/NlTqDw1tjnKB oe2e6N1Hb7bWUD4S1bPL3cYeTO+4Ejyiz9n2Ivr/9D2meFmX/kmVStuBWIBsmA4qzVhY Evsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677643206; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LWwWI9eE9758RNUI1P0ZsTRrZlZOIn2/3etRXeR8z0w=; b=iotLjkm2+ZNbe8mI/Vi6qiMHdwZoyVfXwhPj7rGxjYnQdh224S35SNS02RV+G88/yo Stx8OW1qvGd30XPnR5uH+2RCI6T14oLcRSiLS+7kHtLamyzS7rvq7wKbwgbMlkFwLHXH 81nMGGAnJ0SxHXf9116Pq3GvvqC1hqqWT0+7NcKdJ2kN1caM81LR/TQxrGDynRqyAm/p BY39/X/N3LiVdzCJTOEaJZixWI1CIMqfNndtptGdMYpOL8i6xLr5nAgW9pWdsRGUFuum Xhctqb9Md93nN4v29AZ4ZkdiIZNKbqwKLUUtSWoYdN8djUJetlXMagiDE6stKXVIqWdk Fmrw== X-Gm-Message-State: AO0yUKUD+pzMdQ+mscMmCtmSt9req8GPyVrGm7kooxGmwIwXZe4aLY7P /XaQ6+tkvQjBGNHMNRKFG24ZhjM1ji8= X-Google-Smtp-Source: AK7set98SPxkplN9MBIHnhdXV1Ac8E22NFXyypPIu6nGH2Rh8Ql+FroCEvMmbzpApNZNzupWayzawg== X-Received: by 2002:a17:902:b082:b0:19d:1674:c04d with SMTP id p2-20020a170902b08200b0019d1674c04dmr4796924plr.61.1677643205743; Tue, 28 Feb 2023 20:00:05 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id jc11-20020a17090325cb00b0019682e27995sm7309549plb.223.2023.02.28.20.00.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 20:00:05 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 586291142D9B; Wed, 1 Mar 2023 14:30:03 +1030 (ACDT) Date: Wed, 1 Mar 2023 14:30:03 +1030 From: Alan Modra To: binutils@sourceware.org Subject: gas s_fill caused internal error in frag_new Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Fix an internal error after "non-constant fill count for absolute section". * read.c (s_fill): Don't create frags after errors. diff --git a/gas/read.c b/gas/read.c index d43584be28c..5d83d35e0aa 100644 --- a/gas/read.c +++ b/gas/read.c @@ -2201,22 +2201,32 @@ s_fill (int ignore ATTRIBUTE_UNUSED) as_warn (_("repeat < 0; .fill ignored")); size = 0; } - - if (size && !need_pass_2) + else if (size && !need_pass_2) { - if (now_seg == absolute_section) + if (now_seg == absolute_section && rep_exp.X_op != O_constant) { - if (rep_exp.X_op != O_constant) - as_bad (_("non-constant fill count for absolute section")); - else if (fill && rep_exp.X_add_number != 0) - as_bad (_("attempt to fill absolute section with non-zero value")); - abs_section_offset += rep_exp.X_add_number * size; + as_bad (_("non-constant fill count for absolute section")); + size = 0; + } + else if (now_seg == absolute_section && fill && rep_exp.X_add_number != 0) + { + as_bad (_("attempt to fill absolute section with non-zero value")); + size = 0; } else if (fill && (rep_exp.X_op != O_constant || rep_exp.X_add_number != 0) && in_bss ()) - as_bad (_("attempt to fill section `%s' with non-zero value"), - segment_name (now_seg)); + { + as_bad (_("attempt to fill section `%s' with non-zero value"), + segment_name (now_seg)); + size = 0; + } + } + + if (size && !need_pass_2) + { + if (now_seg == absolute_section) + abs_section_offset += rep_exp.X_add_number * size; if (rep_exp.X_op == O_constant) { -- Alan Modra Australia Development Lab, IBM