From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10880 invoked by alias); 9 Jun 2011 01:35:31 -0000 Received: (qmail 10791 invoked by uid 22791); 9 Jun 2011 01:35:31 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Jun 2011 01:35:17 +0000 Received: by pzk4 with SMTP id 4so614450pzk.0 for ; Wed, 08 Jun 2011 18:35:16 -0700 (PDT) Received: by 10.68.25.165 with SMTP id d5mr63143pbg.32.1307583316685; Wed, 08 Jun 2011 18:35:16 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id x1sm949108pbb.50.2011.06.08.18.35.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2011 18:35:16 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 79499170C1B4; Thu, 9 Jun 2011 11:05:10 +0930 (CST) Date: Thu, 09 Jun 2011 01:35:00 -0000 From: Alan Modra To: "H.J. Lu" Cc: binutils@sourceware.org Subject: Re: PATCH: PR ld/12851: --gc-sections doesn't work on note sections Message-ID: <20110609013510.GH4172@bubble.grove.modra.org> Mail-Followup-To: "H.J. Lu" , binutils@sourceware.org References: <20110608201014.GA10218@intel.com> <20110608235225.GF4172@bubble.grove.modra.org> <20110609002502.GG4172@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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: 2011-06/txt/msg00116.txt.bz2 On Wed, Jun 08, 2011 at 05:50:11PM -0700, H.J. Lu wrote: > doesn't check relocations in SHT_NOTE sections. I see. > I don't know > how default gc_mark_extra_sections can fix. Also when I add > debug and special sections, I get linker regressions. It seems > that we want to keep debug and special sections, but not sections > referenced by them. That's true, we don't want to keep sections referenced by debug sections. It's also the case that adding a default gc_mark_extra_sections really only benefits us if we want to implement dropping notes and other special sections when all other sections in a file are garbage collected. So for the time being I guess your patch is OK if you remove the SHT_NOTE test in elf_gc_sweep. Please also verify that your testcase behaves on Nick's large set of targets before committing. -- Alan Modra Australia Development Lab, IBM