[U-Boot] Most ARM CPU's have buggy clear_bss?

Albert ARIBAUD albert.aribaud at free.fr
Fri Oct 29 11:19:41 CEST 2010


Hi all,

Le 29/10/2010 10:50, Alexander Holler a écrit :
> Hello again,
>
> I'm leaving the problem description below, what fixed it all here was to
> add -fPIC to the CFLAGS to instruct the compiler to generate relocatable
> code (again).
>
> This flag was replaced in commit 92d5ecba47feb9961c3b7525e947866c5f0d2de5

Did you reach tis commit by dissecting?

> with -pie in LDFLAGS, which I don't understand (does not mean I have
> much experience how the compiler and linker are working in regard to
> relocatable code).
>
> Regards,
>
> Alexander

That needs some more analysis.

-fPIC without GOT relocation does nothing good, and with it, does not 
enough -- hence the ELF relocation patches replacing -fPIC with -pie, 
which is *intended* for relocating executables. these two machanisms are 
not meant to be used together.

Can you be more specific about this:

>> To verify the problem:
>>
>> Add
>>
>> #define DEBUG
>>
>> in top of arch/arm/lib/board.c
>>
>> and
>>
>> printf("nand_chip: %p\n",,&nand_chip[0]);
>>
>> in nand_init() in drivers/mtd/nand/nand.c
>>
>> and have a look at the output when u-boot comes up.

Precisely what is the output in both cases?

>> Regards,
>>
>> Alexander

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list