From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Add boards/aslr.exp
Date: Fri, 13 Feb 2026 22:39:16 +0100 [thread overview]
Message-ID: <20260213213916.800093-1-tdevries@suse.de> (raw)
Commit deb47060b58 ("gdb/testsuite: make gdb.dwarf2/dw2-empty-inline-ranges.exp
work when ASLR can't be disabled") notes that test-case
gdb.dwarf2/dw2-empty-inline-ranges.exp fails in case the test-case:
- produces a PIE executable, and
- is run in a setup that ignores disable-randomization == on (such as in a
container where that capability is removed).
The commit fixes the test-case using nopie, but I wondered if there were more
test-cases that fail in the same way, so I ran the testsuite using:
- target board unix/-fPIE/-pie, and
- a patch that added -iex "set disable-randomization off" to INTERNAL_GDBFLAGS,
and indeed there are.
Add a boards file aslr.exp with this setup.
Tested on x86_64-linux.
---
gdb/testsuite/boards/aslr.exp | 26 ++++++++++++++++++++++++++
gdb/testsuite/make-check-all.sh | 1 +
2 files changed, 27 insertions(+)
create mode 100644 gdb/testsuite/boards/aslr.exp
diff --git a/gdb/testsuite/boards/aslr.exp b/gdb/testsuite/boards/aslr.exp
new file mode 100644
index 00000000000..5e00230b301
--- /dev/null
+++ b/gdb/testsuite/boards/aslr.exp
@@ -0,0 +1,26 @@
+# Copyright 2026 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+load_board_description "local-board"
+
+# Simulate a setup that ignores the default disable-randomization == on (such
+# as a container where that capability is removed).
+append GDBFLAGS { -iex "set disable-randomization off"}
+
+# Try to generate PIE executables to catch the cases that having address
+# randomization in executables matters.
+# It would be nice to use "pie" (as handled by gdb_compile) here, but that
+# doesn't seem to work.
+process_multilib_options "-fPIE -pie"
diff --git a/gdb/testsuite/make-check-all.sh b/gdb/testsuite/make-check-all.sh
index c46cd8de4ed..a5190bd64ff 100755
--- a/gdb/testsuite/make-check-all.sh
+++ b/gdb/testsuite/make-check-all.sh
@@ -66,6 +66,7 @@ host_target_boards=(
# Boards that run everything on local target and local host.
target_boards=(
+ aslr
cc-with-gdb-index
cc-with-index-cache
cc-with-debug-names
base-commit: 51b7445c65ff06a6d9740fc635be73287527a0a5
--
2.51.0
next reply other threads:[~2026-02-13 21:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 21:39 Tom de Vries [this message]
2026-02-13 23:11 ` Tom de Vries
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=20260213213916.800093-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@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