[U-Boot] EABI 4.2

Martin Krause Martin.Krause at tqs.de
Wed Mar 10 17:52:40 CET 2010


Hi Jocke,

Joakim Tjernlund wrote on Wednesday, March 10, 2010 5:36 PM:
>> Andrew Dyer wrote on Wednesday, March 10, 2010 4:50 PM: [SNIP]
>> 
>> Hm, on the wikipedia article for the 'variable length arrays' (VLA) I
>> read, that the GNU C compiler always uses the stack for this type of
>> variables. So I think, if the stack is working for all other local
>> variables, it should not be an memory layout problem.
>> 
>> Eventually the following might be interesting. I have tried to make
>> the VLA much bigger, to eliminate 'normal' buffer overrun problems:
>> 
>> char filename[dirent.namelen + 1 + 2048]
>> 
>> But this leads to the same result, U-Boot dies. With an fixed length
>> array of comparable length it works:
>> 
>> char filename[2048]
>> 
>> Both (local) variables should end up on the stack.
> 
> Try alloca to see if stack allocs works at all in your toolchain.

I didn't find alloca(), so I tried it with __builtin_alloca().
The result is the same as with variable length array - u-boot
dies during the ext2ls command call.

Does this mean, my toolchain is broken? I use ELDK4.2 for ARM.

Regards,
Martin


More information about the U-Boot mailing list