public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with recent ld
Date: Wed, 12 Oct 2022 14:50:31 +0000 (GMT)	[thread overview]
Message-ID: <20221012145031.F10E33856089@sourceware.org> (raw)

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

commit a2470500432334fe254ef10ddabcab239e8de828
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Oct 12 16:50:16 2022 +0200

    [gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with recent ld
    
    On openSUSE Tumbleweed (with ld 2.39) and test-case
    gdb.base/infoline-reloc-main-from-zero.exp, I get:
    ...
    gdb compile failed, ld: warning: infoline-reloc-main-from-zero has a LOAD \
      segment with RWX permissions
    UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: \
      infoline-reloc-main-from-zero.exp
    ...
    
    Fix this by compiling with -Wl,--no-warn-rwx-segments.
    
    Tested on x86_64-linux.

Diff:
---
 gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
index 31e753a0c1c..35c2db00c07 100644
--- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
+++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
@@ -25,7 +25,15 @@ standard_testfile .c
 
 # Build executable with stripped startup code and text section starting at zero
 
-set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"}
+set opts {}
+lappend opts debug
+lappend opts "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"
+
+set ld_flags additional_flags=-Wl,--no-warn-rwx-segments
+if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \
+	  $ld_flags] } {
+    lappend opts $ld_flags
+}
 
 if {[build_executable $testfile.exp $testfile $srcfile $opts] == -1} {
     untested "failed to compile"

                 reply	other threads:[~2022-10-12 14:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221012145031.F10E33856089@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@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).