
wolfgang@leila.ping.de (Wolfgang Wegner) wrote on 29/10/2009 14:41:00:
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)
It seems like you don't have any relocation data as both __got2_entries and __fixup_entries are zero. Something seems broken in general, perhaps your linker script is bust?
(flash resides at 0x0, SDRAM at 0x4000000 and CONFIG_SYS_MONITOR_BASE is 0x40020000)