Index: boot/arch/mips32/loader/Makefile
===================================================================
--- boot/arch/mips32/loader/Makefile	(revision 136edca07dac4855f2401e71778a4078795a3216)
+++ boot/arch/mips32/loader/Makefile	(revision 2b17f47a12be0ade0b8cfd4a26a738c33c7d2336)
@@ -34,8 +34,8 @@
 
 ifeq ($(IMAGE),binary)
-	BFD = binary
+	LD_IN = binary
 endif
 ifeq ($(IMAGE),ecoff)
-	BFD = ecoff-littlemips
+	LD_IN = ecoff
 endif
 BFD_NAME = elf32-tradlittlemips
@@ -109,8 +109,11 @@
 
 clean:
-	-rm -f _components.h _components.c _link.ld $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend
+	-rm -f _components.h _components.c _link.ld _link.ld.in $(COMPONENT_OBJECTS) $(OBJECTS) image.boot Makefile.depend
 
-_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS)
-	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD) $(BFD_ARCH) 4096 $(COMPONENTS)
+_components.h _components.c _link.ld $(COMPONENT_OBJECTS): $(COMPONENTS) _link.ld.in
+	../../../tools/pack.py $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) 4096 "unsigned int" $(COMPONENTS)
+
+_link.ld.in: _link.ld.in.$(LD_IN)
+	cp $< $@
 
 %.o: %.S
Index: boot/arch/mips32/loader/_link.ld.in
===================================================================
--- boot/arch/mips32/loader/_link.ld.in	(revision 136edca07dac4855f2401e71778a4078795a3216)
+++ 	(revision )
@@ -1,14 +1,0 @@
-	.boot 0xbfc00000: AT (0) {
-		*(BOOTSTRAP);
-		*(.text);
-		
-		*(.rodata);
-		*(.rodata.*);
-		*(.data);		/* initialized data */
-		*(.sdata);
-		*(.sdata2);
-		*(.sbss);
-		*(.scommon);
-		*(.bss);		/* uninitialized static variables */	
-		*(COMMON); 		/* global variables */
-		*(.reginfo);
Index: boot/arch/mips32/loader/_link.ld.in.binary
===================================================================
--- boot/arch/mips32/loader/_link.ld.in.binary	(revision 2b17f47a12be0ade0b8cfd4a26a738c33c7d2336)
+++ boot/arch/mips32/loader/_link.ld.in.binary	(revision 2b17f47a12be0ade0b8cfd4a26a738c33c7d2336)
@@ -0,0 +1,21 @@
+OUTPUT_FORMAT("binary") 
+ENTRY(start) 
+ 
+SECTIONS {
+	.boot 0xbfc00000: AT (0) {
+		*(BOOTSTRAP);
+		*(.text);
+		
+		*(.rodata);
+		*(.rodata.*);
+		*(.data);		/* initialized data */
+		*(.sdata);
+		*(.sdata2);
+		*(.sbss);
+		*(.scommon);
+		*(.bss);		/* uninitialized static variables */	
+		*(COMMON); 		/* global variables */
+		*(.reginfo);
+[[COMPONENTS]]
+	}
+}
Index: boot/arch/mips32/loader/_link.ld.in.ecoff
===================================================================
--- boot/arch/mips32/loader/_link.ld.in.ecoff	(revision 2b17f47a12be0ade0b8cfd4a26a738c33c7d2336)
+++ boot/arch/mips32/loader/_link.ld.in.ecoff	(revision 2b17f47a12be0ade0b8cfd4a26a738c33c7d2336)
@@ -0,0 +1,21 @@
+OUTPUT_FORMAT("ecoff-littlemips")
+ENTRY(start) 
+ 
+SECTIONS {
+	.boot 0xbfc00000: AT (0) {
+		*(BOOTSTRAP);
+		*(.text);
+		
+		*(.rodata);
+		*(.rodata.*);
+		*(.data);		/* initialized data */
+		*(.sdata);
+		*(.sdata2);
+		*(.sbss);
+		*(.scommon);
+		*(.bss);		/* uninitialized static variables */	
+		*(COMMON); 		/* global variables */
+		*(.reginfo);
+[[COMPONENTS]]
+	}
+}
