From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8022 invoked by alias); 18 Oct 2004 14:19:59 -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 8010 invoked from network); 18 Oct 2004 14:19:56 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 18 Oct 2004 14:19:56 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9IEJu8V022991 for ; Mon, 18 Oct 2004 10:19:56 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9IEJpr03979; Mon, 18 Oct 2004 10:19:51 -0400 Received: from [172.31.0.98] (vpnuser6.surrey.redhat.com [172.16.9.6]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i9IEJoYo007603; Mon, 18 Oct 2004 10:19:50 -0400 Message-ID: <4173D24F.1030407@redhat.com> Date: Mon, 18 Oct 2004 14:19:00 -0000 From: Nick Clifton User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) MIME-Version: 1.0 To: Jan Beulich CC: binutils@sources.redhat.com Subject: Re: stripping symbols needed for relocations References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00282.txt.bz2 Hi Jan, > The --strip-all case is out of question, but my concern is primarily > with the combination of --strip-symbol/--strip-symbols and -w, but to > some degree also with the plain use of --strip-symbol/--strip-symbols: > When trying to cut down the number of symbols in the linux kernel > (subject to kallsyms lookup) I'm trying to eliminate all non-text > symbols. Finding them is not a problem, but filtering out those used in > relocations is, which is why I'd want objcopy to do this for me. Since > I'm of the general opinion that --strip-symbol for symbols used in > relocations for non-discarded sections (which I would hope already don't > get the BSF_KEEP flag set) will result in a broken output file, I'd like > to make objcopy smart enough to deal with that situation (possibly > through a new option --keep-needed or --force-strip-needed, depending on > what the desirable default would be and whether keeping the current > behavior is a requirement). OK - I see your point. My original thinking was that if the user had specified --strip-symbol=foo on the objcopy command line then that meant that they definitely wanted "foo" stripped out, even if it was used in a reloc, and that they knew what they were doing. Given that we are dealing with the binutils here, where you are allowed to shoot yourself in the foot if you do not know what you are doing, I think that this behaviour of the --strip-symbol switch should be retained. I would have no objections however to a patch which added another switch, say --strip-unused-symbol=<>, or indeed the --keep-needed switch you suggested, in order to provide a safer environment for stripping symbols. Cheers Nick