From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25805 invoked by alias); 9 Oct 2007 20:16:35 -0000 Received: (qmail 25794 invoked by uid 22791); 9 Oct 2007 20:16:33 -0000 X-Spam-Check-By: sourceware.org Received: from smtp.nildram.co.uk (HELO smtp.nildram.co.uk) (195.112.4.54) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 09 Oct 2007 20:16:29 +0000 Received: from firetop.home (85-211-25-104.dyn.gotadsl.co.uk [85.211.25.104]) by smtp.nildram.co.uk (Postfix) with ESMTP id 145452E0DA2; Tue, 9 Oct 2007 21:15:45 +0100 (BST) Received: from richard by firetop.home with local (Exim 4.63) (envelope-from ) id 1IfLUa-0005N2-Ct; Tue, 09 Oct 2007 21:15:48 +0100 From: Richard Sandiford To: Olivier Hainque Mail-Followup-To: Olivier Hainque , gcc-patches@gcc.gnu.org, rsandifo@nildram.co.uk Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] restore NOSTRIP for .debug_frame on mips-irix References: <20071008093304.GA7624@cardhu.act-europe.fr> Date: Tue, 09 Oct 2007 20:16:00 -0000 In-Reply-To: <20071008093304.GA7624@cardhu.act-europe.fr> (Olivier Hainque's message of "Mon\, 8 Oct 2007 11\:33\:04 +0200") Message-ID: <87bqb8gi2z.fsf@firetop.home> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00508.txt.bz2 Olivier Hainque writes: > Hello, > > GCC used to set NOSTRIP bit on .debug_frame and doesn't any more. > > This is causing troubles when using the libexc system library e.g. > for frame unwinding purposes, because it expects a single .debug_frame > per executable, the section has NOSTRIP set in system objects and the > native linker doesn't merge those having the bit set together with > those not having it. > > Typically, for > > << /* t.c */ > #include > > int main (void) > { > trace_back_stack_and_print (); > return 0; > } > >> > > We see > > $ gcc -o t t.c -lexc > > $ elfdump -hv t | grep -A 1 debug_frame > [37] SHT_MIPS_DWARF 0 0x9bc0 0x4b0 .debug_frame > 0 0 0x4 0 0x00000000 > -- > [39] SHT_MIPS_DWARF 0 0xa5a6 0xa4 .debug_frame > 0 0 0x1 0 0x08000000 NOSTRIP > > $ ./t > libexc(158601884): FATAL ERROR update_obj_info: dwarf_elf_init failed > for ./t -- (107) DW_DLE_DEBUG_FRAME_DUPLICATE Only one .debug_frame > section is allowed > > The attached patch addresses this by overriding the default elf > asm_named_section implementation on irix for ".debug_frame" only, to > special case it in a similar fashion as before. > > Proper behavior with GNU as requires a change there as well to > propagate the flags down into the object, but this is a separate > issue. I'm not sure I agree. 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. GAS already knows that certain sections are special in certain ways, and if proper behaviour requires a GAS change too, I suppose users will have to upgrade to newer binutils either way. Richard