Hi,
Now that I can debug a working lib that’s loaded by io-net (thanks, Colin!),
I’d like to try to understand why another one is crashing io=net as soon as
its mounted.
A minor problem here is that gdb doesn’t load the symbols before the lib is
loaded, which is sort of a chicken-and-egg problem in this case.
Any ideas?
Rony
It’s probably non-shared object files (or libs) that are being linked into your
shared object.
Run objdump -h object.so and if you have any rel.text or rel.rodata sections, then
you can be sure this has happened.
Then double check that you are compiling all your objects with the -shared (or -fpic)
option, and that you are not linking againsts any libs that aren’t shared. In
most cases, there is a libname.a (compiled static), libnameS.a (compiled shared)
and libname.so (compiled shared,linked shared)
One easy way to is product a map file (add -M to your link line) and examine
the list of objects and archives
cburgess:/home/cburgess/src/test >qcc -M -o hello hello.c
cburgess:/home/cburgess/src/test >grep LOAD hello.map
LOAD /x86/lib/crt1.o
LOAD /x86/lib/crti.o
LOAD /x86/lib/crtbegin.o
LOAD /tmp/AAA077167_cc.o
LOAD /usr/lib/gcc-lib/ntox86/2.95.2/libgcc.a
LOAD /x86/lib/libc.so
LOAD /x86/lib/libc.a
LOAD /usr/lib/gcc-lib/ntox86/2.95.2/libgcc.a
LOAD /x86/lib/crtend.o
LOAD /x86/lib/crtn.o
Rony Shapiro <rshapiro@everbee.com> wrote:
Hi,
Now that I can debug a working lib that’s loaded by io-net (thanks, Colin!),
I’d like to try to understand why another one is crashing io=net as soon as
its mounted.
A minor problem here is that gdb doesn’t load the symbols before the lib is
loaded, which is sort of a chicken-and-egg problem in this case.
Any ideas?
Rony
–
cburgess@qnx.com