summaryrefslogtreecommitdiff
path: root/lib/tiny-printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tiny-printf.c')
-rw-r--r--lib/tiny-printf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 451f4f7..b334f05 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -13,11 +13,16 @@
#include <stdarg.h>
#include <serial.h>
-static char *bf;
-static char zs;
+/*
+ * This code in here may execute before the DRAM is initialised, so
+ * we should make sure that it doesn't touch BSS, which some boards
+ * put in DRAM.
+ */
+static char *bf __attribute__ ((section(".data")));
+static char zs __attribute__ ((section(".data")));
/* Current position in sprintf() output string */
-static char *outstr;
+static char *outstr __attribute__ ((section(".data")));
static void out(char c)
{