From: Dragan Mladjenovic Date: Thu, 23 Jan 2020 15:37:20 +0000 (+0100) Subject: Emit .note.GNU-stack for hard-float linux targets. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54b3d52c3cca836c7c4c08cc9c02eda6c096372a;p=gcc.git Emit .note.GNU-stack for hard-float linux targets. libgcc/ChangeLog: 2020-01-23 Dragan Mladjenovic * config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also. gcc/ChangeLog: 2020-01-23 Dragan Mladjenovic * 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 --git a/gcc/ChangeLog b/gcc/ChangeLog index b8b9b550feb..840668d9657 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-01-23 Dragan Mladjenovic + + * 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 * config/mips/linux.h (NEED_INDICATE_EXEC_STACK): Define to diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 183b62f5041..54446e58e5f 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 4a1790b4ba7..a7521ee9943 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 eddcd9f4217..bea77b2e001 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,7 @@ +2020-01-23 Dragan Mladjenovic + + * config/mips/gnustack.h: Check for TARGET_LIBC_GNUSTACK also. + 2020-01-23 Dragan Mladjenovic * config/mips/gnustack.h: New file. diff --git a/libgcc/config/mips/gnustack.h b/libgcc/config/mips/gnustack.h index c7e9fe77cf2..561b3484bfe 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