[binutils-gdb] For test for PR 29072 when the linker is configured with --enable-default-execstack=no.

Nick Clifton nickc@sourceware.org
Wed Jun 21 10:47:57 GMT 2023


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

commit 0ab7005043ee404dabfd690952efc25c399995ae
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Jun 21 11:47:19 2023 +0100

    For test for PR 29072 when the linker is configured with --enable-default-execstack=no.
    
      PR 29072
      * testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Always return false for linkers configured with the --enable-default-execstack=no option.

Diff:
---
 ld/ChangeLog                |  7 +++++++
 ld/testsuite/ld-elf/elf.exp | 15 +++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8fd6504fa6e..1467128eb61 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2023-06-21  Nick Clifton  <nickc@redhat.com>
+
+	PR 29072
+	* testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Always
+	return false for linkers configured with the --enable-default-execstack=no
+	option.
+
 2023-06-14  Nick Clifton  <nickc@redhat.com>
 
 	PR 30374
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index cf0e949a966..ca345e865c2 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -180,6 +180,21 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
 }
 
 proc target_defaults_to_execstack {} {
+    global base_dir
+
+    # If the linker has been configured with --enable-default-execstack=no then
+    # this proc should always return 0.
+    if { [file exists $base_dir/config.status] } {
+	set status [remote_exec host grep "enable-default-execstack=no" $base_dir/config.status]
+	if { [lindex $status 0] == 0 } {
+	    return 0
+	} else {
+	    verbose -log "$base_dir/config.status does not contain enable-default-execstack=no"
+	}
+    } else {
+	verbose -log "there is no file $base_dir/config.status"
+    }
+    
     if {   [istarget "aarch64*-*-*"]
 	|| [istarget "arc*-*-*"]
 	|| [istarget "cris*-*-*"]


More information about the Binutils-cvs mailing list