From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wegner Date: Thu, 29 Oct 2009 14:41:00 +0100 Subject: [U-Boot] FPGA relocation/C environment In-Reply-To: References: <20091029082113.GE3216@leila.ping.de> <20091029110000.EA98F19F73@gemini.denx.de> Message-ID: <20091029134059.GH3216@leila.ping.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 Joakim Tjernlund, On Thu, Oct 29, 2009 at 02:08:05PM +0100, Joakim Tjernlund wrote: > > Just to avoid any misunderstandings, the GOT does not hold offsets, it holds > absolute addresses. These addresses gets adjusted with an offset when you > relocate. thank you, I already understood this. As far as I can see there is already some GOT handling in cpu/mcf532x/start.S and the flags (-fPIC) in cpu/mcf532x/config.mk (and other coldfire ports, but MCF532x/MCF537x is what I am currently working on for testing), but somehow it does not work. However, it takes some time for me to understand the assembler code, especially the powerpc counterpart I am using as a reference. There is a __got_start and __got_end in my u-boot.map, so I would think the linker does behave correctly - but I did not yet check if all the symbols (better: symbols' addresses) expected to be there are really present: .reloc 0x00024600 0x1990 0x00024600 __got_start = . *(.got) .got 0x00024600 0x1990 cpu/mcf532x/cpu_init.o 0x00025f90 __got_end = . 0x00025f90 _GOT2_TABLE_ = . *(.got2) 0x00025f90 _FIXUP_TABLE_ = . *(.fixup) 0x00000000 __got2_entries = ((_FIXUP_TABLE_ - _GOT2_TABLE_) >> 0x2) 0x00000000 __fixup_entries = ((. - _FIXUP_TABLE_) >> 0x2) (flash resides at 0x0, SDRAM at 0x4000000 and CONFIG_SYS_MONITOR_BASE is 0x40020000) Regards, Wolfgang