From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16778 invoked by alias); 4 Dec 2007 10:02:26 -0000 Received: (qmail 16759 invoked by uid 22791); 4 Dec 2007 10:02:25 -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, 04 Dec 2007 10:02:07 +0000 Received: from firetop.home (85-211-128-93.dyn.gotadsl.co.uk [85.211.128.93]) by smtp.nildram.co.uk (Postfix) with ESMTP id 0110E2B7A6B; Tue, 4 Dec 2007 10:02:01 +0000 (GMT) Received: from richard by firetop.home with local (Exim 4.63) (envelope-from ) id 1IzUbL-00014Y-4g; Tue, 04 Dec 2007 10:02:03 +0000 From: Richard Sandiford To: Eric Botcazou Mail-Followup-To: Eric Botcazou ,binutils@sourceware.org, rsandifo@nildram.co.uk Cc: binutils@sourceware.org Subject: [PATCH 8/7] Fix --gc-sections for C++ MIPS ELF References: <87r6i4svjg.fsf@firetop.home> <200712022326.57206.ebotcazou@adacore.com> Date: Tue, 04 Dec 2007 10:02:00 -0000 In-Reply-To: <200712022326.57206.ebotcazou@adacore.com> (Eric Botcazou's message of "Sun\, 2 Dec 2007 23\:26\:57 +0100") Message-ID: <87y7ca3hic.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 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: 2007-12/txt/msg00022.txt.bz2 Eric Botcazou writes: >> Non-PIC CIEs for targets like x86_64-linux-gnu also have direct references >> to the personality routines. I suspect the only reason -Wl,--gc-sections >> -static-libgcc works for them is that libgcc's own CIEs use an indirect >> reference, so the section gets marked that way. > > The section is supposed to be always marked, see scripttempl/elf.sc. Gah! Sorry, I'm an idiot. I should have known to look for that. So we could fix the original problem by modifying the libgloss scripts instead. I still think the patches make the linker more robust though, both because it can then cope with scripts that don't have the KEEPs[*], and because it no longer discards sections referenced by unparseable .eh_frames. There's also the theoretical advantage that we can get rid of personality routines we don't need, although I doubt that occurs very often in practice. So I'd still like to go with these patches. [*] As a datapoint, current libgloss has 71 *.ld scripts, only 4 of which keep personality sections. I imagine quite a few users have their own local scripts too. Anyway, there's now an unscheduled eighth patch in the series. Thanks for the pointer! I repeated the original testing with this patch also applied, and there were no changes. Richard ld/scripttempl/ * armbpabi.sc (.text): Remove KEEP (*(.text.*personality*)). (.data): KEEP (*(.gnu.linkonce.d.*personality*)). * elf.sc: As for armbpabi.sc. * elfxtensa.sc: Likewise. * mep.sc: Likewise. Index: ld/scripttempl/armbpabi.sc =================================================================== --- ld/scripttempl/armbpabi.sc 2007-12-02 22:47:25.000000000 +0000 +++ ld/scripttempl/armbpabi.sc 2007-12-02 22:47:38.000000000 +0000 @@ -183,7 +183,6 @@ cat <