From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5734 invoked by alias); 10 Oct 2007 14:25:52 -0000 Received: (qmail 5713 invoked by uid 22791); 10 Oct 2007 14:25:51 -0000 X-Spam-Check-By: sourceware.org Received: from province.act-europe.fr (HELO province.act-europe.fr) (212.157.227.214) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Oct 2007 14:25:48 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-province.act-europe.fr (Postfix) with ESMTP id 6EE121666AF; Wed, 10 Oct 2007 16:25:45 +0200 (CEST) Received: from province.act-europe.fr ([127.0.0.1]) by localhost (province.act-europe.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kVWNV0RB2QE; Wed, 10 Oct 2007 16:25:45 +0200 (CEST) Received: from cardhu.act-europe.fr (cardhu.act-europe.fr [10.10.0.168]) by province.act-europe.fr (Postfix) with ESMTP id 3FE0A1666AE; Wed, 10 Oct 2007 16:25:45 +0200 (CEST) Received: by cardhu.act-europe.fr (Postfix, from userid 546) id 1B3F31C2; Wed, 10 Oct 2007 16:25:45 +0200 (CEST) Date: Wed, 10 Oct 2007 14:25:00 -0000 From: Olivier Hainque To: gcc-patches@gcc.gnu.org, rsandifo@nildram.co.uk Cc: hainque@adacore.com Subject: Re: [PATCH] restore NOSTRIP for .debug_frame on mips-irix Message-ID: <20071010142544.GA26713@cardhu.act-europe.fr> References: <20071008093304.GA7624@cardhu.act-europe.fr> <87bqb8gi2z.fsf@firetop.home> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <87bqb8gi2z.fsf@firetop.home> User-Agent: Mutt/1.4.1i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00567.txt.bz2 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1313 Hello Richard, Richard Sandiford wrote: > If we need this bit set for correctness, I think GAS should add it > automatically when the GAS (rather than IRIX) .section syntax is > used. The patch was simply modeled after what the compiler used to do. I agree that dealing with this in GAS looks cleaner. > GAS already knows that certain sections are special in certain ways, Indeed. > and if proper behaviour requires a GAS change too, I > suppose users will have to upgrade to newer binutils either way. Actually, we had observed the behavior with 2.16, this led to a discussion with a patch suggestion at http://www.cygwin.com/ml/binutils/2005-02/msg00688.html The patch was approved but apparently didn't go in and I was assuming it was still needed. However, I just tried my patched compiler with untouched 2.17 and 2.18 assemblers and both seem to propagate the extra NOSTRIP bit, so something else happened. Anyway, _bfd_mips_elf_fake_sections in bfd/elfxx-mips.c still really looks like the proper place to have this change as there is a lot of similar processing there already. The attached patch fixes the tiny case I posted, and I'd be happy to submit it to the binutils list after the required testing if you think is appropriate. Thanks for your feedback, Olivier --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mips-debug_frame_nostrip.dif" Content-length: 1008 *** bfd/elfxx-mips.c.ori 2007-10-10 09:28:42.715483416 -0400 --- bfd/elfxx-mips.c 2007-10-10 09:56:46.514369373 -0400 *************** _bfd_mips_elf_fake_sections (bfd *abfd, *** 5670,5676 **** hdr->sh_flags |= SHF_MIPS_NOSTRIP; } else if (CONST_STRNEQ (name, ".debug_")) ! hdr->sh_type = SHT_MIPS_DWARF; else if (strcmp (name, ".MIPS.symlib") == 0) { hdr->sh_type = SHT_MIPS_SYMBOL_LIB; --- 5670,5684 ---- hdr->sh_flags |= SHF_MIPS_NOSTRIP; } else if (CONST_STRNEQ (name, ".debug_")) ! { ! hdr->sh_type = SHT_MIPS_DWARF; ! ! /* Irix facilities such as libexc expect a single .debug_frame ! per executable, the system ones have NOSTRIP set and the linker ! doesn't merge sections with different flags so ... */ ! if (SGI_COMPAT (abfd) && CONST_STRNEQ (name, ".debug_frame")) ! hdr->sh_flags |= SHF_MIPS_NOSTRIP; ! } else if (strcmp (name, ".MIPS.symlib") == 0) { hdr->sh_type = SHT_MIPS_SYMBOL_LIB; --oyUTqETQ0mS9luUI--