Skip to contentSkip to conversation

sparc: fix tfptboot.img for sparc64 on little-endian host

PATCH New Sam Ravnborg 1 participant 1 message Jan 4, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 7/10 sparc: fix tfptboot.img for sparc64 on little-endian host

piggyback_32 adapted to support sparc64:
- locating "HdrS" differs for sparc and sparc64
- sparc64 updates a_text, a_data + a_bss in the final a.out header

Updated Makefile to use piggyback_32 for sparc64.
Deleted the now unused piggyback_64.c

piggyback_32.c is host endian neutral and works on both little-endian and big-endian hosts.
This fixes a long standing bug where sparc64 could not generate tftpboot.img on a x86 host.

---
 arch/sparc/boot/Makefile       |    6 +-
 arch/sparc/boot/piggyback_32.c |   97 ++++++++++++++++++++++++++++-------
 arch/sparc/boot/piggyback_64.c |  110 ----------------------------------------
 3 files changed, 80 insertions(+), 133 deletions(-)
 delete mode 100644 arch/sparc/boot/piggyback_64.c
arch/sparc/boot/Makefile +3 -3
index 4c81fe5..06a79a2 100644
@@ -6,7 +6,7 @@
 ROOT_IMG	:= /usr/src/root.img
 ELFTOAOUT	:= elftoaout
 
-hostprogs-y	:= piggyback_32 piggyback_64 btfixupprep
+hostprogs-y	:= piggyback_32 btfixupprep
 targets		:= tftpboot.img btfix.o btfix.S image zImage vmlinux.aout
 clean-files	:= System.map
 
@@ -69,7 +69,7 @@ endif
 
 ifeq ($(CONFIG_SPARC64),y)
 quiet_cmd_piggy     = PIGGY   $@
-      cmd_piggy     = $(obj)/piggyback_64 $@ System.map $(ROOT_IMG)
+      cmd_piggy     = $(obj)/piggyback_32 $(BITS) $@ System.map $(ROOT_IMG)
 quiet_cmd_strip     = STRIP   $@
       cmd_strip     = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start vmlinux -o $@
 
@@ -82,7 +82,7 @@ $(obj)/image: vmlinux FORCE
 $(obj)/zImage: $(obj)/image
 	$(call if_changed,gzip)
 
-$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE
+$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_32 System.map $(ROOT_IMG) FORCE
 	$(call if_changed,elftoaout)
 	$(call if_changed,piggy)
 	@echo '  kernel: $@ is ready'
arch/sparc/boot/piggyback_32.c +77 -20

135 lines not on this page · raw message

arch/sparc/boot/piggyback_64.c deleted +0 -110

110 lines not on this page · raw message

Signature · 1 line
1.6.0.6