* Makefile.am: Strip gold section.

* conf/Makefile.common: Likewise.
	* gentpl.py: Likewise.
	* grub-core/Makefile.core.def: Likewise.
	* grub-core/genmod.sh.in: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-10 16:55:48 +01:00
parent 1039c8eba4
commit 0f021838c4
6 changed files with 19 additions and 10 deletions

View file

@ -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.

View 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

View 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

View file

@ -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

View 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';

View 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