Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [dynamic-linking]

In computing, a dynamic linking is the process of an operating system (OS) that loads (copies from persistent storage to RAM) and links (fills jump tables and relocates pointers) the shared libraries needed by an executable at run time, that is, when it is executed.

17
votes
1answer
2k views

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

I have a binary executable named "alpha" that requires a linked library (libz.so.1.2.7) which is placed at /home/username/myproduct/lib/libz.so.1.2.7 I export the same to my terminal instance before ...
0
votes
0answers
11 views

How to globally install dylib created by clang on MacOS

I have this in my Makefile: test: @clang -shared -fpic -O2 -install_name libasdf.dylib -o libasdf.dylib asdf.c @cp -f asdf.h /usr/local/include @cp -f asdf.dylib /usr/local/lib ...
0
votes
0answers
5 views

How to link a C library to an Assembly library on Mac with clang [migrated]

I have this in my C library: myc: @clang -I . -dynamiclib \ -undefined dynamic_lookup \ -o myc.dylib myc.c .PHONY: myc And this in my assembly library: buildasm: @nasm -f ...
0
votes
0answers
17 views

Check dependancies in compiled executables and shared objects

I'm trying to find what symbols are used by pam_ldap library that uses openssl dependancies. Also I'm trying to figure out same symbols but, in this case, from the executable ldapsearch. I tryed ...
7
votes
2answers
1k views

gcc - unknown switches (absent also from the manpage)

I'm trying to experiment with shared objects and found the below snippet on http://www.gambas-it.org/wiki/index.php?title=Creare_una_Libreria_condivisa_(Shared_Library)_.so gcc -g -shared -Wl,-soname,...
1
vote
0answers
16 views

Why does the address of an internal symbol needs to be recorded in .got?

I am reading the blog https://eli.thegreenplace.net/2011/11/11/position-independent-code-pic-in-shared-libraries-on-x64 In the part "x64 PIC with data references - an example", it seems that the ...
4
votes
0answers
57 views

Compile a library aiming to reduce size as much as possible

I have to 'squeeze' all the needed code to run ldaps on an embedded system. So the 3 MiB of lybcrypto and almost 700KiB of libssl are way too much. I'm now experimenting on ldapsearch because reading ...
0
votes
1answer
50 views

What does a “failed to map segment from shared object” error mean?

Many answers to other questions help resolve an error of the form "failed to map segment from shared object," but they usually have very specific answers that I find difficult to apply to other ...
0
votes
0answers
53 views

Symlink resolution and the $ORIGIN variable in RPATH

Are symlinks resolved before or after the dynamic loader figures out the value for the $ORIGIN in the rpath from an executable? Longer explanation: I'd like to know if there's an standards-compliant ...
0
votes
2answers
63 views

$LIB variable does not expand to anything in Ubuntu Server 18.10

I have the same exact problem as this question previously posted, where /etc/ld.so.preload does not intercept the right architecture. A little background: I have compiled a shared object (64-bit) that ...
2
votes
1answer
207 views

ldd equivalent which fail when library not found

Assume I perform ldd /bin/ls with the pthread library removed. I obtain linux-vdso.so.1 (0x00007ffcc3563000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000) libcap.so.2 => /...
-1
votes
1answer
108 views

what are the executable ELF files respectively for static linker, dynamic linker, loader and dynamic loader?

In Linux, what are the executable ELF files respectively for static linker dynamic linker loader dynamic loader? Which of them are invoked by execve() by dlopen()? How are they invoked by execve(...
0
votes
1answer
299 views

How does Linux kernel dynamically use a module?

Understanding the Linux Kernel says The kernel has two key tasks to perform in managing modules. The first task is mak- ing sure the rest of the kernel can reach the module’s global symbols, such ...
0
votes
1answer
260 views

Running a custom-compiled executable returns “No such file or directory”

I have an executable but when I run it I get "No such file or directory" $ chmod a+x bin $ file bin bin: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/...
1
vote
0answers
29 views

How to add ssmtp into initramfs?

I'm trying to add ssmtp into initramfs. However, I can not find (or compile at the moment) the statically linked version. I guess my only option is adding the current, dynamically linked version. I'...
0
votes
1answer
541 views

How to run programs with ld-linux.so?

The dynamic linker can be run either indirectly by running some dynamically linked program or shared object (in which case no command-line options to the dynamic linker can be passed and, in the ELF ...
1
vote
0answers
806 views

Apache + mod_ssl build not linking to my OpenSSL build

I have spent some time searching online but none of what I found seems to help. I'm running CentOS 6 64bit and would like to compile Apache with mod_ssl and need to link it to my own OpenSSL build (...
-1
votes
1answer
28 views

Can I programmatically remove funcionality from a shared library that is not used by a specified executable? [closed]

I have a library taking up a lot of disk space. Only one program I use links to that library. I am pretty sure that the program uses only a tiny fraction of the functionality provided by that library. ...
1
vote
1answer
123 views

executed “chmod 666 ld-2.17.so” - how can i recover?

While trying to learn about how ld-2.17.so works to change the permission of chmod executable itself, and thought if i can change the permission of ld-2.17.so itself. I ran chmod 666 ld-2.17.so in a ...
1
vote
1answer
169 views

Interpreting the unhandled signal exception in Linux

I'm trying to debug a prototype CPU that throws unhandled signal 11s and signal 7s in the startup process. Here is what the kernel prints out. I have added extra print statements to the kernel to ...
2
votes
0answers
41 views

Does Debian define what GPL compliance means for the purposes of packaging?

The GPL license speaks of "derivative works". Debian has taken the position that deterministically linking against a library with LD_PRELOAD does not make your program a derivative work. This allows ...
0
votes
1answer
238 views

What does “statically linked” mean?

As my understanding, so file is the dynamic library. We can use ldd to print its dependencies. For example, I can execute ldd -r /usr/lib/aarch64-linux-gnu/libstdc++.so.6 to get the output as below: ...
4
votes
1answer
446 views

Fix hardcoded dynamic linking for executable

I have an executable file called reg with the following shared library dependencies: [terminal]$ ldd ./reg linux-vdso.so.1 => (0x00007ffc40d90000) libpthread.so.0 => /lib64/libpthread.so.0 (...
2
votes
1answer
449 views

Why can't I find the symbol tables in the C libraries in MacOS?

I've looked at the hexdump of both libc.dylib and xlib.dylib, and I can't find the symbols for the C functions in those libraries within those files. I figure they should be in there, because I've ...
2
votes
1answer
257 views

De-prioritize ld.conf.so.d library path resolution

From a separate question, and other articles on the subject, it appears that additional library paths defined by ld.so.conf.d will always be resolved (i.e. in the case of a name clash, such as when ...
0
votes
1answer
45 views

When is the dynamic library needed [duplicate]

I was told that the dynamic library is good because it can save RAM, it's only needed while the program is running. Now I have a question: if a program can be executed, can I say that all of dynamic ...
1
vote
1answer
390 views

Are shared library ABI compatible as long as their versions are the same?

Suppose I have a program compiled that's linked against libc.so.6 on one system (e.g., Ubuntu x64). If I take this binary to another system that has the same libc version 6 (e.g., Fedora x64), it ...
0
votes
1answer
186 views

Undefined reference problems with libusb

I'm trying to use pyuvc module which depends on libuvc which depends on libusb. However, when I try to import uvc in python, I get ImportError: /usr/local/lib/libuvc.so.0: undefined symbol: ...
0
votes
2answers
168 views

Will dynamic link library must be loaded into RAM

As we know, any executable file, which is running, is loaded into RAM. Also, we have two kinds of libs: static link library and dynamic link library. The two kinds of libs should be loaded into RAM ...
1
vote
0answers
38 views

list the link files of a process [duplicate]

Saying that there is a running process named a. Is it possible to list all of the lib files that a needs, including static link files and dynamic link files (.a, .so)?
0
votes
1answer
278 views

A strange problem when trying to install GNU MPFR

I'm trying to install GNU MPFR. I've downloaded the source, cd'd into it and typed ./configure, which goes through a load of checks (which are all okay, as far as I can see.) The problem occurs when ...
5
votes
2answers
580 views

ld.so.cache file is not a binary file

I am currently studying for Comptia Linux+ exam and I am at the Shared Library chapter. Among all, it says that the /etc/ld.so.cache file is a binary file, but in my case it is not. It is a regular ...
3
votes
2answers
938 views

What does the interpreter reported by `file` refer to?

I'm trying to run perl executable provided by a debug library on Ubuntu 16.04, but for some reason the file "isn't executable" even though it seems to be a match for my architecture. The perl ...
3
votes
1answer
112 views

Shared library minor version management

I have a simple program called main: #include <iostream> #include "random.h" int main() { std::cout << "The program has started\n"; return get_another_random_number(); } ...
3
votes
2answers
2k views

Get hex-only output from objdump

Say for example I've got this C function: void f(int *x, int *y) { (*x) = (*x) * (*y); } When saved to f.c, compiling with gcc -c f.c produces f.o. objdump -d f.o gives this: f.o: file ...
0
votes
1answer
626 views

Library is found by ldconfig but not by ldd for any program using this library

Running arch linux, I have qt5-base installed, which provides libQt5Core.so.5. Running ldconfig finds the shared object: $ sudo ldconfig -v | grep libQt5Core libQt5Core.so.5 -> libQt5Core.so.5.10....
4
votes
1answer
802 views

anaconda Qt vs system Qt

The anaconda python framework includes its own Qt shared libraries, among other ones. Because of the nature of the framework, it must appear first in the PATH environment variable so its python ...
4
votes
0answers
639 views

Shared library link time reference relocation error

I'm using a custom Linux distribution on an ARM box, that is based off of Ångström. Since all of the packages that I could find in the package manager are horribly out of date, I rebuilt all of the ...
0
votes
2answers
233 views

Fedora 27 new install doesn't bring login dialog

I just installed the latest updates today 11/25/17 and getting to "F" icon during boot and nothing happens. Logging in "single" mode, I get these messages: FAILED to start Journal Serice FAILED to ...
2
votes
1answer
70 views

How does Qubes do memory management, especially with regard to shared objects?

I'm just reading about Qubes OS, and I have a very simple question -- how does it do memory management and shared object use? Feel free to correct any misconceptions or errs in vocab, but we have the ...
1
vote
1answer
597 views

How to force executable to link dynamic library

I have this compiled executable: ./run.x I have moved it to other computer, but there the dynamic dependencies are not satisfied: ldd ./run.x libx.1.so => not found However on the ...
6
votes
1answer
450 views

Why should or should not shared libraries be executable (e.g. Red Hat vs Debian)?

This is almost but not quite a duplicate of "Why are .so files executable?". I note that on Red Hat based systems shared libraries have execute permission but on Debian they do not. Logically shard ...
2
votes
0answers
107 views

Is there anyway to verify validity of dlopen handle?

In my case after my program cas dlclose program is crashing and I am not getting stack trace for dlclose or any function on upper frames. I know handle value of dlclose . Is there anyway to check if ...
-1
votes
3answers
123 views

How to force programs in /usr/bin to always use libs in /usr/lib

I'm struggling with a path problem on Fedora 26. I am building updated programs and libraries and placing them at /usr/local. Programs in /usr/local/bin use the libraries in /usr/local/lib. For some ...
1
vote
1answer
232 views

In what library on Linux are the system calls and how is this library linked to the executable object file that contains the system calls?

I know that the system calls are not in the C standard Library. Is there any library (some sort of a system library) where the system calls are? If there is such a library how is this library linked ...
4
votes
1answer
6k views

Is the vdso shared library (linux-vdso.so) the library that contains the kernel object code (system calls)?

I noticed that all my programs compiled to gcc are linked to vdso library. Is this the library that contain the system calls to the kernel, like mmap() and fork() and other system calls? I know that ...
1
vote
3answers
257 views

Installed 2 libraries side to side and need both. What solution to avoid linking problems?

I installed two versions of openCV one is openCV3 and another one openCV2.4 on my ubuntu 16.04 machine and need both. However I am now unable to compile C++ code which is intended for openCV3. I get ...
10
votes
3answers
17k views

Linux executable fails with “File not found” even though the file is there and in PATH

I want to launch the wine executable (Version 2.12), but I get the following error ($=shell prompt): $ wine bash: /usr/bin/wine: No such file or directory $ /usr/bin/wine bash: /usr/bin/wine: No such ...
2
votes
1answer
692 views

What is the correct arrangement of symlinks to allow both openssl 1.1.0 and 1.0.2 shared libraries to co-exist?

I want to have openssl-1.0.2 and openssl-1.1.0 both available for dynamic linking to different applications. I'm slightly unsure about this, because I would expect 1.0.2 to be installed in a file ...
0
votes
1answer
4k views

How to Change Text in Shared Libraries (*.so files) in Linux

When I search text in a folder using bash I can see that text is in binary file. I would like to change the text in *.so file.