From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11082 invoked by alias); 1 Jul 2005 13:31:51 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 11057 invoked by uid 22791); 1 Jul 2005 13:31:44 -0000 Received: from norbert.ecoscentric.com (HELO smtp.ecoscentric.com) (194.153.168.165) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 01 Jul 2005 13:31:44 +0000 Received: by smtp.ecoscentric.com (Postfix, from userid 99) id 873D165C082; Fri, 1 Jul 2005 14:31:42 +0100 (BST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by smtp.ecoscentric.com (Postfix) with ESMTP id 073E965C07D; Fri, 1 Jul 2005 14:31:39 +0100 (BST) Message-ID: <42C545C0.4090403@eCosCentric.com> Date: Fri, 01 Jul 2005 13:31:00 -0000 From: Jonathan Larmour User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) MIME-Version: 1.0 To: Alan Modra Cc: Eric Botcazou , binutils@sources.redhat.com Subject: Re: gc sections and .eh_frame References: <42A5DE0C.9050108@eCosCentric.com> <200506280940.28723.ebotcazou@adacore.com> <20050628114133.GC8706@bubble.grove.modra.org> <200506281357.59145.ebotcazou@adacore.com> <20050629012401.GD8706@bubble.grove.modra.org> <20050629135426.GD28975@bubble.grove.modra.org> <42C32126.9010409@eCosCentric.com> <20050630222755.GK28975@bubble.grove.modra.org> In-Reply-To: <20050630222755.GK28975@bubble.grove.modra.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00009.txt.bz2 Alan Modra wrote: > On Wed, Jun 29, 2005 at 11:31:02PM +0100, Jonathan Larmour wrote: > >>I updated my sources to current binutils CVS and rebuuilt my >>powerpc-eabi-ld. Unfortunately I now get the following when linking an >>application that uses C++ exceptions: >>`DW.ref._ZTISt9exception' referenced in section `.rodata' of >>/local/builds/toolchains/powerpc-eabi/tools/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/lib/nof/libsupc++.a(vterminate.o): >>defined in discarded section `.gnu.linkonce.s.DW.ref._ZTISt9exception' of >>/local/builds/toolchains/powerpc-eabi/tools/lib/gcc/powerpc-eabi/3.4.4/../../../../powerpc-eabi/lib/nof/libsupc++.a(vterminate.o)collect2: >>ld returned 1 exit status [snip] >>multiple instances of that section name, and only one is marked to be >>kept, but when duplicate .gnu.linkonce sections are removed, it is the >>other instance that is kept, and later when GC happens, even that one is >>removed. > > > No, GC isn't removing too many sections. The problem is that .eh_frame, > .gcc_exception_table, debug sections, and other sections on some targets > are not split per-function. When linkonce sections are removed, you are > left with references from these sections to the removed sections. The > linker knows this happens for certain section names, so doesn't warn, > but powerpc has been using .rodata instead of .gcc_exception_table.. Thanks for the explanation. I see that now. Unfortunately it doesn't leave any sysv4 powerpc target users (including powerpc-linux as you said before) much better off, since the GCC change to stop using .rodata hasn't even been committed to the trunk yet, nevermind any current release branches, and won't be widely disseminated until a while after that. Well, they're slightly better off since at least they now get an error rather than silent failure :-). But I've even less of an idea of how this could be addressed in binutils. The only way I can think of to identify the problematic powerpc GCC is the presence of .eh_frame with an absence of .gcc_except_table, and putting that knowledge in place in elf_link_input_bfd is a bit of a kludge. Any other ideas? > A workaround is to link with --noinhibit-exec. Ick. I'm sure we should be recommending something better than that. Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine