From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15374 invoked by alias); 6 Jun 2003 14:32:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15366 invoked from network); 6 Jun 2003 14:32:01 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 6 Jun 2003 14:32:01 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h56EW0H03492 for ; Fri, 6 Jun 2003 10:32:00 -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 h56EW0I16575 for ; Fri, 6 Jun 2003 10:32:00 -0400 Received: from localhost.localdomain.redhat.com (vpn50-2.rdu.redhat.com [172.16.50.2]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h56EVv608337; Fri, 6 Jun 2003 10:31:58 -0400 To: Elena Zannoni Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: strip --strip-nondebug References: <16095.28727.461421.387212@localhost.redhat.com> <16095.39199.714582.752069@localhost.redhat.com> <16096.38018.961095.469616@localhost.redhat.com> From: Nick Clifton Date: Fri, 06 Jun 2003 14:32:00 -0000 In-Reply-To: <16096.38018.961095.469616@localhost.redhat.com> (Elena Zannoni's message of "Fri, 6 Jun 2003 09:17:54 -0400") Message-ID: User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00234.txt.bz2 Hi Elena, > > What is this section and how is it supposed to get into the stripped > > executable ? > > The strip utility does it. Ah - I was afraid of that. You see what I had hoped was that the GNU strip program would only ever have to produce *one* output file at a time. So you could use one command to strip an executable and a second command to create a debug-info file for that executable, rather than trying to do both things at once. (Which would mean a lot more changes to the internals of strip, something I was trying to avoid). If "--only-keep-debug" (my suggested new name for the --strip-nondebug switch) has to produce a debug-info file *and* a stripped executable with an extra .gnu_debuglink section in it, then it gets rather complicated... Of course we could have a five stage process: 1. strip --strip-debug foo.exe -o foo.exe.stripped 2. strip --only-keep-debug foo.exe -o foo.dbg 4. echo foo.dbg > debug_link 3. objcopy --add-section .gnu_debuglink=debug_link foo.stripped 5. rm debug_link I'll give it a go and see what happens. > BTW, I find it a bit silly that a non-gnu utility decided to use the > .gnu_debuglink name. Maybe you should call it somethign different, > and gdb can look for both names? I have no problem with the name. In fact I am very happy to keep calling it .gnu_debuglink. This assumes of course that there is some documentation as to the exact format of the contents of this section... Cheers Nick