ia64/xen-unstable

changeset 19454:6ad2b1ded12f

minios: _chk_fail and _chk canaries for minios and newlib

Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to
newlib, to cope with ocaml runtimes compiled with -fstack-protector.

From: "George S. Coker, II" <gscoker@alpha.ncsc.mil>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 31 11:36:11 2009 +0100 (2009-03-31)
parents b7a11dff84c0
children d64a487d6c32
files extras/mini-os/lib/stack_chk_fail.c stubdom/Makefile
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/extras/mini-os/lib/stack_chk_fail.c	Tue Mar 31 11:36:11 2009 +0100
     1.3 @@ -0,0 +1,8 @@
     1.4 +#include <kernel.h>
     1.5 +#include <console.h>
     1.6 +
     1.7 +void __stack_chk_fail(void)
     1.8 +{
     1.9 +    printk("stack smashing detected\n");
    1.10 +    do_exit();
    1.11 +}
     2.1 --- a/stubdom/Makefile	Tue Mar 31 11:33:56 2009 +0100
     2.2 +++ b/stubdom/Makefile	Tue Mar 31 11:36:11 2009 +0100
     2.3 @@ -91,6 +91,7 @@ newlib-$(NEWLIB_VERSION).tar.gz:
     2.4  newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
     2.5  	tar xzf $<
     2.6  	patch -d $@ -p0 < newlib.patch
     2.7 +	patch -d $@ -p0 < newlib-chk.patch
     2.8  	touch $@
     2.9  
    2.10  NEWLIB_STAMPFILE=$(CROSS_ROOT)/$(GNU_TARGET_ARCH)-xen-elf/lib/libc.a