grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Build with -fno-dwarf2-cfi-asm


From: Colin Watson
Subject: Re: [PATCH] Build with -fno-dwarf2-cfi-asm
Date: Thu, 3 Sep 2009 16:27:57 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

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)
 address@hidden: #{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)
 address@hidden: #{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
 address@hidden: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF)
        -rm -f $@

-- 
Colin Watson                                       address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]