From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix exec_is_pie with gold linker
Date: Mon, 25 May 2020 12:02:39 +0200 [thread overview]
Message-ID: <20200525100237.GA6162@delia> (raw)
Hi,
When running test-case gdb.base/break-interp.exp with target board gold, we
run into:
...
gdb compile failed, pie failed to generate PIE executable
...
The problem is that the proc exec_is_pie uses the PIE flag in the readelf -d
output, which doesn't seem to be set by the gold linker.
Instead, use the "Type" field in the readelf -h output.
Tested on x86_64-linux.
Committed to trunk.
Thanks,
- Tom
[gdb/testsuite] Fix exec_is_pie with gold linker
gdb/testsuite/ChangeLog:
2020-05-25 Tom de Vries <tdevries@suse.de>
PR testsuite/26031
* lib/gdb.exp (exec_is_pie): Test readelf -h output.
---
gdb/testsuite/lib/gdb.exp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f7d20bd94f..7177be941b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5509,11 +5509,12 @@ proc exec_is_pie { executable } {
return -1
}
set readelf_program [gdb_find_readelf]
- set res [catch {exec $readelf_program -d $executable} output]
+ set res [catch {exec $readelf_program -h $executable} output]
if { $res != 0 } {
return -1
}
- set res [regexp -line {\(FLAGS_1\).*Flags:.* PIE($| )} $output]
+ set res [regexp -line {^[ \t]*Type:[ \t]*DYN \(Shared object file\)$} \
+ $output]
if { $res == 1 } {
return 1
}
next reply other threads:[~2020-05-25 10:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-25 10:02 Tom de Vries [this message]
2020-05-25 14:54 ` Pedro Alves
2020-05-25 15:29 ` 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=20200525100237.GA6162@delia \
--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