[U-Boot] [PATCH] Align end of bss by 4 bytes.
Graeme Russ
graeme.russ at gmail.com
Wed Oct 15 23:21:37 CEST 2008
On Thu, Oct 16, 2008 at 7:54 AM, Dan Malek <dan at embeddedalley.com> wrote:
>
> On Oct 15, 2008, at 1:17 PM, Selvamuthukumar wrote:
>
>> Most of the bss initialization loop increments 4 bytes
>> at a time. And the loop end is checked for an 'equal'
>> condition. Make the bss end address aligned by 4, so
>> that the loop will end as expected.
>
> IMHO, this is a bad programming practice to check
> for equal and make these assumptions. The code should
> be corrected to determine the proper size of the bss
> space and zero accordingly.... or at least test for
> greater than or equal.
I wholeheartedly agree - I had a similar problem with the command
table - The size was correct but the starting point was wrong (again
due to alignment issues) so the equal condition was never satisfied.
I have always been told than using equals in loop termination
conditions is a 'Very Bad Thing'(tm)
Regards,
Graeme
More information about the U-Boot
mailing list