Reputation: 4220
Stack: MIPS, Linux, C, C++ using GNU Tools to compile and link (building on x86 for MIPS)
Fair warning: I'm a C, C++ novice, feel free to suggest anything which might be obvious as it's possible I have not tried it yet.
I am able to build an executable which dynamically links to a library (live555), if I statically link to this everything works fine, however when I attempt to dynamically link the executable crashes during runtime. To confirm I am building the .so files correctly, I've also tried building other executables (the test tools included with live555) to dynamically link against these .so libs and these tools work fine.
The linking/build seems to work fine, no errors or warnings are thrown during the build. I can inspect the crashing executable with readelf -d and clearly see the .so references. I can also run ldd on the MIPS system on the executable and the libraries seem to be loaded fine, strace output also shows these libraries as being loaded. Unfortunately the strace output doesn't really provide me with any insite, I've talked with others familiar with this system and they are not sure what the problem is.
Just looking for ideas and tools to try, if anyone has any thoughts I'd appropriate them!
Thanks for reading
Upvotes: 3
Views: 3806
Reputation: 11299
There is not enough information here to start troubleshooting in depth. Some ideas to start debugging, from least to most time-consuming:
ldd
on your executable, check the path(s) where that library is being loaded from, make sure the library is the version you compiled / linked against. Easy way is to get it's MD5
hash on your target and host, make sure they are the same.
$> ulimit -c unlimited
, run gdb or DDD, load the crash dump and inspect your environment.make -n
to see how your binary is being generated.LDPATH
env on target and make sure it is sensible; empty is perfectly fine btw.LDFLAGS
during compile / linking. You might have to run make -n
, look for gcc
command or collect
command, then copy-paste the entire line and add --verbose
to the end so you can see exactly what the linker is doing. You might have to fix paths for sources / object files, depending on how your build system is setup.The idea is to try and eliminate potential issues, such as:
You're lucky that you have Linux installed, so should be fairly easy, just might be time consuming.
Upvotes: 1