From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8627 invoked by alias); 20 Jul 2010 05:45:11 -0000 Received: (qmail 8607 invoked by uid 22791); 20 Jul 2010 05:45:07 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Jul 2010 05:45:01 +0000 Received: by pwi8 with SMTP id 8so4952226pwi.0 for ; Mon, 19 Jul 2010 22:44:59 -0700 (PDT) Received: by 10.142.179.10 with SMTP id b10mr8718302wff.157.1279604699200; Mon, 19 Jul 2010 22:44:59 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id v38sm7338547wfh.0.2010.07.19.22.44.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Jul 2010 22:44:57 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 78261170C1F4; Tue, 20 Jul 2010 15:14:51 +0930 (CST) Date: Tue, 20 Jul 2010 05:45:00 -0000 From: Alan Modra To: Andreas Schwab Cc: "H.J. Lu" , David Stubbs , binutils@sourceware.org Subject: Re: VMA section overlap warnings for overlays Message-ID: <20100720054451.GF19525@bubble.grove.modra.org> Mail-Followup-To: Andreas Schwab , "H.J. Lu" , David Stubbs , binutils@sourceware.org References: <20100715130955.GH31087@bubble.grove.modra.org> <20100715141753.GI31087@bubble.grove.modra.org> <20100716093630.GN31087@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00264.txt.bz2 On Mon, Jul 19, 2010 at 02:42:58PM +0200, Andreas Schwab wrote: > ELF_SECTION_SIZE is also weird. It returns 0 for a .tbss section > outside a TLS segment, but that makes it impossible to distinguish it > from a genuine empty section. There are two uses of ELF_SECTION_SIZE > together with ELF_SECTION_IN_SEGMENT, which are in readelf.c end > elf32-spu.c. I think the one in elf32-spu.c can be removed. > Thus readelf -l never considers an empty section be part > of any segment, but removing the ELF_SECTION_SIZE check causes the .tbss > section to be mishandled. I think ELF_SECTION_IN_SEGMENT_1 should be > modified to handle the special case of .tbss directly. It will also need changing to properly handle zero size sections at the end of a segment. Currently, zero size sections may wrongly match at the end of a segment, or match multiple segments. For instance, if you just keep the special handling for .tbss in readelf but allow zero size sections, then a number of powerpc tests fail as follows: regexp_diff match failure regexp "^ +03 +\.tdata \.dynamic \.got \.plt $" line " 03 .tdata .dynamic .branch_lt .got .plt " regexp_diff match failure regexp "^ +04 +\.dynamic $" line " 04 .dynamic .branch_lt " FAIL: TLSTOC dynamic exec The first difference is expected; We now include the zero size .branch_lt in a PT_LOAD header. The second difference is problematic. .branch_lt doesn't really belong in PT_DYNAMIC. -- Alan Modra Australia Development Lab, IBM