Motorola Shared BSPs not Linking

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Apr 23 09:27:55 UTC 2012


On 04/05/2012 10:16 AM, Ralf Corsepius wrote:
> On 04/04/2012 03:34 PM, Ralf Corsepius wrote:
>> On 04/04/2012 02:49 PM, Ralf Corsepius wrote:
>>> On 02/23/2012 05:15 PM, Till Straumann wrote:
>>>>
>>>> My last build of 'master' still linked fine but that's been a while
>>>> (7/2011, I believe).
>>>
>>> FYI: I have narrowed down this breakdown to binutils.
>>>
>>> At least for me, building the mcp750 with gcc-4.6.x or gcc-4.7.0, _both_
>>> fail when using binutils-2.22, but both do _not fail_ when using
>>> binutils-2.20.1.
>>
>> It also works with binutils-2.21.1.
>>
>> => this issue was introduced between 2.21.1 and 2.22.
> FWIW: As far as I can gather is a behavioral change in ld since binutils-2.22
>
> It seems to error out when linkage encounters references to undefined symbols
> in linker scripts. This is unlike binutils < 2.22, which seem to have silently
> ignored them and "set them to 0".

I think this is a bug in ld introduced with 2.22.  We have this command line:

powerpc-rtems4.11-ld -o hello.ralf ../../../../../mcp750/lib/bootloader.o 
--just-symbols=hello.exe -b binary rtems.gz -T 
../../../../../mcp750/lib/ppcboot.lds -Map hello.map
../../../../../mcp750/lib/ppcboot.lds:97: undefined symbol `__rtems_start' 
referenced in expression

This "__rtems_start" is defined in "hello.exe" (defined in "vectors_entry.S"). 
  If I change "__rtems_start" to "boot_card" it get also  this error.  If I 
change it to "memcpy" the error disappears.  With older Binutils all versions work.

>
> That said, the patch below fixes this issue for me:
>
> index a2567a9..3ea50bb 100644
> --- a/c/src/lib/libbsp/powerpc/shared/bootloader/ppcboot.lds
> +++ b/c/src/lib/libbsp/powerpc/shared/bootloader/ppcboot.lds
> @@ -78,6 +78,7 @@ SECTIONS
>     }
>     PROVIDE(_binary_initrd_gz_start = 0);
>     PROVIDE(_binary_initrd_gz_end = 0);
> +  PROVIDE(__rtems_start = 0);
>     _rtems_gz_size = _binary_rtems_gz_end - _binary_rtems_gz_start;
>     _rtems_size = __rtems_end - __rtems_start;
>     .bss :
>
> Unless somebody objects, I am going to commit it.

I don't think this is the right fix.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list