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.

120
votes
4answers
67k views

How do SO (shared object) numbers work?

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example: example.so.1 example.so.2 I understand the ...
92
votes
4answers
103k views

Where do executables look for shared objects at runtime?

I understand how to define include shared objects at linking/compile time. However, I still wonder how do executables look for the shared object (*.so libraries) at execution time. For instance, my ...
67
votes
2answers
47k views

Getting “Not found” message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things ...
51
votes
7answers
123k views

How to find out the dynamic libraries executables loads when run?

I want to find out the list of dynamic libraries a binary loads when run (With their full paths). I am using CentOS 6.0. How to do this?
22
votes
5answers
9k views

What system call is used to load libraries in Linux?

In strace outputs, the paths to the libraries that executables call are in calls to open(). Is this the system call used by executables that are dynamically linked? What about dlopen()? open() isn't a ...
19
votes
3answers
28k views

Find where is a shared library symbol defined on a live system / list all symbols exported on a system

Basically, this is two questions into one - because if I can list all symbols exported within a system, along with their shared library path, then I could simply grep that output. For kernel symbols,...
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 ...
16
votes
2answers
8k views

How to upgrade shared library without crash?

Here it says that you can rewrite an executable file and the process will run just fine - it will be re-read when a process restarts. However, when I try to replace a binary file while the process is ...
16
votes
9answers
69k views

Problem to launch java at Debian: “error while loading shared libraries: libjli.so”

I'm trying to launch java: $ java -version java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory $ ldd /usr/lib/jvm/java-6-openjdk/jre/bin/...
14
votes
2answers
24k views

Get a list of the functions in a shared library?

How can I get a list of the functions defined in a shared object library, or find out if a particular function is defined in one?
14
votes
1answer
8k views

Installing two glibc alongside in debian/ubuntu

Is it possible to install and use two different glibc versions on the same machine. Where one version is only used to run legacy software, which relies on old glibc binaries? Is it possible to do ...
12
votes
3answers
26k views

Find out if library is in path

Assuming I want to test if a library is installed and usable by a program. I can use ldconfig -p | grep mylib to find out if it's installed on the system. but what if the library is only known via ...
12
votes
1answer
8k views

Using alternate libc with ld-linux.so hacks; cleaner method?

I have a legacy system with a very old glibc, which we can't upgrade without incurring a mountain of testing/validation work. I have needed to run newer programs (such as Java 1.7) on that system ...
11
votes
2answers
8k views

Can I use my own ld.so.cache?

ldconfig has two interesting options: -f conf Use conf instead of /etc/ld.so.conf. -C cache Use cache instead of /etc/ld.so.cache. I tried copying /etc/ld.so.conf to my own home ...
11
votes
2answers
3k views

Cannot execute binary in NixOS - No such file or directory

I tried to install the current oracle jre on a VM running NixOS. Now the following happens: [michas@cc:~]$ tar xvzf jre-7u40-linux-x64.tar.gz |grep bin/java jre1.7.0_40/bin/javaws jre1.7.0_40/bin/...
11
votes
1answer
9k views

What is the order that Linux's dynamic linker searches paths in?

This is not a duplicate because this is dealing with a peculiarity I noticed when I use /etc/ld.so.conf. To get the paths that the dynamic linker searches in for libraries, I run the command ldconfig ...
10
votes
3answers
18k 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 ...
10
votes
1answer
6k views

Which parts of an ELF executable get loaded into memory, and where?

What I already know: An ELF executable has a number of sections, obviously the .text and .data sections get loaded into memory as these are the main parts of the program. But for a program to work, ...
10
votes
1answer
5k views

Linux, GNU GCC, ld, version scripts and the ELF binary format — How does it work?

I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context: -- I have two versions of a dynamic library which expose the same set of interfaces, say ...
10
votes
2answers
1k views

ELF shared libraries - motivation for the PLT

Could self-modifying code be used to speed up function calling in dynamically linked libraries? As far as I understand it, ELF shared libraries use a kind of indirect jump table (the procedure ...
9
votes
2answers
333 views

Is there a mechanism that protects applications during library upgrade?

If user works on an application that is dynamically linked, and system is being upgraded, is there any protection mechanism that prevents application corruption? Or is it up to application?
9
votes
2answers
7k views

Why can't I install multiple versions of a shared library?

There are often instances where a certain program will depend on library version x.y and another on x.z but, as far as I'm aware, no package manager will allow me to install both x.y and x.z. ...
9
votes
3answers
2k views

“which” equivalent for shared libraries

I am looking for a utility that would behave in the same way as which, but to look up shared libraries (*.so) in the directories defined in $LD_LIBRARY_PATH?
8
votes
2answers
3k views

Identifying running programs that are using the old version of a library I just replaced

After installing updates to address CVE-2014-0160 (the OpenSSL Heartbleed bug), I had to take care to restart anything that might be using libssl -- many services, such as Apache and my VPN software, ...
8
votes
1answer
1k views

Effect of static and dynamic linking on start address

I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: ...
8
votes
2answers
4k views

Is it possible to execute code in heap space?

I would like to know if i can execute a code piece sitting inside the heap space?
8
votes
2answers
6k views

How to use libraries installed by nix at run-time?

I'm using nix in "single-user mode" in a system where I'm not the root (see below for a description of my nix setup). I wanted to quickly run one of my binaries which is dynamically linked with a ...
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,...
7
votes
1answer
9k views

Where to get “/etc/ld.so.nohwcap” file from? [duplicate]

When I run a command through strace utility I can see access errors such as access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) Now I've read somewhere that what's ...
7
votes
7answers
9k views

how to share environment variables between shells like globals related to a master pid?

So, I need to share environment variables between shells, and that the changes on the variables be promptly recognized by all shells, like global variables. But they must be related to a master PID, ...
7
votes
1answer
680 views

Can you change a dynamic link target without recompiling?

I downloaded a program that unfortunately doesn't come as a source distribution. When I go to run it, I get the error error while loading shared libraries: libjpeg.so.62: cannot open shared object ...
6
votes
2answers
10k views

Why does LD keep outputting “no version information available”

On every loading of a lib, I get the error: no version information available This lib has been compiled on another PC (ubuntu 10.04) than the one running it (mandriva 2010.2). $ ldd /usr/local/...
6
votes
1answer
7k views

Finding function parameters for functions in shared object libraries

I am currently fiddling around with some c libraries without documentation. I am wondering if it is at all possible to retrieve more metadata, such as parameters and return values, outside of what is ...
6
votes
2answers
52k views

Error Loading Shared Libraries when Installing Redhat Directory Server

While Installing the Red Hat Directory Server on the Red Hat Linux Server 5 (x86_64)i am getting the following error bin/slapd/server/dsktune: error while loading shared libraries: libstdc++.so.5: ...
6
votes
2answers
4k views

libssl and libcrypto backward compatible?

I have an old server application that requires libssl.so.0.9.6 and libcrypto.so.0.9.6. My issue is I currently have libssl.so.1.0.0a and libcrypto.so.1.0.0a on my system. I tried symlinking to the ...
6
votes
1answer
482 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 ...
6
votes
1answer
3k views

shared library not found even with ld.so.conf updated

$ sudo ldconfig -v|grep libOpenNI 355: libOpenNI2.so -> libOpenNI2.so but when I am executing the program I'm getting ./SimpleRead: error while loading shared libraries: libOpenNI2.so: cannot ...
6
votes
2answers
14k views

error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

anisha@linux-y3pi:~/> google-earth ./googleearth-bin: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory anisha@linux-y3pi:~/> locate ...
6
votes
1answer
2k views

Debugging a Segmentation Fault

I have an application that runs on an embedded Linux device that I am expanding with new features. The new features require GLib so, I am dynamically linking the required libraries to the application. ...
5
votes
3answers
7k views

Finding the absolute path of shared libraries used by an executable

Considering lshw as a sample program, here is what ldd gives: $ ldd /usr/sbin/lshw linux-vdso.so.1 => (0x00007fff8bdaf000) libresolv.so.2 => /lib64/libresolv.so.2 (0x000000360e400000) ...
5
votes
2answers
2k views

Why does ldd show this dynamic linker location?

Here's the link command. Notice the specially defined dynamic linker near the beginning. time gcc -Wl,-rpath,/data/data/org.freesoft.Macaulay2/files/lib -Wl,-rpath,/data/data/org.freesoft.Macaulay2/...
5
votes
2answers
600 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 ...
5
votes
1answer
5k views

Memory layout of dynamic loaded/linked library

when loading a shared library in Linux system, what is the memory layout of the shared library? For instance, the original memory layout is the following: +-----------+ |heap(ori) | +-----------+ |...
5
votes
4answers
3k views

Error while loading shared libraries

My project tree looks something like that: src/ include/ Makefile lib/ lib/3rdparylib/ I didn't code 3rdpartylib, but decided to embed its source code in my project packaging. I compile the ...
5
votes
1answer
1k views

Can I use a chroot on my dev machine to build an application to run on embedded linux installation?

I am trying to develop an application to run on an embedded linux installation. It comes with an older version of libc than I have on my development maching. If I were to create a chroot environment ...
5
votes
1answer
285 views

Fedora 21 texstudio fails with symbol lookup error

I just installed Fedora 21 on a laptop, and among other things I installed Texstudio. While the install seems to work fine in general, I get absolutely no reaction from this single program. I have ...
5
votes
1answer
4k views

ntp cannot open shared object file: Permission denied

On a server I haven't worked on, ntpd is broken: # /etc/init.d/ntpd start ntpd: error while loading shared libraries: libz.so.1: cannot open shared object file: Permission denied but permissions ...
4
votes
2answers
6k views

Confusion about linking boost library while compilation

For a client I needed to add boost 1.54 to the system. So I downloaded the latest version (1.55) and built it within a special directory: /usr/local/lib/boost1.55/. This works. Then I had to adapt the ...
4
votes
1answer
473 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 (...
4
votes
1answer
2k views

Environment settings on setuid executables

I am observing a curious behavior when running a program with setuid bit enabled. Program foo is owned by user bar with setuid bit set. User execbar runs foo foo reports that one of the dynamic ...