From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 618BC384B0C1 for ; Tue, 21 Apr 2020 13:58:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 618BC384B0C1 Received: by mail-pg1-x532.google.com with SMTP id o15so6225146pgi.1 for ; Tue, 21 Apr 2020 06:58:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Qn4oWclU4kergm88ec5Bba5AQMo5n2BZuIZWtqXmCaU=; b=TM93khzKGKmN/MSYLoPiXmnJTPUs5Oe3Mh+cj6dom3oOracvPidA9RsB7kjipJETC+ aofOVYf/FCobClv18pdYM09zR6d0shE49kRuIhHRLliJqcu+xoLR/1XMC5cSvejkRKwY JINkWhyXg8Z7igrWIjL6Hk6vhfWfhvPrJO319FPyTCBmeDAWII4+ojtfjvYzgrt5PeME XVxkc47HjzZGrxiuBXa2X44t2iIHVI9mciE+lnGWyZhlfyKid91ojSXlj2+xJ3S4KEhj q4KeAjv+j5G2/h4aqbEHUYV+BGRxYx6dGE8vc5es45zbwGjXkEm1CI2ZHMOmRhQbOQUQ z5YQ== X-Gm-Message-State: AGi0PuYWroJ7JKwRIy4wfoTAWFe2jqeyFrFOTq4a9DL3jNq+Vhs3BJgC FGI6uamPjhmGm8JCl21KRvjpDRHrDrc= X-Google-Smtp-Source: APiQypKUy6ZM0afBnU92FetXEjKQN3VPgYO6Ea7ksZGja8WGPcQtKiCvBMTcBJdrkCBMr3R5BaLo8Q== X-Received: by 2002:a63:6b44:: with SMTP id g65mr2338709pgc.73.1587477526578; Tue, 21 Apr 2020 06:58:46 -0700 (PDT) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id y6sm2509445pjw.23.2020.04.21.06.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:58:45 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 20A7480FBB; Tue, 21 Apr 2020 23:28:39 +0930 (ACST) Date: Tue, 21 Apr 2020 23:28:39 +0930 From: Alan Modra To: Tamar Christina Cc: binutils@sourceware.org, Richard.Earnshaw@arm.com, nd@arm.com, ramana.radhakrishnan@arm.com Subject: Re: [PATCH][Binutils][Arm] BFD: Exclude sections with no content from compress check. Message-ID: <20200421135836.GF20514@bubble.grove.modra.org> References: <20200421134147.GA26729@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200421134147.GA26729@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 13:58:50 -0000 On Tue, Apr 21, 2020 at 02:41:52PM +0100, Tamar Christina wrote: > Hi All, > > The check in bfd_get_full_section_contents is trying to check that we don't > allocate more space for a section than the size of the section is on disk. > > Previously we excluded linker created sections since they didn't have a size on > disk. However we also need to exclude sections with no content as well such as > the BSS section. Space for these would not have been allocated by the assembler > and so the check would incorrectly fail. > > build on native hardware and regtested on > aarch64-none-elf, aarch64-none-elf (32 bit host), > aarch64-none-linux-gnu, aarch64-none-linux-gnu (32 bit host), > arm-none-eabi, arm-none-eabi (32 bit host), > arm-none-linux-gnueabihf, arm-none-linux-gnueabihf (32 bit host) > > Cross-compiled and regtested on > aarch64-none-linux-gnu, aarch64_be-none-linux-gnu, > arm-none-eabi, armeb-none-eabi, arm-wince-pe > > and no issues. > > Ok for master? and for backport to binutils-2.34? OK for both, except > + && (bfd_section_flags (sec) & SEC_HAS_CONTENTS) == SEC_HAS_CONTENTS the line is more than 80 chars, so we usually would write && (bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0 -- Alan Modra Australia Development Lab, IBM