aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-10-14 13:09:50 +0200
committerTom de Vries <tdevries@suse.de>2022-10-14 13:09:50 +0200
commit68f7bda9b1c32920ce4a2fe65129525bc0b05bf7 (patch)
treead018153084f5479847d43ccda86eeda31820b27 /gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp
parent1806054393e033dfac661fe4f68683a23646cb61 (diff)
downloadgdb-68f7bda9b1c32920ce4a2fe65129525bc0b05bf7.zip
gdb-68f7bda9b1c32920ce4a2fe65129525bc0b05bf7.tar.gz
gdb-68f7bda9b1c32920ce4a2fe65129525bc0b05bf7.tar.bz2
[gdb/testsuite] Fix nopie test-cases with target board unix/-fPIE/-pie
Compilers default to either PIE or no-PIE executables. In order to test PIE executables with a compiler that produces non-PIE by default, we can use target board unix/-fPIE/-pie, which set the multilib_flags of the target board to "-fPIE -pie". Likewise, we can use target board unix/-fno-PIE/-no-pie with a compiler that produces PIE by default. The target board unix/-fno-PIE/-no-pie has a potential problem when compiling shared libs, because the multilib_flags will override the attempts of gdb_compile_shlib to compile with -fPIC. This is taken care of by running the body of gdb_compile_shlib wrapped in with_PIE_multilib_flags_filtered. The target board unix/-fPIE/-pie has a problem with nopie compilations. The current approach is to do the compilation hoping for the best, and if we find out that the resulting executable is PIE despite specifying nopie, we error out with the standard error message "nopie failed to prevent PIE executable". That however does not work for hard-coded assembly nopie test-cases, which will just noisily refuse to compile: ... ld: amd64-disp-step0.o: relocation R_X86_64_32S against `.text' can not be \ used when making a PIE object; recompile with -fPIE^M ... Fix this in gdb_compile by filtering out the PIE settings in the target board multilib_flags when pie or nopie is specified. Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp')
0 files changed, 0 insertions, 0 deletions