public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld: harmonize the value of --enable-warn-execstack=no option
@ 2022-05-17 12:51 Clément Chigot
  2022-05-20  5:54 ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Clément Chigot @ 2022-05-17 12:51 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

This patch sets the configure value of warn-execstack to 2 when
disabled as expected by bfd.

ld/ChangeLog:

        * configure.ac: Update ac_default_ld_warn_execstack value when
        --enable-warn-execstack=no is given.
        * configure: Regenerate
        * testsuite/ld-elf/elf.exp: Add --warn-execstack to ensure
        the warning is always shown.

[-- Attachment #2: 0001-ld-harmonize-the-value-of-enable-warn-execstack-no-o.patch --]
[-- Type: text/x-patch, Size: 2043 bytes --]

From 00721c0f99049a8e8adebfadd3e1dc60d00c02e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <chigot@adacore.com>
Date: Tue, 17 May 2022 13:53:56 +0200
Subject: [PATCH] ld: harmonize the value of --enable-warn-execstack=no option

This patch sets the configure value of warn-execstack to 2 when
disabled as expected by bfd.

ld/ChangeLog:

	* configure.ac: Update ac_default_ld_warn_execstack value when
	--enable-warn-execstack=no is given.
	* configure: Regenerate
	* testsuite/ld-elf/elf.exp: Add --warn-execstack to ensure
	the warning is always shown.
---
 ld/configure                | 2 +-
 ld/configure.ac             | 2 +-
 ld/testsuite/ld-elf/elf.exp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ld/configure b/ld/configure
index b4b0ce14ed9..b957227c6c1 100755
--- a/ld/configure
+++ b/ld/configure
@@ -15443,7 +15443,7 @@ ac_default_ld_warn_execstack=unset
 if test "${enable_warn_execstack+set}" = set; then :
   enableval=$enable_warn_execstack; case "${enableval}" in
   yes) ac_default_ld_warn_execstack=1 ;;
-  no)  ac_default_ld_warn_execstack=-1 ;;
+  no)  ac_default_ld_warn_execstack=2 ;;
 esac
 fi
 
diff --git a/ld/configure.ac b/ld/configure.ac
index 0b29e810dde..ad807e27465 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -210,7 +210,7 @@ AC_ARG_ENABLE(warn-execstack,
 	      [enable warnings when creating an executable stack]),
 [case "${enableval}" in
   yes) ac_default_ld_warn_execstack=1 ;;
-  no)  ac_default_ld_warn_execstack=-1 ;;
+  no)  ac_default_ld_warn_execstack=2 ;;
 esac])
 
 ac_default_ld_warn_rwx_segments=unset
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index ebb5ba090bf..ec148865e21 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -240,7 +240,7 @@ if {   [istarget *-*-*linux*]
     
     run_ld_link_tests [list \
 	[list "PR ld/29072 (warn about an executable .note.GNU-stack)" \
-	    "-e 0" \
+	    "-e 0 --warn-execstack" \
 	    "" \
 	    "" \
 	    {pr29072-a.s} \
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-26 11:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 12:51 [PATCH] ld: harmonize the value of --enable-warn-execstack=no option Clément Chigot
2022-05-20  5:54 ` Alan Modra
2022-05-20  6:45   ` Alan Modra
2022-05-20  7:07     ` Clément Chigot
2022-05-20 10:16       ` Alan Modra
2022-05-26 11:06         ` bit-rot in target before_parse function option Alan Modra

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).