From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16356 invoked by alias); 19 Jul 2010 12:43:13 -0000 Received: (qmail 16339 invoked by uid 22791); 19 Jul 2010 12:43:12 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Jul 2010 12:43:05 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6JCh14u022858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Jul 2010 08:43:01 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6JCgwCQ021681; Mon, 19 Jul 2010 08:43:00 -0400 From: Andreas Schwab To: "H.J. Lu" Cc: David Stubbs , binutils@sourceware.org Subject: Re: VMA section overlap warnings for overlays References: <20100424021750.GQ3510@bubble.grove.modra.org> <20100715130955.GH31087@bubble.grove.modra.org> <20100715141753.GI31087@bubble.grove.modra.org> <20100716093630.GN31087@bubble.grove.modra.org> X-Yow: Dehydrated EGGS are STREWN across ROULETTE TABLES.. Date: Mon, 19 Jul 2010 12:43:00 -0000 In-Reply-To: <20100716093630.GN31087@bubble.grove.modra.org> (Alan Modra's message of "Fri, 16 Jul 2010 19:06:30 +0930") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00247.txt.bz2 Alan Modra writes: > On Fri, Jul 16, 2010 at 09:39:16AM +0200, Andreas Schwab wrote: >> "H.J. Lu" writes: >> >> > Why does an empty section affect section layout? >> >> ??? That's the bug. > > I think we could probably remove all the sh_size != 0 tests associated > with ELF_SECTION_IN_SEGMENT in elf.c. I'm not sure why they were > there in the first place, possibly to cover bugs in the precursors to > ELF_SECTION_IN_SEGMENT. 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. 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. Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."