Skip to contentSkip to conversation

MIPS: Calculate VMLINUZ_LOAD_ADDRESS based on the length of vmlinux.bin

PATCH In review Shmulik Ladkani 2 participants 2 messages Aug 31, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Calculate VMLINUZ_LOAD_ADDRESS based on the length of vmlinux.bin

Fix VMLINUZ_LOAD_ADDRESS calculation to be based on the length of vmlinux.bin, the actual uncompressed kernel binary.

Previously it was based on the length of KBUILD_IMAGE (the unstripped ELF vmlinux), which is bigger than vmlinux.bin.
As a result, vmlinuz was loaded into a memory address higher then actually needed - a problem for small memory platforms.

---

arch/mips/boot/compressed/Makefile +1 -1
index ed9bb70..5fd7f7a 100644
@@ -59,7 +59,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
 hostprogs-y := calc_vmlinuz_load_addr
 
 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
-		$(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS))
+		$(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
 
 vmlinuzobjs-y += $(obj)/piggy.o
 
Signature · 1 line
Shmulik Ladkani
Acked-by on v1 1/1
#1 lore raw

Hi,

This is a very good fix:

$ ls -sh arch/mips/boot/compressed/vmlinux.bin vmlinux
5.4M arch/mips/boot/compressed/vmlinux.bin  6.9M vmlinux

Thanks very much.

Regards,
Wu Zhangjin

Quoted 28 lines · Shmulik Ladkani

Fix VMLINUZ_LOAD_ADDRESS calculation to be based on the length of vmlinux.bin,
the actual uncompressed kernel binary.

Previously it was based on the length of KBUILD_IMAGE (the unstripped ELF vmlinux), which is bigger than vmlinux.bin.
As a result, vmlinuz was loaded into a memory address higher then actually needed - a problem for small memory platforms.

---

arch/mips/boot/compressed/Makefile +1 -2
index ed9bb70..5fd7f7a 100644
@@ -59,7 +59,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
 hostprogs-y := calc_vmlinuz_load_addr
 
 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
-		$(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS))
+		$(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
 
 vmlinuzobjs-y += $(obj)/piggy.o
 
--

Shmulik Ladkani