Re: [PATCH] Fix booting some PPC32 machines

From: Paul Mackerras
Date: Mon May 03 2004 - 19:37:03 EST


Tom Rini writes:

> Hello. The following patch fixes booting on some PPC32 machines with
> OpenFirmware, when booted without the aid of an additional bootloader.
> The problem is that the linker script for the 'zImage' type targets was
> put into the list of dependancies which objcopy would parse as a list of
> files to copy into the resulting image. The fix is to make the phony
> zImage targets depend on the linker script.

I don't like this part of the fix:

> $(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
> - $(LIBS) $(obj)/note $(boot)/ld.script
> + $(LIBS) $(obj)/note
> $(call cmd,gen-elf-pmac)

because the linking process (gen-elf-pmac) really does depend on
ld.script. Since gen-elf-pmac uses $<, not $^, it should be OK with
the ld.script in the dependencies. Did you verify that there was a
problem with this rule or did you just rip out all of the ld.script
dependencies?

Similarly we need the ld.script dependency in here:

> -$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS) $(boot)/ld.script
> +$(images)/zImage.chrp: $(CHRPOBJS) $(obj)/image.o $(LIBS)
> $(call cmd,gen-chrp)
> -$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS) $(boot)/ld.script
> +$(images)/zImage.initrd.chrp: $(CHRPOBJS) $(obj)/image.initrd.o $(LIBS)
> $(call cmd,gen-chrp)

Here, gen-chrp does have a problem because it uses $^, but it looks to
me that with a minor change it could just use $< and avoid the
problem.

The other places where you have removed ld.script from the
dependencies look OK to me.

Regards,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/