From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aQE6r-0005eQ-Lr for mharc-grub-devel@gnu.org; Mon, 01 Feb 2016 08:01:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQCku-0005vm-Rr for grub-devel@gnu.org; Mon, 01 Feb 2016 06:34:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQCkp-0005OI-0Y for grub-devel@gnu.org; Mon, 01 Feb 2016 06:34:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQCko-0005OE-RM for grub-devel@gnu.org; Mon, 01 Feb 2016 06:34:46 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 002DE5A4D; Mon, 1 Feb 2016 11:34:45 +0000 (UTC) Received: from [10.36.4.211] (vpn1-4-211.ams2.redhat.com [10.36.4.211]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11BYiSO030774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Feb 2016 06:34:45 -0500 Subject: Re: strip --strip-unneeded adds back section symbols To: Andrei Borzenkov , binutils@sourceware.org, The development of GNU GRUB References: From: Nick Clifton Organization: Red Hat Message-ID: <56AF42D3.9000109@redhat.com> Date: Mon, 1 Feb 2016 11:34:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Mon, 01 Feb 2016 08:01:36 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2016 11:34:54 -0000 Hi Andrei, > It appears that recent binutils (earliest version I have is 2.24) > unconditionally add back section symbols when copying sections. Please could you file a bug report about this in the binutils bugzilla system: https://sourceware.org/bugzilla/ > I verified that filter_symbols() in strip actually removes everything > from source module, and symbol table reappears deep in call chain > initiated by copy_section(), where STT_SECTION is unconditionally > added for every present section. > > Was this change intentional? Yes and no. The change to add a section symbol to any newly created section was intentional. This is helpful for a variety of reasons, not least being able to create relocations against that symbol. The side effect of adding a symbol when actually trying to strip unneeded symbols was unintentional, and is a bug. I have not investigated yet, but I suspect that the simplest solution will be to make strip rerun its symbol removing pass after having copied all of the sections. Cheers Nick