[U-Boot] Porting U-boot-2013-04 to sdk for mips board

Hi,
I am trying to port the u-boot2013:04 to sdk.During compilation,I am running into error:*Undefined reference to _GLOBAL_OFFSET_TABLE*.I checked in u-boot.lds file thr is no definition of _GLOBAL_OFFSET_TABLE.I have added this piece of code in u-boot.lds: .reloc : { KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); }
In addition,i see reference of GLOBAL_OFFSET_TABLE.But it is not defined in any file and even linker script. Can anyone please confirm,if this is common issue in u-boot version 2013:04.
Regards, krishna

2013/6/13 krishna dwivedi krishna.dwivedi01@gmail.com:
Hi,
I am trying to port the u-boot2013:04 to sdk.During compilation,I am running into error:*Undefined reference to _GLOBAL_OFFSET_TABLE*.I checked in u-boot.lds file thr is no definition of _GLOBAL_OFFSET_TABLE.I have added this piece of code in u-boot.lds: .reloc : { KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); }
In addition,i see reference of GLOBAL_OFFSET_TABLE.But it is not defined in any file and even linker script. Can anyone please confirm,if this is common issue in u-boot version 2013:04.
which toolchain respectively which gcc and ld version do you use? _GLOBAL_OFFSET_TABLE_ is automatically added by the linker.
For instance If you build qemu-mips with ELDK-5.3 you'll get this in u-boot.map
.got 0x00000000bfc2fe90 0x760 *(.got) .got 0x00000000bfc2fe90 0x760 arch/mips/cpu/mips32/start.o 0x00000000bfc2fe90 _GLOBAL_OFFSET_TABLE_ 0x00000000000001d8 num_got_entries = (SIZEOF (.got) >> 0x2) 0x00000000bfc305f0 . = ALIGN (0x4)
-- Best regards, Daniel

Hi All,
In mips,i dont see the .reloc section in u-boot.lds.But in other architechtures(like ppc),I see in u-boot.lds:
.reloc : { PROVIDE(_GOT2_TABLE_ = .); KEEP(*(.got2)) KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); _FIXUP_TABLE_ = .; KEEP(*(.fixup)) } __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
1)Can anyone please let me know,if we dont need to add .reloc section in u-boot.lds for MIPS processor?
2)I am newbie to u-boot,Please anyone provide me pointers what are the things i need to do lowlevel_init for my mips processor.
Regards, Krishna
On Thu, Jun 13, 2013 at 5:49 PM, krishna dwivedi < krishna.dwivedi01@gmail.com> wrote:
Hi,
I am trying to port the u-boot2013:04 to sdk.During compilation,I am running into error:*Undefined reference to _GLOBAL_OFFSET_TABLE*.I checked in u-boot.lds file thr is no definition of _GLOBAL_OFFSET_TABLE.I have added this piece of code in u-boot.lds: .reloc : { KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); }
In addition,i see reference of GLOBAL_OFFSET_TABLE.But it is not defined in any file and even linker script. Can anyone please confirm,if this is common issue in u-boot version 2013:04.
Regards, krishna

Hi Alll,
Can anyone please reply on this.
Regards, krishna
On Fri, Jun 14, 2013 at 10:14 AM, krishna dwivedi < krishna.dwivedi01@gmail.com> wrote:
Hi All,
In mips,i dont see the .reloc section in u-boot.lds.But in other architechtures(like ppc),I see in u-boot.lds:
.reloc : { PROVIDE(_GOT2_TABLE_ = .); KEEP(*(.got2))
KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); _FIXUP_TABLE_ = .; KEEP(*(.fixup))
} __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
1)Can anyone please let me know,if we dont need to add .reloc section in u-boot.lds for MIPS processor?
2)I am newbie to u-boot,Please anyone provide me pointers what are the things i need to do lowlevel_init for my mips processor.
Regards, Krishna
On Thu, Jun 13, 2013 at 5:49 PM, krishna dwivedi < krishna.dwivedi01@gmail.com> wrote:
Hi,
I am trying to port the u-boot2013:04 to sdk.During compilation,I am running into error:*Undefined reference to _GLOBAL_OFFSET_TABLE*.I checked in u-boot.lds file thr is no definition of _GLOBAL_OFFSET_TABLE.I have added this piece of code in u-boot.lds: .reloc : { KEEP(*(.got)) PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); }
In addition,i see reference of GLOBAL_OFFSET_TABLE.But it is not defined in any file and even linker script. Can anyone please confirm,if this is common issue in u-boot version 2013:04.
Regards, krishna
participants (2)
-
Daniel Schwierzeck
-
krishna dwivedi