Go to file
Carl Love dd9cd55e99 PowerPC: bp-permanent.exp, kill-after-signal fix
The break point after the stepi on Intel is the entry point of the user
signal handler function test_signal_handler.  The code at the break point
looks like:

     0x<hex address> <test_signal_handler>: endbr64

On PowerPC with a Linux 5.9 kernel or latter, the address where gdb stops
after the stepi is in the vdso code inserted by the kernel.  The code at the
breakpoint looks like:

  0x<hex address>  <__kernel_start_sigtramp_rt64>:	bctrl

This is different from other architectures.  As discussed below, recent
kernel changes involving the vdso for PowerPC have been made changes to the
signal handler code flow.  PowerPC is now stopping in function
__kernel_start_sigtramp_rt64.  PowerPC now requires an additional stepi to
reach the user signal handler unlike other architectures.

The bp-permanent.exp and kill-after-signal tests run fine on PowerPC with an
kernel that is older than Linux 5.9.

The PowerPC 64 signal handler was updated by the Linux kernel 5.9-rc1:

    commit id: 0138ba5783ae0dcc799ad401a1e8ac8333790df9
    powerpc/64/signal: Balance return predictor stack in signal trampoline

An additional change to the PowerPC 64 signal handler was made in Linux
kernel version 5.11-rc7 :

     commit id: 24321ac668e452a4942598533d267805f291fdc9
     powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64() semantics

The first kernel change, puts code into the user space signal handler (in
the vdso) as a performance optimization to prevent the call/return stack
from getting out of balance.  The patch ensures that the entire
user/kernel/vdso cycle is balanced with the addition of the "brctl"
instruction.

The second patch, fixes the semantics of __kernel_sigtramp_rt64().  A new
symbol is introduced to serve as the jump target from the kernel to the
trampoline which now consists of two parts.

The above changes for PowerPC signal handler, causes gdb to stop in the
kernel code not the user signal handler as expected.  The kernel dispatches
to the vdso code which in turn calls into the signal handler.  PowerPC is
special in that the kernel is using a vdso instruction (bctrl) to enter the
signal handler.

I do not have access to a system with the first patch but not the second.  I did
test on Power 9 with the Linux 5.15.0-27-generic kernel.  Both tests fail on
this Power 9 system.  The two tests also fail on Power 10 with the Linux
5.14.0-70.9.1.el9_0.ppc64le kernel.

The following patch fixes the issue by checking if gdb stopped at "signal
handler called".  If gdb stopped there, the tests verifies gdb is in the kernel
function __kernel_start_sigtramp_rt64 then does an additional stepi to reach the
user signal handler.  With the patch below, the tests run without errors on both
the Power 9 and Power 10 systems with out any failures.
2022-05-06 17:45:58 +00:00
bfd bfd targmatch.h makefile rule 2022-05-06 13:21:26 +09:30
binutils Dwarf: rename yet another instance of "index" 2022-05-04 08:36:14 +02:00
config Add markers for 2.38 branch 2022-01-22 12:08:55 +00:00
contrib
cpu opcodes: don't assume ELF in riscv, csky, rl78, mep disassemblers 2022-04-30 19:21:11 +09:30
elfcpp Add markers for 2.38 branch 2022-01-22 12:08:55 +00:00
etc Update year range in copyright notice of binutils files 2022-01-02 12:04:28 +10:30
gas x86: Disable 2 tests with large memory requirement 2022-04-27 11:51:35 -07:00
gdb PowerPC: bp-permanent.exp, kill-after-signal fix 2022-05-06 17:45:58 +00:00
gdbserver Fix build failure for aarch64 gdbserver 2022-05-04 15:36:47 +01:00
gdbsupport gdbsupport/pathstuff.h: #include <array> explicitly for std::array<> 2022-04-25 17:06:09 -07:00
gnulib gnulib: update to bd11400942d6 2022-05-02 10:54:19 -04:00
gold Updated Serbian translations for the bfd, gold, ld and opcodes directories 2022-02-17 15:18:59 +00:00
gprof libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2022-03-25 12:02:35 +00:00
gprofng gprofng: use $host instead $target 2022-05-05 10:12:12 -07:00
include LTO: Handle __real_SYM reference in IR 2022-05-04 16:26:51 -07:00
intl Regenerate a couple of files 2021-11-15 12:20:12 +10:30
ld LTO: Handle __real_SYM reference in IR 2022-05-04 16:26:51 -07:00
libbacktrace libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2022-03-25 12:02:35 +00:00
libctf libctf: impose an ordering on conflicting types 2022-04-28 11:47:12 +01:00
libdecnumber
libiberty gdb: rename floatformats_ia64_quad to floatformats_ieee_quad 2022-04-02 08:36:33 +08:00
opcodes Move TILE-Gx files to TARGET64_LIBOPCODES_CFILES 2022-05-05 10:03:39 +01:00
readline readline: back-port changes needed to properly detect EOF 2022-04-22 18:46:04 +01:00
sim Fix for v850e divq instruction 2022-04-06 11:10:40 -04:00
texinfo
zlib Rebase the zlib sources to the 1.2.12 release 2022-04-12 16:24:10 +01:00
.cvsignore
.editorconfig Add top-level .editorconfig file 2022-01-28 08:25:42 -05:00
.gitattributes
.gitignore
ar-lib
ChangeLog Rebase the zlib sources to the 1.2.12 release 2022-04-12 16:24:10 +01:00
compile
config-ml.in
config.guess Update the config.guess and config.sub files from the master repository and regenerate files. 2022-01-17 16:21:22 +00:00
config.rpath
config.sub Update the config.guess and config.sub files from the master repository and regenerate files. 2022-01-17 16:21:22 +00:00
configure Pass PKG_CONFIG_PATH down from top-level Makefile 2022-04-08 10:56:41 -04:00
configure.ac Pass PKG_CONFIG_PATH down from top-level Makefile 2022-04-08 10:56:41 -04:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2022-03-25 12:02:35 +00:00
lt~obsolete.m4 Sync Libtool from GCC. 2010-01-09 21:11:44 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Update path to readline config.{sub,guess} files 2021-05-24 18:11:49 +02:00
Makefile.def gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
Makefile.in Pass PKG_CONFIG_PATH down from top-level Makefile 2022-04-08 10:56:41 -04:00
Makefile.tpl Pass PKG_CONFIG_PATH down from top-level Makefile 2022-04-08 10:56:41 -04:00
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode Bump to autoconf 2.69 and automake 1.15.1 2018-06-19 16:55:06 -04:00
setup.com
src-release.sh gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.