Commit 3bbadbdf authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] ppc32: Updated boot fix

This fixes booting on some PPC32 machines, notably CHRP and powermac
machines.  This is a modified version of Tom Rini's patch that addresses
the concerns I had with it.

The problem was that the linker script was getting included in the list
of things that got put together to make some of the sorts of bootable
images that we produce.  This removes ld.script in cases where it wasn't
appropriate and changes the rules in others so that although we have the
dependency on ld.script, it doesn't get included in the list of things
to link.
parent 59fe352b
...@@ -89,13 +89,14 @@ $(obj)/coffcrt0.o $(obj)/crt0.o: $(common)/crt0.S FORCE ...@@ -89,13 +89,14 @@ $(obj)/coffcrt0.o $(obj)/crt0.o: $(common)/crt0.S FORCE
$(call if_changed_dep,as_o_S) $(call if_changed_dep,as_o_S)
quiet_cmd_gencoffb = COFF $@ quiet_cmd_gencoffb = COFF $@
cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(filter-out FORCE,$^) && \ cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) $< $(LIBS) && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec) $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
targets += coffboot targets += coffboot
$(obj)/coffboot: $(COFFOBJS) $(obj)/image.o $(LIBS) FORCE $(obj)/coffboot: $(obj)/image.o $(COFFOBJS) $(LIBS) $(boot)/ld.script FORCE
$(call if_changed,gencoffb) $(call if_changed,gencoffb)
targets += coffboot.initrd targets += coffboot.initrd
$(obj)/coffboot.initrd: $(COFFOBJS) $(obj)/image.initrd.o $(LIBS) FORCE $(obj)/coffboot.initrd: $(obj)/image.initrd.o $(COFFOBJS) $(LIBS) \
$(boot)/ld.script FORCE
$(call if_changed,gencoffb) $(call if_changed,gencoffb)
...@@ -104,10 +105,10 @@ quiet_cmd_gen-coff = COFF $@ ...@@ -104,10 +105,10 @@ quiet_cmd_gen-coff = COFF $@
$(HACKCOFF) $@ && \ $(HACKCOFF) $@ && \
ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac
$(images)/vmlinux.coff: $(obj)/coffboot $(boot)/ld.script $(images)/vmlinux.coff: $(obj)/coffboot
$(call cmd,gen-coff) $(call cmd,gen-coff)
$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd $(boot)/ld.script $(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
$(call cmd,gen-coff) $(call cmd,gen-coff)
quiet_cmd_gen-elf-pmac = ELF $@ quiet_cmd_gen-elf-pmac = ELF $@
...@@ -116,19 +117,21 @@ quiet_cmd_gen-elf-pmac = ELF $@ ...@@ -116,19 +117,21 @@ quiet_cmd_gen-elf-pmac = ELF $@
$(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \ $(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
-R .comment $(del-ramdisk-sec) -R .comment $(del-ramdisk-sec)
$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) $(obj)/note $(boot)/ld.script $(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) \
$(obj)/note $(boot)/ld.script
$(call cmd,gen-elf-pmac) $(call cmd,gen-elf-pmac)
$(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \ $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
$(LIBS) $(obj)/note $(boot)/ld.script $(LIBS) $(obj)/note $(boot)/ld.script
$(call cmd,gen-elf-pmac) $(call cmd,gen-elf-pmac)
quiet_cmd_gen-chrp = CHRP $@ quiet_cmd_gen-chrp = CHRP $@
cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $^ && \ cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec) $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script $(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) $(boot)/ld.script
$(call cmd,gen-chrp) $(call cmd,gen-chrp)
$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script $(images)/zImage.initrd.chrp: $(obj)/image.initrd.o $(CHRPOBJS) $(LIBS) \
$(boot)/ld.script
$(call cmd,gen-chrp) $(call cmd,gen-chrp)
quiet_cmd_addnote = ADDNOTE $@ quiet_cmd_addnote = ADDNOTE $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment