I upgrade a program that needs to run on both old and new platform. In the new platform, I have new config so certain functions will not get called in the old platform. However, when I run the program on old platform, it complains missing shared library. What I need is something like “lazyload” or “delayload” mechanism such that when
Tag: shared-libraries
gdb: how to learn which shared library loaded a shared library in question
I need to get the list of shared libraries used by an app in runtime. Most of them can be listed by ldd, but some can be seen only with gdb -p <pid> and by running the gdb command info sharedlib. It would really help, if I could learn in some way: for a chosen library (in the list, output
Why string shown up in Shared Library file like .so file in Linux?
May I know why the .so file in linux will show up the string value from my cpp code? Even with fvisibility=hidden set in gcc make. for example, i set “Hello World” and it will show up. I tried google but found nothing related.. Thanks. Answer -fvisibility=hidden only affects the linker visibility, i.e. whether symbols are visible when a linker
Calling libc functions from another shared library in AT&T syntax?
i was trying to assemble codes below to shared library via gcc. i used command below in terminal and got errors. Then i googled the question and got a seemingly feasible answer in undefined-reference-to-main-for-shared-library. Then i added option -no-pie, used commands below and got another error. It seems that the order of options matters. But i used codes in 32-bits
C++: How to cross-compile from Windows to Linux?
I have a C++ module on windows which I want to compile such that I get a dynamic library for linux *.so. Does a cross-compiler exist that can help me out? Answer Several comments mentioned using Windows Subsystem for Linux. I would personally recommend this as it is far easier than trying to use a cross-compiler. It also comes with
Trying to build C++ exe that uses .so that uses other .so files
I’m trying to build a C++ executable that links with a shared library, libA.so. libA.so was built and linked with another shared library, libB.so. libB.so was built using -rpath to look for a custom build of a system library in my home directory (liblapack.so). If I do a “readelf -d” on libB.so, I see liblapack.so as “NEEDED”, and I also
Linker cannot find local shared library
I’m trying a very simple exmaple to create a shared library and link to it. The shared library is as follows: Then the source code file is just as simple: I’m then compiling that into a shared library with: All good, we get an ardgrab.so library so to test it, with the following code in teh same directory as the
How to find all shared libraries actually used during execution in Linux?
I have an executable and I would like to find out which shared libraries were actually used during a specific run. I know ldd would list all the shared library dependencies of that executable but I would like to find out the subset of those that were actually used during a specific run*. Is this possible? *what I mean with
How do I update my libthread_db shared library so as to match libpthread shared library?
I am using CentOS. I didn’t set up the server and the environment is quite old. I tried to debug a multithreaded server program and some error showed up. Then I realize that the problem is that the version of libpthread shared library I link doesn’t match the version of libthread_db shared library which gdb uses when debugging. I read
How to prevent a Linux C++ library from crashing on an out-of-bounds read?
I am using a closed-source 3rd party Linux lib (.so) compiled for an older version of Linux on an older version of gcc. Unfortunately, it crashes occasionally with a read of an invalid memory address. This is certainly undesirable, and it would be fantastic to fix the library. But as that is absolutely impossible, and it still functions perfectly well