From f02ffcaa6a28b7d1a80e6665ab7d3eba37ff243e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 6 Feb 1998 13:47:09 +0000 Subject: 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. --- c/src/lib/libbsp/i386/pc386/start/start.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'c/src/lib/libbsp/i386/pc386/start/start.s') diff --git a/c/src/lib/libbsp/i386/pc386/start/start.s b/c/src/lib/libbsp/i386/pc386/start/start.s index bdf74731c6..0c44cd9e36 100644 --- a/c/src/lib/libbsp/i386/pc386/start/start.s +++ b/c/src/lib/libbsp/i386/pc386/start/start.s @@ -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 -- cgit v1.2.3