From 922a784c4f6ab28e0619c55d1b4d20c1503082f1 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sun, 22 Jul 2012 14:55:38 +0000 Subject: [PATCH] Emit executable-stack note correctly for CRIS targets. * config/cris/cris.c (cris_file_end): New function. (TARGET_ASM_FILE_END): Define. From-SVN: r189755 --- gcc/ChangeLog | 6 ++++++ gcc/config/cris/cris.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc3bdc0..321d96d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-07-22 Hans-Peter Nilsson + + Emit executable-stack note correctly for CRIS targets. + * config/cris/cris.c (cris_file_end): New function. + (TARGET_ASM_FILE_END): Define. + 2012-07-22 Chung-Lin Tang Maxim Kuvyrkov NetLogic Microsystems Inc. diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 98dd696..4a73c81 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -153,6 +153,7 @@ static void cris_trampoline_init (rtx, tree, rtx); static rtx cris_function_value(const_tree, const_tree, bool); static rtx cris_libcall_value (enum machine_mode, const_rtx); static bool cris_function_value_regno_p (const unsigned int); +static void cris_file_end (void); /* This is the parsed result of the "-max-stack-stackframe=" option. If it (still) is zero, then there was no such option given. */ @@ -199,6 +200,8 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START cris_file_start +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END cris_file_end #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS cris_init_libfuncs @@ -2747,6 +2750,17 @@ cris_file_start (void) default_file_start (); } +/* Output that goes at the end of the file, similarly. */ + +static void +cris_file_end (void) +{ + /* For CRIS, the default is to assume *no* executable stack, so output + an executable-stack-note only when needed. */ + if (TARGET_LINUX && trampolines_created) + file_end_indicate_exec_stack (); +} + /* Rename the function calls for integer multiply and divide. */ static void cris_init_libfuncs (void) -- 2.7.4