From: himanshu gaur <himanshugaur2610@gmail.com>
To: gdb@sourceware.org
Subject: Shared libraries will not load when trying to debug a cross compiled executable in gdb
Date: Thu, 26 Aug 2021 08:34:00 -0500 [thread overview]
Message-ID: <CA++3_X2dH9c9mvwAwnd9iyhDxu-Qtj954xowCqXZoHf+wo1m4w@mail.gmail.com> (raw)
Hello All,
Downloaded the core dump locally(core dump was generated by
systemd-coredump on the original target and then downloaded to a different
location) and using a local copy of GDB to debug, the shared libraries will
not load.
(gdb) bt
#0 0x0000007f83148560 in ?? ()
‘info shared’ gives the following output:
(gdb) info shared
No shared libraries loaded at this time.
However, when debugging on the original target with *'coredumpctl debug'*,
all shared libraries load without any issues. The 'info shared' output
there is
(gdb) info shared
From To Syms Read Shared Object Library
0x0000007f854cb070 0x0000007f854cd748 Yes (*) /lib/libcap.so.2
0x0000007f85474fb0 0x0000007f854a20e8 Yes (*) /usr/lib/libdbus-1.so.3
0x0000007f85439070 0x0000007f8544aff0 Yes (*) /lib/libpthread.so.0
and so on ……
*Things tried to manually load the shared libraries*
1.
Tried setting the *solib-search-path* to point to the shared libraries
using *'set solib-search-path /usr/lib/foo.so'* and setting the
*solib-absolute-prefix
to /usr/lib*. No acknowledgement was given that foo.so was loaded.
2.
Tried running *objdump* on the executable, got the list .so libraries,
and tried to link them individually by setting the path. That did not load
the libraries as well.
3.
Tried running '*sharedlibrary foo*' after '*set auto-solib-add off*'.
Sharedlibrary foo was not loaded.
4.
Tried changing sysroot using the *'set sysroot'* command to point to a
directory containing the shared libraries in lib/ and usr/lib
subdirectories.
Since not able to load the shared libraries manually, the assumption is
that the mechanism that provides a way to identify what libraries to load
might be broken somehow. Has anyone seen similar before and what can be
done to ensure that the shared libraries load? Any help is appreciated.
Thanks!
--
Thanks & Regards,
Himanshu Gaur.
reply other threads:[~2021-08-26 13:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA++3_X2dH9c9mvwAwnd9iyhDxu-Qtj954xowCqXZoHf+wo1m4w@mail.gmail.com \
--to=himanshugaur2610@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).