From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5416 invoked by alias); 3 Apr 2019 16:45:50 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5402 invoked by uid 89); 3 Apr 2019 16:45:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.1 spammy=H*f:sk:fbb13f0, H*f:sk:87ef6ko, H*i:sk:87ef6ko X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Apr 2019 16:45:48 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id AAC62126F6; Wed, 3 Apr 2019 18:45:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1554309943; bh=44cEgovXjYsP2A7lY3tfx8FZ/cPx8pJ0fu0iW9PgVak=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To:From; b=bTmihXRpJcpWm9NdxHxyh32jRSeBxAVvaB0HsJTG37jvAVBfeeyq+Y91JutELhxdd fB2Jz/cMu9rrphHshF+YNcgwCc61SrSzHB1eSp1jzUlTARY9BPP1HkOukdS6N6lZj5 PZa3Mn2yZjU/k7njouArk5jq9y/f/BSYSoI3pbEEV4uiS/s6/d/y77KFmB8PFxmaOD uaTTJ9EsR1EvgaC4HmKMIATbW54y2pa+IOYAeBbmBEbSm79+eq4d4KCQ2lNVyfDeRK b6pulHLbYa1HfLh8r98J1FCmvhG4KxKQUXg73katJSmeav+Hrgfie6CBYVkTSzzrGf Epd3DbvYlazaA== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id A742011EAC; Wed, 3 Apr 2019 18:45:43 +0200 (CEST) Received: from [2001:4dd6:3f9d:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.6.0) (envelope-from ) id 5ca4e337-5f8a-7f0000012729-7f000001e62a-1 for ; Wed, 03 Apr 2019 18:45:43 +0200 Received: from [IPv6:2001:4dd6:3f9d:0:7285:c2ff:fe6c:992d] (2001-4dd6-3f9d-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd6:3f9d:0:7285:c2ff:fe6c:992d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Wed, 3 Apr 2019 18:45:40 +0200 (CEST) Subject: Re: Putting an all-zero variable into BSS To: Andreas Schwab Cc: gcc mailing list , "fortran@gcc.gnu.org" References: <87ef6koy6f.fsf@igel.home> From: Thomas Koenig Message-ID: <3930c1e6-fa7c-746b-c21a-8e8fa457deec@netcologne.de> Date: Wed, 03 Apr 2019 16:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <87ef6koy6f.fsf@igel.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2019-04/txt/msg00042.txt.bz2 Hi Andreas, > The large default initializers are all filled with zeros which end up in > the rodata section, like this: > > ... and so on. To reduce the size of the executable, it would make more > sense to put this into the BSS section. > > Note that .bss is writable. There is no read-only bss section. Well, nothing is going to write to it (this is not accessible by user code), so that should not be a problem. Regards Thomas