binutils-gdb/gdb/testsuite/lib
Tom de Vries b13057d9ce [gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable
When running gdb.base/dump.exp with --target_board=unix/-fPIE/-pie, we get:
...
Running gdb/testsuite/gdb.base/dump.exp ...
FAIL: gdb.base/dump.exp: dump array as value, intel hex
...

The FAIL happens because although the test specifies nopie, the exec is
in fact compiled as PIE.  The "-fPIE -pie" options specified using the
target_board are interpreted by dejagnu as multilib_flags, and end up
overriding the nopie flags.

Fix this by checking in gdb_compile if the resulting exec is PIE despite of
a nopie setting, and if so return an error:
...
Running gdb/testsuite/gdb.base/dump.exp ...
gdb compile failed, nopie failed to prevent PIE executable

                === gdb Summary ===

nr of untested testcases         1
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-07-30  Tom de Vries  <tdevries@suse.de>

	PR testsuite/24834
	* lib/gdb.exp (gdb_compile): Fail if nopie results in PIE executable.
	(exec_is_pie): New proc.
2019-07-30 09:42:07 +02:00
..
ada.exp Fix "catch exception" with dynamic linking 2019-04-30 07:32:11 -06:00
append_gdb_boards_dir.exp
build-piece.exp
cache.exp
cell.exp
cl_util.c
cl_util.h
compile-support.exp
compiler.c
compiler.cc
completion-support.exp Fix latent bug in test_gdb_complete_cmd_multiple 2019-07-03 17:09:16 +01:00
cp-support.exp
d-support.exp
data-structures.exp
dtrace.exp
dwarf.exp [gdb/testsuite] Fix handling of DW_FORM_ref_addr in dwarf assembler 2019-05-07 10:38:36 +02:00
fortran.exp
future.exp Implement dump of mappings with ELF headers by gcore 2019-04-25 14:21:18 -04:00
gdb-guile.exp
gdb-python.exp
gdb-utils.exp Update tests following changes to "help" and "apropos" 2019-06-03 21:59:35 +02:00
gdb.exp [gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable 2019-07-30 09:42:07 +02:00
gdbserver-support.exp testsuite: Mark the kill in gdbserver_run as optional 2019-05-21 10:42:24 +01:00
gen-perf-test.exp
go.exp
memory.exp
mi-support.exp [gdb/testsuite] Test skip_libstdcxx_probe_tests in mi-catch-cpp-exceptions.exp 2019-07-25 18:39:31 +02:00
objc.exp
opencl_hostapp.c
opencl_kernel.cl
opencl.exp [gdb/testsuite] Fix regexp in skip_opencl_tests 2019-04-29 16:52:10 +02:00
pascal.exp
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c
rust-support.exp
selftest-support.exp
set_unbuffered_mode.c
trace-support.exp
tuiterm.exp Two fixes for test suite's terminal 2019-07-29 16:06:58 -06:00
unbuffer_output.c
valgrind.exp