Skip to content
Advertisement

Tag: shared-libraries

How to embed data in shared library?

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

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

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

Advertisement