public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Clément Chigot" <chigot@adacore.com>
To: binutils@sourceware.org
Subject: [PATCH] ld: harmonize the value of --enable-warn-execstack=no option
Date: Tue, 17 May 2022 14:51:40 +0200	[thread overview]
Message-ID: <CAJ307EhxpcK5cqsnBV9Ud+WeP2gdbB4tKmLOHfR-nFmyZa=4AA@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2022-05-17 12:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 12:51 Clément Chigot [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ307EhxpcK5cqsnBV9Ud+WeP2gdbB4tKmLOHfR-nFmyZa=4AA@mail.gmail.com' \
    --to=chigot@adacore.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).