Emit executable-stack note correctly for CRIS targets.
authorHans-Peter Nilsson <hp@axis.com>
Sun, 22 Jul 2012 14:55:38 +0000 (14:55 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sun, 22 Jul 2012 14:55:38 +0000 (14:55 +0000)
* config/cris/cris.c (cris_file_end): New function.
(TARGET_ASM_FILE_END): Define.

From-SVN: r189755

gcc/ChangeLog
gcc/config/cris/cris.c

index dc3bdc0..321d96d 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-22  Hans-Peter Nilsson  <hp@axis.com>
+
+       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  <cltang@codesourcery.com>
            Maxim Kuvyrkov  <maxim@codesourcery.com>
            NetLogic Microsystems Inc.
index 98dd696..4a73c81 100644 (file)
@@ -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)