public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/PR93274-make-resolver-static-v2)] Emit .note.GNU-stack for hard-float linux targets.
@ 2020-01-27 10:11 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-01-27 10:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:54b3d52c3cca836c7c4c08cc9c02eda6c096372a

commit 54b3d52c3cca836c7c4c08cc9c02eda6c096372a
Author: Dragan Mladjenovic <dragan.mladjenovic@rt-rk.com>
Date:   Thu Jan 23 16:37:20 2020 +0100

    Emit .note.GNU-stack for hard-float linux targets.
    
    libgcc/ChangeLog:
    
    2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
    
    	* config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also.
    
    gcc/ChangeLog:
    
    2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
    
    	* config.in: Regenerated.
    	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to 1
    	for TARGET_LIBC_GNUSTACK.
    	* configure: Regenerated.
    	* configure.ac: Define TARGET_LIBC_GNUSTACK if glibc version is
    	found to be 2.31 or greater.

Diff:
---
 gcc/ChangeLog                 |  9 +++++++++
 gcc/config/mips/linux.h       |  4 ++++
 gcc/configure.ac              | 12 ++++++++++++
 libgcc/ChangeLog              |  4 ++++
 libgcc/config/mips/gnustack.h |  2 +-
 5 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b8b9b55..840668d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
 2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
 
+	* config.in: Regenerated.
+	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to 1
+	for TARGET_LIBC_GNUSTACK.
+	* configure: Regenerated.
+	* configure.ac: Define TARGET_LIBC_GNUSTACK if glibc version is
+	found to be 2.31 or greater.
+
+2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
+
 	* config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to
 	TARGET_SOFT_FLOAT.
 	* config/mips/mips.c (TARGET_ASM_FILE_END): Define to ...
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 183b62f..54446e5 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -53,4 +53,8 @@ along with GCC; see the file COPYING3.  If not see
 
 #undef NEED_INDICATE_EXEC_STACK
 
+#ifdef TARGET_LIBC_GNUSTACK
+#define NEED_INDICATE_EXEC_STACK 1
+#else
 #define NEED_INDICATE_EXEC_STACK TARGET_SOFT_FLOAT
+#endif
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 4a1790b..a7521ee 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6247,6 +6247,18 @@ if test x$gcc_cv_libc_provides_hwcap_in_tcb = xyes; then
 	    [Define if your target C Library provides the AT_HWCAP value in the TCB])
 fi
 
+# Check if the target LIBC handles PT_GNU_STACK.
+gcc_cv_libc_gnustack=unknown
+case "$target" in
+  mips*-*-linux*)
+    GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
+    ;;
+esac
+if test x$gcc_cv_libc_gnustack = xyes; then
+  AC_DEFINE(TARGET_LIBC_GNUSTACK, 1,
+            [Define if your target C Library properly handles PT_GNU_STACK])
+fi
+
 AC_MSG_CHECKING(dl_iterate_phdr in target C library)
 gcc_cv_target_dl_iterate_phdr=unknown
 case "$target" in
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index eddcd9f..bea77b2 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,5 +1,9 @@
 2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
 
+	* config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also.
+
+2020-01-23  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
+
 	* config/mips/gnustack.h: New file.
 	* config/mips/crti.S: Include gnustack.h.
 	* config/mips/crtn.S: Likewise.
diff --git a/libgcc/config/mips/gnustack.h b/libgcc/config/mips/gnustack.h
index c7e9fe7..561b348 100644
--- a/libgcc/config/mips/gnustack.h
+++ b/libgcc/config/mips/gnustack.h
@@ -1,6 +1,6 @@
 #include "config.h"
 #if defined(__ELF__) && defined(__linux__)
-#if defined (__mips_soft_float)
+#if defined (TARGET_LIBC_GNUSTACK) || defined (__mips_soft_float)
 	.section .note.GNU-stack,"",%progbits
 	.previous
 #endif


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-27 10:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-27 10:11 [gcc(refs/users/marxin/heads/PR93274-make-resolver-static-v2)] Emit .note.GNU-stack for hard-float linux targets Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).