forked from Imagelibrary/rtems
Problem report from Brian Cuthie regarding incorrect calculation
of BSS size. The conversion from a count of u8's to a count of u32's was shifting in the wrong direction. This error had been in the start code a long time. It had not caused problems because the BSS is typically much smaller than the C heap which typically follows it in memory. Plus since this code was executed at start time, all that really happened was an extra zeroing of some memory.
This commit is contained in:
@@ -165,7 +165,8 @@ SYM (zero_bss):
|
||||
movl $ SYM (_end), ecx # find end of .bss
|
||||
movl $ SYM (_bss_start), edi # edi = beginning of .bss
|
||||
subl edi, ecx # ecx = size of .bss in bytes
|
||||
shll ecx # size of .bss in longs
|
||||
shrl ecx # size of .bss in longs
|
||||
shrl ecx
|
||||
xorl eax, eax # value to clear out memory
|
||||
repne # while ecx != 0
|
||||
stosl # clear a long in the bss
|
||||
|
||||
Reference in New Issue
Block a user