]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
[gdb/testsuite] Fail in gdb_compile if pie results in non-PIE executable
authorTom de Vries <tdevries@suse.de>
Mon, 5 Aug 2019 10:51:58 +0000 (12:51 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 5 Aug 2019 10:51:58 +0000 (12:51 +0200)
commita80cf5d88e028fa6a72b37fe50795e70bb6e3559
tree9059acdad2c515d5eaedb074a78e4df6faee0e5a
parentd09628385443574b556f2beaaba7588a2a5fb4c0
[gdb/testsuite] Fail in gdb_compile if pie results in non-PIE executable

When running gdb.base/break-idempotent.exp with
--target_board=unix/-fno-PIE/-no-pie, we get:
...
nr of expected passes            140
...

The test-case is compiled once with nopie and once with pie, but in both cases
we end up with a non-PIE executable.  The "-fno-PIE -no-pie" options specified
using the target_board are interpreted by dejagnu as multilib_flags, and end up
overriding the pie flags.

Fix this by checking in gdb_compile if the resulting exec is non-PIE despite of
a pie setting, and if so return an error:
...
Running gdb/testsuite/gdb.base/break-idempotent.exp ...
gdb compile failed, pie failed to generate PIE executable

                === gdb Summary ===

nr of expected passes            70
nr of untested testcases         1
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-08-05  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (version_at_least): Factor out of ...
(tcl_version_at_least): ... here.
(gdb_compile): Fail if pie results in non-PIE executable.
(readelf_version, readelf_prints_pie): New proc.
(exec_is_pie): Return -1 if unknown.
gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp