aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/mini-os/lib/stack_chk_fail.c8
-rw-r--r--stubdom/Makefile1
2 files changed, 9 insertions, 0 deletions
diff --git a/extras/mini-os/lib/stack_chk_fail.c b/extras/mini-os/lib/stack_chk_fail.c
new file mode 100644
index 0000000000..ade0045f0a
--- /dev/null
+++ b/extras/mini-os/lib/stack_chk_fail.c
@@ -0,0 +1,8 @@
+#include <kernel.h>
+#include <console.h>
+
+void __stack_chk_fail(void)
+{
+ printk("stack smashing detected\n");
+ do_exit();
+}
diff --git a/stubdom/Makefile b/stubdom/Makefile
index dcb614fc85..fabb6908de 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -91,6 +91,7 @@ newlib-$(NEWLIB_VERSION).tar.gz:
newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
tar xzf $<
patch -d $@ -p0 < newlib.patch
+ patch -d $@ -p0 < newlib-chk.patch
touch $@
NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a