Shared libraries will not load when trying to debug a cross compiled executable in gdb
himanshu gaur via Gdb <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CA++3_X2dH9c9mvwAwnd9iyhDxu-Qtj954xowCqXZoHf+wo1m4w@mail.gmail.com> |
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.