Skip to contentSkip to conversation

Use .incbin for piggy.o

PATCH New Brian Gerst 1 participant 1 message Aug 21, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use .incbin for piggy.o

Simplify creation of piggy.o (i386 arch) using .incbin instead of an ld script.

Several other arches use the same method, and should be changed accordingly by the respective maintainers.

--
Brian Gerst

arch/i386/boot/compressed/Makefile +1 -4
diff -urN linux-2.6.0-test3-bk/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
@@ -19,7 +19,4 @@
 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
 	$(call if_changed,gzip)
 
-LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
-
-$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
-	$(call if_changed,ld)
+$(obj)/piggy.o: $(obj)/vmlinux.bin.gz FORCE
arch/i386/boot/compressed/piggy.S +7 -0
diff -urN linux-2.6.0-test3-bk/arch/i386/boot/compressed/piggy.S linux/arch/i386/boot/compressed/piggy.S
@@ -0,0 +1,7 @@
+.data
+.globl input_len, input_data, input_data_end
+input_len:
+	.long input_data_end - input_data;
+input_data:
+	.incbin "arch/i386/boot/compressed/vmlinux.bin.gz"
+input_data_end:
arch/i386/boot/compressed/vmlinux.scr +0 -9
diff -urN linux-2.6.0-test3-bk/arch/i386/boot/compressed/vmlinux.scr linux/arch/i386/boot/compressed/vmlinux.scr
@@ -1,9 +0,0 @@
-SECTIONS
-{
-  .data : { 
-	input_len = .;
-	LONG(input_data_end - input_data) input_data = .; 
-	*(.data) 
-	input_data_end = .; 
-	}
-}