diff --git a/ChangeLog b/ChangeLog index 1c26fbb24..90f489f17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-03-10 Vladimir Serbinenko + + * 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 * util/grub.d/10_linux.in: Use stat if grub-probe on root fails. diff --git a/Makefile.am b/Makefile.am index 42c34581d..137dabb4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/conf/Makefile.common b/conf/Makefile.common index 876f9273c..ff36e36bd 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -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 diff --git a/gentpl.py b/gentpl.py index d7552d43d..1115843b0 100644 --- 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 diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index ff0174307..fe3032f97 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -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'; diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 62a64ffa6..a992599f1 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -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