From: Wolfgang Denk Date: Sat, 29 Jan 2005 18:08:33 +0100 Subject: [U-Boot-Users] MIPS build environment In-Reply-To: Your message of "Sat, 29 Jan 2005 11:36:30 +0100." <1106994990.5393.8.camel@gamecube.scs.ch> Message-ID: <20050129170838.603C6C108D@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Obviously, a major malfunction has occurred." -- Steve Nesbitt, voice of Mission Control, January 28, 1986, as the shuttle Challenger exploded within view of the grandstands.