Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MjEEI-00060O-2k for mharc-grub-devel@gnu.org; Thu, 03 Sep 2009 11:28:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjEEG-000600-Mo for grub-devel@gnu.org; Thu, 03 Sep 2009 11:28:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjEEC-0005wd-3d for grub-devel@gnu.org; Thu, 03 Sep 2009 11:28:04 -0400 Received: from [199.232.76.173] (port=45089 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjEEB-0005wP-TG for grub-devel@gnu.org; Thu, 03 Sep 2009 11:27:59 -0400 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:49894) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjEEB-0001Ol-HB for grub-devel@gnu.org; Thu, 03 Sep 2009 11:27:59 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1MjEEA-0007xD-EW for grub-devel@gnu.org; Thu, 03 Sep 2009 15:27:58 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1MjEE9-0005nz-00; Thu, 03 Sep 2009 16:27:57 +0100 Date: Thu, 3 Sep 2009 16:27:57 +0100 From: Colin Watson To: The development of GRUB 2 Message-ID: <20090903152757.GA13423@riva.ucam.org> References: <20090903102204.GU13423@riva.ucam.org> <20090903144740.GJ6656@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090903144740.GJ6656@thorin> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Build with -fno-dwarf2-cfi-asm X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 15:28:04 -0000 On Thu, Sep 03, 2009 at 04:47:40PM +0200, Robert Millan wrote: > On Thu, Sep 03, 2009 at 11:22:04AM +0100, Colin Watson wrote: > > I'd like to commit this for 1.97; it's important for users of recent > > distributions that use GCC 4.4 by default (which is the current release > > series of GCC). Otherwise, the core is too big to embed when using LVM > > and RAID (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/423412). > > Any objections? > > Very nice that you found this. I consider it a bug, and I agree it should > be fixed in 1.97. > > But shouldn't this be handled by `strip' instead? IIRC we already do it > this way for other unwanted sections. I just tried this out. It works in that the image is below 32KB again, but it's 30424 bytes rather than the 30331 bytes produced by not generating the unwind information in the first place. Based on the discussion in the patchwork.kernel.org URL, I think that GCC generates unwind information in two places in some cases; only one of those corresponds to an ELF section. I'm not terribly familiar with the details, though. For the record, this is the patch I tested: Index: genmk.rb =================================================================== --- genmk.rb (revision 2561) +++ genmk.rb (working copy) @@ -58,7 +58,7 @@ ifneq ($(TARGET_APPLE_CC),1) #{@name}: #{exe} - $(OBJCOPY) -O $(#{prefix}_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(#{prefix}_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .eh_frame -R .eh_frame_hdr $< $@ else ifneq (#{exe},kernel.exec) #{@name}: #{exe} ./grub-macho2img @@ -127,7 +127,7 @@ -rm -f $@ $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} if test ! -z \"$(TARGET_OBJ2ELF)\"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment -R .eh_frame -R .eh_frame_hdr $@ else #{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) -rm -f $@ -- Colin Watson [cjwatson@ubuntu.com]