Go to file
Tom Tromey c0e0d6bcfe Avoid crash with cross-linux core file
An internal test case creates a core file using gcore, then restarts
gdb with that core.  When run with a cross-linux gdb (in this case,
x86-64 host with ppc64-linux target), the test fails:

    | (gdb) core core
    | [New LWP 18437]
    | warning: `/lib64/libc.so.6': Shared library architecture unknown is not compatible with target architecture powerpc:common64.
    | warning: Could not load shared library symbols for /lib64/ld64.so.1.
    | Do you need "set solib-search-path" or "set sysroot"?
    | ../../src/gdb/gdbarch.c:3388: internal-error: int gdbarch_elf_make_msymbol_special_p(gdbarch*): Assertion `gdbarch != NULL' failed.
    | A problem internal to GDB has been detected,
    | further debugging may prove unreliable.
    | Quit this debugging session? (y or n) y

What's happening here is that the core file lists some shared
libraries.  These aren't available via the solib search path, and so
gdb finds the local (x86-64) libraries.  This is not ideal, but on the
other hand, it is what was asked for -- while the test does set
solib-search-path, it does not set the sysroot.

But, because gdb isn't configured to handle these libraries, it
crashes.

It seems to me that it's better to avoid the crash by having
solib_bfd_open fail in the case where a library is incompatible.  That
is what this patch does.  Now it looks like:

    | [New LWP 15488]
    | Error while mapping shared library sections:
    | `/lib64/libc.so.6': Shared library architecture unknown is not compatible with target architecture powerpc:common64.

... and does not crash gdb.

I don't have a good setup for testing this using dejagnu, so I don't
know whether an existing gdb test covers this scenario.
2022-03-11 09:25:43 -07:00
bfd Automatic date update in version.in 2022-03-11 00:00:26 +00:00
binutils gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
config
contrib
cpu
elfcpp
etc
gas Constant fold view increment expressions 2022-03-09 15:50:34 +10:30
gdb Avoid crash with cross-linux core file 2022-03-11 09:25:43 -07:00
gdbserver Re-add zombie leader on exit, gdbserver/linux 2022-03-10 11:35:54 +00:00
gdbsupport Let phex and phex_nz handle sizeof_l==1 2022-03-07 07:52:59 -07:00
gnulib
gold Updated Serbian translations for the bfd, gold, ld and opcodes directories 2022-02-17 15:18:59 +00:00
gprof
gprofng gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
include gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
intl
ld Re: ld: Add a before_plugin_all_symbols_read hook 2022-03-10 16:06:12 +10:30
libbacktrace
libctf libctf: delete unused libctf_TEXINFOS 2022-02-11 04:20:49 -05:00
libdecnumber
libiberty
opcodes MIPS/opcodes: Fix alias annotation for branch instructions 2022-03-06 18:30:58 +00:00
readline
sim sim: gdbinit: hoist setup to common code 2022-02-21 13:57:33 -05:00
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
configure.ac gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
Makefile.in gprofng: a new GNU profiler 2022-03-11 08:58:31 +00:00
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
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.