For example, I want to embed dicmap.bin to a shared library libxxx.so. I write a program to verify it. But its _start, _end and _size is invalid. end-start and size should be sizeof dicmap.bin (198600798). My objcopy is binutils-2.30-54.el7 of rhel7 with devtoolset-8. I try to add share flags to the .o file, but a error happens: binutils-2.27-41.base.el7_7.1.x86_64 of rhel7
Tag: shared-libraries
hwloc + lstopo Failing to Generate Topology on Dual-CPU Machine for Open-MPI
I’ve been attempting to setup a dual-cpu workstation (Dell Precision 7820) to run local parallel jobs utilizing openmpi 2.1.1-8 (as preinstalled on Ubuntu 18.04) however it fails to run with the following error: Examining the source code of pci-common.c you can find a comment before the assert(0) line that states nothing should normally reach this point and will abort all
Why do I need to set LD_LIBRARY_PATH after installing my binary?
My application is linking to a self-compiled Qt that lies in /usr/local/lib. This works fine when I start my application in the build dir. However, after I have installed my application to /usr/local/bin/ it tries to load incompatible system Qt lib that doesn’t have required symbols and fails. Why? How does the actual location of my binary affect which Qt
How are external symbols of a shared library resolved in the main program?
I’ve been reading a lot about the semantics of load-time linking of shared libraries and one thing that I’m having trouble understanding is how can the main program make references to functions defined in shared libraries? For example, say I have this code myShared.sh main.c I understand that, since shared libraries cannot make any assertions about where they will be
/proc//map shows more shared library than ldd for busybox
Why /proc/<pid>/maps shows more shared library than ldd program? Here’s an example: cksum is used to check if the files are the same. From PC side ldd cross-tool, it shows busybox depends on libc and ld only. However, in the real run-time environment, /proc/132/maps shows one more shared library, /lib/libnss_files-2.22.so. To confirm if we have indirect dependency: No. ldd show
Shared library versioning with cmake on github
I have a fairly new project on github that produces a shared library. Going forward, I would like to use semantic versioning (as described at semver.org) for the shared library major/minor/patch numbers in the file name. The project uses CMake. The CMakeLists.txt file refers to CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINOR and CPACK_PACKAGE_VERSION_PATCH, and sets these to default values if they are not passed
Static-storage-duration object uniquness guaranties when dynamically loaded from multiple libraries
Imagine that there is a shared library S, there are shared libraries A and B, and an executable C. A and B are linked against S. C is not linked against A and B, instead C dynamically loads A and B via dlopen. S has a static-storage-duration object O with external linkage that is used inside A and B. I
How to use an API in c using linux distro: ubuntu 16.04 [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I am beginner in linux and I want to use an API in C language from a certain package. This
Dynamically loading shared objects with/without version numbers
In a Linux program, I need to load a shared object called libfoobar. On my system, there’s libfoobar.so, libfoobar.so.0 and libfoobar.so.0.0.0. On another system with a different distribution installed, libfoobar.so does not exist, only the other two variants are available. What is the correct filename I should be using when loading the shared object? Is it sufficient to try to
Linking shared objects at runtime depending on user configuration
TL;DR I have a library I want to use in my program which comes in two different versions. Both versions provide the same interface but differ in options used to compile them. I now want to use a specific version of the library, however, since both versions are suitable for different tasks and the user should define the task to