From 2c4e689bc1ed4440d0d95b3b350ce872e7f75865 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Mon, 3 Feb 2020 00:53:17 +0000 Subject: Support manually zeroing out BSS when booting (#188) Some ELF loaders, in particular gdb's load command for dynamically loading files into memory, which is often used to load binaries onto FPGAs over JTAG, do not zero out BSS, leaving the memory in whatever state it was previously in. Thus, introduce a new --enable-zero-bss configure flag, which will include code to zero out BSS when booting. --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1653f2b..81492de 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,11 @@ AC_ARG_WITH([mem-start], AS_HELP_STRING([--with-mem-start], [Set physical memory AC_SUBST([MEM_START], [0x80000000], [Physical memory start address]) ]) +AC_ARG_ENABLE([zero-bss], AS_HELP_STRING([--enable-zero-bss], [Manually zero out BSS when booting])) +AS_IF([test "x$enable_zero_bss" = "xyes"], [ + AC_DEFINE([ZERO_BSS],,[Define if BSS should be manually zeroed when booting]) +]) + #------------------------------------------------------------------------- # MCPPBS subproject list #------------------------------------------------------------------------- -- cgit v1.1