
Dear Thomas,
in message 1106994990.5393.8.camel@gamecube.scs.ch you wrote:
Unless I'm doing something wrong, I also have to use binutils with the 'allow_branch_to_undefined' patch.
It looks to me that the code uses bal in an attempt to be position independent. It also uses a rather complicated got loading sequence. This is IMO futile, as the rest of u-boot (especially the copy to RAM routine) isn't position independent. So you can as well just load the full address of the called routines into a temporary register and jump through the register. See the patch below.
No, you're moving into the wrong direction. I hereby reject this patch, and will do the same woth all other attempts that go into that direction.
It was very unfortunate that the MIPS port copied the memory layout and relocation part from ARMBoot, which broke with the IMHO better design in PPCBoot. If we change the current code, then please let's do it right and implement it similar as on PowerPC, i. e. get rid of the hard-coded text addresses in RAM - instead let's auto-determine the relocation address based on the actual RAM size in the system, always relocating U-Boot to the very end of available RAM.
This is where the ARM and MIPS ports should move to.
Best regards,
Wolfgang Denk