* Makefile.am: Strip gold section.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 10 Mar 2012 15:55:48 +0000 (16:55 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 10 Mar 2012 15:55:48 +0000 (16:55 +0100)
* conf/Makefile.common: Likewise.
* gentpl.py: Likewise.
* grub-core/Makefile.core.def: Likewise.
* grub-core/genmod.sh.in: Likewise.

ChangeLog
Makefile.am
conf/Makefile.common
gentpl.py
grub-core/Makefile.core.def
grub-core/genmod.sh.in

index 1c26fbb..90f489f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-03-10  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * Makefile.am: Strip gold section.
+       * conf/Makefile.common: Likewise.
+       * gentpl.py: Likewise.
+       * grub-core/Makefile.core.def: Likewise.
+       * grub-core/genmod.sh.in: Likewise.
+
 2012-03-10  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub.d/10_linux.in: Use stat if grub-probe on root fails.
index 42c3458..137dabb 100644 (file)
@@ -165,19 +165,19 @@ kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
        $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
 
 kfreebsd.aout: kfreebsd.elf
-       $(OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id
+       $(OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id -R .note.gnu.gold-version
 
 pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
        $(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32
 
 pc-chainloader.bin: pc-chainloader.elf
-       $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@;
+       $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
 
 ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
        $(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32
 
 ntldr.bin: ntldr.elf
-       $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@;
+       $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
 
 multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
        $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1
index 876f927..ff36e36 100644 (file)
@@ -72,9 +72,9 @@ LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_O
 CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
 CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
 if COND_CYGWIN
-STRIPFLAGS_KERNEL = -F elf32-i386 -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve
+STRIPFLAGS_KERNEL = -F elf32-i386 -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version
 else
-STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment
+STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .note.gnu.gold-version
 endif
 
 CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
index d7552d4..1115843 100644 (file)
--- a/gentpl.py
+++ b/gentpl.py
@@ -453,7 +453,7 @@ def image(platform):
 if test x$(USE_APPLE_CC_FIXES) = xyes; then \
   $(MACHO2IMG) $< $@; \
 else \
-  $(OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@; \
+  $(OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \
 fi
 """)
     return r
index ff01743..fe3032f 100644 (file)
@@ -37,13 +37,13 @@ kernel = {
 
   emu_ldflags              = '-Wl,-r,-d';
   i386_efi_ldflags         = '-Wl,-r,-d';
-  i386_efi_stripflags      = '--strip-unneeded -K start -R .note -R .comment';
+  i386_efi_stripflags      = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
   x86_64_efi_ldflags       = '-Wl,-r,-d';
-  x86_64_efi_stripflags    = '--strip-unneeded -K start -R .note -R .comment';
+  x86_64_efi_stripflags    = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
 
   ia64_efi_cflags = '-fno-builtin -fpic -minline-int-divide-max-throughput';
   ia64_efi_ldflags = '-Wl,-r,-d';
-  ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment';
+  ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
 
   i386_pc_ldflags          = '$(TARGET_IMG_LDFLAGS)';
   i386_pc_ldflags          = '$(TARGET_IMG_BASE_LDOPT),0x9000';
index 62a64ff..a992599 100644 (file)
@@ -60,7 +60,8 @@ if test x@TARGET_APPLE_CC@ != x1; then
            @STRIP@ --strip-unneeded \
                -K grub_mod_init -K grub_mod_fini \
                -K _grub_mod_init -K _grub_mod_fini \
-               -R .note.GNU-stack -R .note -R .comment $tmpfile || exit 1
+               -R .note.gnu.gold-version -R .note.GNU-stack \
+               -R .note -R .comment $tmpfile || exit 1
        fi
 else
     tmpfile2=${outfile}.tmp2