public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] Prune linker warnings about an executable stack being created with the -z execstack option.
@ 2023-06-21 11:10 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2023-06-21 11:10 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=340640f710e690b37c885166949595cde5f827b2

commit 340640f710e690b37c885166949595cde5f827b2
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Jun 21 12:10:03 2023 +0100

    Prune linker warnings about an executable stack being created with the -z execstack option.
    
      * testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune warnings about -z execstack creating an executable stack.

Diff:
---
 binutils/ChangeLog                         |  5 +++++
 binutils/testsuite/lib/binutils-common.exp | 16 ++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 75782925846..bb58bc4c5d5 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2023-06-21  Nick Clifton  <nickc@redhat.com>
+
+	* testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune
+	warnings about -z execstack creating an executable stack.
+
 2023-05-30  Nick Clifton  <nickc@redhat.com>
 
 	* od-pe.c (targ_info): New array.
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 530316e54cd..2293895a614 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -640,20 +640,32 @@ proc regexp_diff { file_1 file_2 args } {
 # ld: warning: /lib64/ld-linux-x86-64.so.2: unsupported GNU_PROPERTY_TYPE (5) type : 0xc0010001
 proc prune_warnings_extra { text } {
     global experimental
-    # Warnings are only pruned from non-experimental code (ie code not
-    # on a release branch).  For experimental code we want the warnings
+
+    # Property warnings are only pruned from non-experimental code (ie code
+    # not on a release branch).  For experimental code we want the warnings
     # as they indicate that the sources need to be updated to recognise
     # the new properties.
     if { "$experimental" == "false" } {
 	# The "\\1" is to try to preserve a "\n" but only if necessary.
 	regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*unsupported GNU_PROPERTY_TYPE\[^\n\]*\n?)+" $text "\\1" text
     }
+
     # PR binutils/23898: It is OK to have gaps in build notes.
     regsub -all "(^|\n)(\[^\n\]*: Warning: Gap in build notes detected from\[^\n\]*\n?)+" $text "\\1" text
+
+    # Many tests use assembler source files without a .note.GNU-stack section.
+    # So ignore warnings about it being missing.
     regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*missing \\.note\\.GNU-stack section\[^\n\]*\n?)+" $text "\\1" text
     regsub -all "(^|\n)(\[^\n\]*: NOTE: This behaviour is deprecated\[^\n\]*\n?)+" $text "\\1" text
+
+    # Ignore warnings about RWX segments.
     regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a LOAD segment with RWX permissions\[^\n\]*\n?)+" $text "\\1" text
     regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a TLS segment with execute permission\[^\n\]*\n?)+" $text "\\1" text
+
+    # Configuring with --enable-warn-execstack=yes will generate warnings if
+    # -z execstack is used.
+    regsub -all "(^|\n)(\[^\n\]*: warning: enabling an executable stack because of -z execstack command line option\[^\n\]*\n?)+" $text "\\1" text
+
     return $text
 }

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

only message in thread, other threads:[~2023-06-21 11:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 11:10 [binutils-gdb] Prune linker warnings about an executable stack being created with the -z execstack option Nick Clifton

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