From: Pedro Alves <palves@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [committed][gdb/testsuite] Fix exec_is_pie with gold linker
Date: Mon, 25 May 2020 15:54:09 +0100 [thread overview]
Message-ID: <e7a46ad7-fd0b-314b-f588-e4ffcdebcf48@redhat.com> (raw)
In-Reply-To: <20200525100237.GA6162@delia>
On 5/25/20 11:02 AM, Tom de Vries wrote:
> 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.
Seems like a Gold bug? A comment in exec_is_pie explaining why we don't
do the more obvious thing would be helpful, IMO.
> @@ -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
> }
>
Thanks,
Pedro Alves
next prev parent reply other threads:[~2020-05-25 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-25 10:02 Tom de Vries
2020-05-25 14:54 ` Pedro Alves [this message]
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=e7a46ad7-fd0b-314b-f588-e4ffcdebcf48@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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