changeset 2244:fdefb3632fb0

Update synthetic target for gcc 4.1.1
author bartv
date Mon, 10 Jul 2006 22:28:40 +0000
parents 6fd46febe457
children 42e30b66c3f8
files packages/hal/synth/arch/current/ChangeLog packages/hal/synth/arch/current/src/synth_entry.c
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/synth/arch/current/ChangeLog
+++ b/packages/hal/synth/arch/current/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-10  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/synth_entry.c (__stack_chk_fail_local): new function needed
+	when building with gcc 4.1.1
+
 2005-11-19  Bart Veer  <bartv@ecoscentric.com>
 
 	* src/synth_entry.c (_linux_entry): brk() is no longer needed to
--- a/packages/hal/synth/arch/current/src/synth_entry.c
+++ b/packages/hal/synth/arch/current/src/synth_entry.c
@@ -54,6 +54,7 @@
 #include <pkgconf/hal.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/infra/cyg_ass.h>
+#include <cyg/infra/diag.h>
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_intr.h>
 #include <cyg/hal/hal_io.h>
@@ -198,5 +199,18 @@ dl_iterate_phdr(void* arg1, void* arg2)
 }
 #endif
 
+#if (__GNUC__ >= 4)
+// First noticed with gcc 4.1.1. There is now code to detect stack
+// smashing.
+void __attribute__ ((noreturn))
+__stack_chk_fail_local(void)
+{
+    CYG_FAIL("Stack smashing detected, aborting");
+    diag_printf("Application error: stack smashing detected.\n");
+    cyg_hal_sys_exit(1);
+    for (;;);
+}
+#endif
+
 //-----------------------------------------------------------------------------
 // End of entry.c