[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH]: Strip boot block built objects.
From: |
David Miller |
Subject: |
[PATCH]: Strip boot block built objects. |
Date: |
Wed, 04 Mar 2009 01:12:21 -0800 (PST) |
In order for the boot block images for sparc to work properly,
we have to strip them out before doing the objcopy.
This is harmless on i386-pc and some other future grub
targets might need this too, so do it universally.
2009-03-04 David S. Miller <address@hidden>
* genmk.rb: Strip object files built for boot images.
* conf/i386-pc.mk: Rebuilt.
* conf/sparc64-ieee1275.mk: Likewise.
---
conf/i386-pc.mk | 6 ++++++
conf/sparc64-ieee1275.mk | 2 ++
genmk.rb | 1 +
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk
index 98dcbd2..dab7d40 100644
--- a/conf/i386-pc.mk
+++ b/conf/i386-pc.mk
@@ -25,6 +25,7 @@ boot.img: boot.exec
boot.exec: boot_img-boot_i386_pc_boot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S
$(boot/i386/pc/boot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -MD -c -o $@ $<
@@ -43,6 +44,7 @@ pxeboot.img: pxeboot.exec
pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S
$(boot/i386/pc/pxeboot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_ASFLAGS) -MD -c -o $@ $<
@@ -61,6 +63,7 @@ diskboot.img: diskboot.exec
diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S
$(boot/i386/pc/diskboot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -MD -c -o $@ $<
@@ -79,6 +82,7 @@ lnxboot.img: lnxboot.exec
lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S
$(boot/i386/pc/lnxboot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(lnxboot_img_ASFLAGS) -MD -c -o $@ $<
@@ -97,6 +101,7 @@ cdboot.img: cdboot.exec
cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S
$(boot/i386/pc/cdboot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(cdboot_img_ASFLAGS) -MD -c -o $@ $<
@@ -126,6 +131,7 @@ kernel.img: kernel.exec
kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o
kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o
kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o
kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o
kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o
kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o
kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o
kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o
kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o
kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o
kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o
kernel_img-symlist.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S
$(kern/i386/pc/startup.S_DEPENDENCIES)
$(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS)
-DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_ASFLAGS) -MD -c -o $@ $<
diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk
index 0d69eac..3d9c400 100644
--- a/conf/sparc64-ieee1275.mk
+++ b/conf/sparc64-ieee1275.mk
@@ -23,6 +23,7 @@ boot.img: boot.exec
boot.exec: boot_img-boot_sparc_ieee1275_boot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
boot_img-boot_sparc_ieee1275_boot.o: boot/sparc/ieee1275/boot.S
$(boot/sparc/ieee1275/boot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/sparc/ieee1275 -I$(srcdir)/boot/sparc/ieee1275
$(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -MD -c -o
$@ $<
@@ -41,6 +42,7 @@ diskboot.img: diskboot.exec
diskboot.exec: diskboot_img-boot_sparc_ieee1275_diskboot.o
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
diskboot_img-boot_sparc_ieee1275_diskboot.o: boot/sparc/ieee1275/diskboot.S
$(boot/sparc/ieee1275/diskboot.S_DEPENDENCIES)
$(TARGET_CC) -Iboot/sparc/ieee1275 -I$(srcdir)/boot/sparc/ieee1275
$(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -MD
-c -o $@ $<
diff --git a/genmk.rb b/genmk.rb
index fe022cd..83ef639 100644
--- a/genmk.rb
+++ b/genmk.rb
@@ -61,6 +61,7 @@ MOSTLYCLEANFILES += #{deps_str}
#{exe}: #{objs_str}
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
+ $(STRIP) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $@
" + objs.collect_with_index do |obj, i|
src = sources[i]
--
1.6.1.2.253.ga34a
- [PATCH]: Strip boot block built objects.,
David Miller <=