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 ...
1
vote
3answers
255 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 ...
-1
votes
3answers
121 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 ...
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 ...
4
votes
1answer
790 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 ...
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 ...
1
vote
1answer
950 views

How to make $ORIGIN in RPATH not follow symlinks?

I have an executable app, which depends on a library libbar.so and loads it via RPATH with $ORIGIN like this: $ readelf -d app Dynamic section at offset 0xe08 contains 26 entries: Tag Type ...
2
votes
0answers
179 views

How to identify system shared libraries?

My software tool has some external dependencies. I am distributing it as a conda package for linux64 with precompiled dependencies including shared libraries. Unfortunately I don't know how to ...
2
votes
1answer
446 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 ...
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.
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
55 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 ...
1
vote
0answers
800 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 (...
12
votes
3answers
25k 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 ...
0
votes
1answer
49 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
60 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 ...
1
vote
1answer
177 views

Can two application share library loaded at runtime?

I have 2 application lets say A1 ,A2 shared one shared object(lets say lib1) which loaded in application at runtime. A1 load lib1 using dlopen successfully. Now A2 wants to load library. Can A2?(as ...
2
votes
1answer
206 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 => /...
51
votes
7answers
119k 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?
-1
votes
1answer
106 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
297 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 ...
3
votes
2answers
8k views

Get ld to pick the correct library

I'm trying to compile a program prog and link it against OpenSSL's 1.0.2 beta, built from source and installed in /usr/local/ssl-1.0.2. On an older system using 0.9.8, this works without too much ...
0
votes
1answer
254 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/...
67
votes
2answers
46k 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 ...
3
votes
1answer
1k views

Invoking a script with ld-linux.so?

I just downloaded a tar file that is supposed to include everything required to run a program that we can call some_binary. I extracted it's contents, and I see the following: A binary (let's call it ...
3
votes
1answer
2k views

Installing flash player for Firefox

I would like to install Flash player for Firefox on Linux. I downloaded the .tar.gz, and there are some compiled shared libraries. I am not sure how to make them work, and I am looking for a hint. ...
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
533 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
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 ...
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 ...
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
237 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
445 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 (...
1
vote
1answer
353 views

E2fsprogs undefined reference to symbol - LFS

I'm building an LFS system, and I've gotten to this page, but when I run make it says: make[2]: Entering directory '/sources/e2fsprogs-1.42.13/build/e2fsck' LD e2fsck /usr/bin/ld: journal.o: ...
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
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 ...
0
votes
2answers
167 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 ...
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
383 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: ...
1
vote
2answers
1k views

patch: “bad file descriptor” in combination with pipe and LD_PRELOAD/ libtrash

Very short summary: cat "$file" | patch produces a Bad file descriptor-error, but patch < "$file" works, when libtrash is preloaded with LD_PRELOAD, and only on bigger projects. Description: For ...
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 ...
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/...
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)?
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 ...