[U-Boot] building u boot in freebsd

Jacky Cao cao.zhong1 at gmail.com
Sat Nov 13 19:49:55 CET 2010


I managed to build mpc8548 u-boot on FreeBSD with it's native powerpc cross
tools. All went fine after a little changes.

But at final linking stage, I got those "start.o(.got2+0x1c): relocation
truncated to fit: blah blah blah..." messages.

so I looked at .lds and it's write

*  .resetvec RESET_VECTOR_ADDRESS :*
*  {*
*    *(.resetvec)*
*  } :text = 0xffff*
*  . = RESET_VECTOR_ADDRESS + 0x4;*
*  /**
*   * Make sure that the bss segment isn't linked at 0x0, otherwise its*
*   * address won't be updated during relocation fixups.  Note that*
*   * this is a temporary fix.  Code to dynamically the fixup the bss*
*   * location will be added in the future.  When the bss relocation*
*   * fixup code is present this workaround should be removed.*
*   */*
*#if (RESET_VECTOR_ADDRESS == 0xfffffffc)*
*  . |= 0x10;*
*#endif*
*  __bss_start = .;*
*  .bss (NOLOAD)       :*
*  {*
*   *(.sbss) *(.scommon)*
*   *(.dynbss)*
*   *(.bss)*
*   *(COMMON)*
*  } :bss*
*  . = ALIGN(4);*
*  _end = . ;*
*  PROVIDE (end = .);*


Which cause my FreeBSD ld to do 64bit calculations, which lead to as in the
map file

*                0x0000000100000000                . = 0x100000000*
*                0x0000000100000010                . = 0x10*
*                0x0000000100000010                __bss_start = .*
*                ....blah blah blah...*

I haven't read u-boot code yet, could anybody tells me what this perpose is.
Is it safe to just put .=0x10 there instead of .|=0x10 ?


More information about the U-Boot mailing list