aboutsummaryrefslogtreecommitdiff
path: root/binutils/filemode.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-07-26 13:42:32 +0200
committerTom de Vries <tdevries@suse.de>2023-07-26 13:42:32 +0200
commitbcf43b33cfd3a8415bf272a3ca1af04ec8b9d622 (patch)
treed0e81893c639d7a486043cf410dfde8c16956824 /binutils/filemode.c
parent87c9b0289d73382cc72adb84d221b0a8ceb33ef8 (diff)
downloadbinutils-bcf43b33cfd3a8415bf272a3ca1af04ec8b9d622.zip
binutils-bcf43b33cfd3a8415bf272a3ca1af04ec8b9d622.tar.gz
binutils-bcf43b33cfd3a8415bf272a3ca1af04ec8b9d622.tar.bz2
[gdb/testsuite] Drop -nostdlib in gdb.dwarf2/typeddwarf.exp
As reported in PR testsuite/30633, when running test-case gdb.dwarf2/typeddwarf.exp with target board native-gdbserver on Ubuntu 22.04.2, we run into: ... (gdb) continue^M Continuing.^M ^M Program received signal SIGSEGV, Segmentation fault.^M 0x0000000000000001 in ?? ()^M (gdb) FAIL: gdb.dwarf2/typeddwarf.exp: runto: run to main ... We run into the FAIL as follows: - due to using gdbserver, we attach at the point of the first instruction, in _start - we then set a breakpoint at main - the test-case is a .s file, that has main renamed to _start in the assembly, but not in the debuginfo - setting a breakpoint at main sets the breakpoint at the same instruction we're currently stopped at - continue doesn't hit the breakpoint, and we return out of _start, which causes a sigsegv Note that this is for the amd64 case (using gdb.dwarf2/typeddwarf-amd64.S). For the i386 case (using gdb.dwarf2/typeddwarf.S), setting a breakpoint in main sets it one insn after function entry, and consequently the problem does not occur. The FAIL is a regression since commit 90cce6c0551 ("[gdb/testsuite] Add nopie in a few test-cases"). Without nopie the executable is PIE, with nopie it's static instead. In the PIE case, we attach at the point of _start in the dynamic linker, and consequently we do not skip the breakpoint in main, and also don't run into the FAIL. Fix this by: - removing the -nostdlib setting, and - renaming _start to main in both .S files. The change to use -nostdlib and rename main to _start was originally added in commit 6edba76fe8b (submitted here: https://sourceware.org/pipermail/gdb-patches/2011-May/082657.html ) , I assume to fix the problem now fixed by using nopie. Tested on x86_64-linux. Reported-By: Simon Marchi <simon.marchi@efficios.com> Tested-By: Simon Marchi <simon.marchi@efficios.com> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30633
Diffstat (limited to 'binutils/filemode.c')
0 files changed, 0 insertions, 0 deletions