summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-07-11 21:39:25 +0000
committerpeter <peter@FreeBSD.org>2003-07-11 21:39:25 +0000
commit42ebc1bf3a0ba50472cbfda8f99a9dcfc8e0baff (patch)
treee83a3f03a4b7a69c6878a5f1a1c6d4d48bea3e97 /sys
parentde6ecdcd5d3096010c8641e6669bca37e6ecda64 (diff)
downloadFreeBSD-src-42ebc1bf3a0ba50472cbfda8f99a9dcfc8e0baff.zip
FreeBSD-src-42ebc1bf3a0ba50472cbfda8f99a9dcfc8e0baff.tar.gz
Fix the gcc-3.3 boot problem. Gcc now optimizes 'int foo = 0' by moving
it to the bss section and skips the initialization. This causes all sorts of havoc because the bogus bss zero code clobbered previously set variables. All our supported boot loaders already zero the bss, even kgzip for the elf case. Since we dont generate a.out kernels, the old a.out bootblocks and the a.out kgzip are not a factor anymore.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/i386/locore.s26
1 files changed, 5 insertions, 21 deletions
diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
index 8115e23..37d2e1f 100644
--- a/sys/i386/i386/locore.s
+++ b/sys/i386/i386/locore.s
@@ -275,29 +275,13 @@ NON_GPROF_ENTRY(btext)
call identify_cpu
-/* clear bss */
/*
- * XXX this should be done a little earlier.
- *
- * XXX we don't check that there is memory for our bss and page tables
- * before using it.
- *
- * XXX the boot program somewhat bogusly clears the bss. We still have
- * to do it in case we were unzipped by kzipboot. Then the boot program
- * only clears kzipboot's bss.
- *
- * XXX the gdt and idt are still somewhere in the boot program. We
- * depend on the convention that the boot program is below 1MB and we
- * are above 1MB to keep the gdt and idt away from the bss and page
- * tables.
+ * We used to clear BSS here, but it isn't needed anymore and actually
+ * causes harm. gcc now optimizes 'int foo = 0' to be uninitialized in
+ * the bss. All the supported loaders already zero the bss. The a.out
+ * kgzip case does not, but we do not generate a.out kernels anymore.
+ * This is trivial to fix anyway, is a bug in kgzip.
*/
- movl $R(end),%ecx
- movl $R(edata),%edi
- subl %edi,%ecx
- xorl %eax,%eax
- cld
- rep
- stosb
call create_pagetables
OpenPOWER on IntegriCloud