diff options
author | 2010-07-12 23:18:07 +0200 | |
---|---|---|
committer | 2010-07-12 23:18:07 +0200 | |
commit | 3620e48c2d9c735819b4606b4ba5a5f78700bca1 (patch) | |
tree | a2ca8fa26fd342ad6bb67e6cb50ece34a808520c | |
parent | Updated the Wtrampolines patch (diff) | |
download | hardened-gccpatchset-3620e48c2d9c735819b4606b4ba5a5f78700bca1.tar.gz hardened-gccpatchset-3620e48c2d9c735819b4606b4ba5a5f78700bca1.tar.bz2 hardened-gccpatchset-3620e48c2d9c735819b4606b4ba5a5f78700bca1.zip |
Updated the patch to fix the warning location
-rwxr-xr-x[-rw-r--r--] | upstream/warntrampolins/Wtrampolines.patch | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/upstream/warntrampolins/Wtrampolines.patch b/upstream/warntrampolins/Wtrampolines.patch index db76acb..d89d0fe 100644..100755 --- a/upstream/warntrampolins/Wtrampolines.patch +++ b/upstream/warntrampolins/Wtrampolines.patch @@ -1,32 +1,20 @@ -gcc/ +2010-06-29 Magnus Granberg <zorry@gentoo.org>, Kevin F. Quinn <kevquinn@gentoo.org> -2010-05-06 Magnus Granberg <zorry@gentoo.org>, Kevin F. Quinn <kevquinn@gentoo.org> - - * builtins.c: (expand_builtin_init_trampoline): if warn_trampolines make a warning. - * common.opt: Add -Wtrampolines. - * varasm.c: (file_end_indicate_exec_stack): if warn_trampolines make a warning. - -gcc/doc - -2010-05-06 Magnus Granberg <zorry@gentoo.org> - - * invoke.texi: Add -Wtrampolines. - -gcc/testsuite/ - -2010-05-06 Magnus Granberg <zorry@gentoo.org> - - * gcc.dg/Wtrampolines.c: New. + * gcc/builtins.c: (expand_builtin_init_trampoline): if -Wtrampolines make a warning. + * gcc/common.opt: Add -Wtrampolines. + * gcc/doc/invoke.texi: Add -Wtrampolines. + * gcc/testsuite/gcc.dg/Wtrampolines.c: New. --- gcc/builtins.c.zorry 2010-04-13 15:47:11.000000000 +0200 +++ gcc/builtins.c 2010-06-16 12:33:54.000000000 +0200 -@@ -5150,6 +5150,10 @@ +@@ -5150,6 +5150,11 @@ targetm.calls.trampoline_init (m_tramp, t_func, r_chain); trampolines_created = 1; + + if (warn_trampolines) -+ warning (OPT_Wtrampolines, "trampoline generated for nested function %s", (IDENTIFIER_POINTER(DECL_NAME(t_func)))); ++ warning_at (DECL_SOURCE_LOCATION (t_func), OPT_Wtrampolines, ++ "trampoline generated for nested function %qD", t_func); + return const0_rtx; } @@ -39,25 +27,11 @@ gcc/testsuite/ +Wtrampolines +Common Var(warn_trampolines) Warnings -+Warn whenever a trampoline is generated and warn if it requires executable stack to ++Warn whenever a trampoline is generated + Wtype-limits Common Var(warn_type_limits) Init(-1) Warning Warn if a comparison is always true or always false due to the limited range of the data type ---- gcc/varasm.c.zorry 2010-03-27 12:56:30.000000000 +0100 -+++ gcc/varasm.c 2010-05-29 15:06:33.000000000 +0200 -@@ -6768,7 +6768,11 @@ - { - unsigned int flags = SECTION_DEBUG; - if (trampolines_created) -+ { - flags |= SECTION_CODE; -+ if (warn_trampolines) -+ warning (OPT_Wtrampolines, "setting the stack as executable stack"); -+ } - - switch_to_section (get_section (".note.GNU-stack", flags, NULL)); - } --- gcc/doc/invoke.texi.zorry 2010-04-06 16:02:22.000000000 +0200 +++ gcc/doc/invoke.texi 2010-05-06 00:20:25.000000000 +0200 @@ -258,8 +258,8 @@ @@ -71,7 +45,7 @@ gcc/testsuite/ -Wunsuffixed-float-constants -Wunused -Wunused-function @gol -Wunused-label -Wunused-parameter -Wno-unused-result -Wunused-value -Wunused-variable @gol -Wvariadic-macros -Wvla @gol -@@ -3603,6 +3603,19 @@ +@@ -3603,6 +3603,18 @@ option will @emph{not} warn about unknown pragmas in system headers---for that, @option{-Wunknown-pragmas} must also be used. @@ -79,7 +53,6 @@ gcc/testsuite/ +@opindex Wtrampolines +@opindex Wno-trampolines + Warn about trampolines generated for pointers to nested functions. -+ Warn when the trampoline requires the stack to be made executable. + + A trampoline is a small piece of data or code that is created at run + time on the stack when the address of a nested function is taken, and @@ -93,15 +66,13 @@ gcc/testsuite/ @opindex Wno-float-equal --- gcc/testsuite/gcc.dg/Wtrampolines.c.zorry 2010-05-05 12:53:11.000000000 +0200 +++ gcc/testsuite/gcc.dg/Wtrampolines.c 2010-05-06 00:26:05.000000000 +0200 -@@ -0,0 +1,59 @@ +@@ -0,0 +1,56 @@ +/* Origin: trampoline-1.c Waldek Hebisch <hebisch@math.uni.wroc.pl> */ +/* Ported to test -Wtrampolines Magnus Granberg <zorry@gentoo.org> */ + +/* { dg-do compile } */ +/* { dg-require-effective-target trampolines } */ +/* { dg-options "-O2 -Wtrampolines" } */ -+/* { dg-warning "trampoline" "" { target *-*-* } 31 } */ -+/* { dg-prune-output "stack" } */ + +#ifndef NO_TRAMPOLINES + @@ -126,8 +97,8 @@ gcc/testsuite/ + + double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5) + { -+ double b (void) -+ { ++ double b (void) /* { dg-warning "trampoline generated for nested function 'b'" } */ ++ { + k = k - 1; + return a (k, b, x1, x2, x3, x4 ); + } |