This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug gdb/13989] New: gdb invalid search order for shared librariesby cross debuging
- From: "Daniel dot Lehne at amk-drives dot bg" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 18 Apr 2012 11:28:23 +0000
- Subject: [Bug gdb/13989] New: gdb invalid search order for shared librariesby cross debuging
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13989
Bug #: 13989
Summary: gdb invalid search order for shared libraries by cross
debuging
Product: gdb
Version: 7.4
Status: NEW
Severity: normal
Priority: P2
Component: gdb
AssignedTo: unassigned@sourceware.org
ReportedBy: Daniel.Lehne@amk-drives.bg
Classification: Unclassified
Hello,
i think the order to search libraries:
1st sysroot
2nd host-sysroot (absolute path of lib on host)
3rd solib-search-path
for cross debugging is not usable. In this case libraries of the host-sysroot
replace the libraries for cross target in solib-search-path, and debugging
becomes impossible.
I configured GDB with --with-sysroot, declared additional set sysroot, set
solib-search-path, set solib-absolute-path (nevermind alias of set sysroot).
Example:
Simple Hello world project, additional lib freetype and jpeg (they should
exists host-sysroot), linked to binary. Gdb session started with init:
set sysroot <TOOLCHAIN>
set solib-search-path <SPECIAL LIBS>
#include "stdio.h"
int main(int argc, char **argv) {
printf("test");
}
Invoking: Cross GCC Compiler
arm-1136jfs-linux-gnueabi-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP
-MF"main.d" -MT"main.d" -o "main.o" "../main.c"
../main.c: In function 'main':
../main.c:5:1: warning: control reaches end of non-void function
Finished building: ../main.c
Building target: gdb_bug_sysroot
Invoking: Cross GCC Linker
arm-1136jfs-linux-gnueabi-gcc -L/home/opt/amklibs/arm-1136jfs -o
"gdb_bug_sysroot" ./main.o -lz -ljpeg -lfreetype
Finished building target: gdb_bug_sysroot
GDB-Session:
...
252,189
=library-loaded,id="/usr/lib/libz.so.1",target-name="/usr/lib/libz.so.1",host-name="/home/opt/libs/arm-1136jfs/libz.so.1",symbols-loaded="0",thread-group="i1"
252,190 &"warning: `/usr/lib/libjpeg.so.8': Shared library architecture unknown
is not compatible with target architecture arm.\n"
252,190
=library-loaded,id="/usr/lib/libjpeg.so.8",target-name="/usr/lib/libjpeg.so.8",host-name="/usr/lib/libjpeg.so.8",symbols-loaded="0",thread-group="i1"
252,190
=library-loaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/home/opt/Toolchain/arm-1136jfs-linux-gnueabi/gcc-4.5.2-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/sysroot-arm-1136jfs-linux-gnueabi/lib/libc.so.6",symbols-loaded="0",thread-group="i1"
252,190 &"warning: `/lib/libgcc_s.so.1': Shared library architecture unknown is
not compatible with target architecture arm.\n"
252,190
=library-loaded,id="/lib/libgcc_s.so.1",target-name="/lib/libgcc_s.so.1",host-name="/lib/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
...
The library libz loaded correctly from solib-search-path. The library libc.so.6
loaded correctly from Toolchain by sysroot.
The libjpeg and libfreetype (cut out of log) loaded incorrectly from host
rootfs instead of solib-search-path.
Thanks for a request.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.