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.

Filter by
Sorted by
Tagged with
-1
votes
0answers
20 views

does linker do relocations for functions that are referenced but not called? [closed]

I was told that: If your program references 10 functions in the library but calls 0 of them, the difference in lazy binding vs immediate binding is 0 vs 10 lookups. If your program references 100 ...
0
votes
1answer
39 views

why the dynamic linker couldn't resolve reference when a share library has a dependency on other share library?

below is my code: //a.c I don't use header files as this is just for demo purpose. extern void function_b(int num); void function_a(int num) { function_b(num) } //b.c void function_b(int num) ...
1
vote
1answer
36 views

What would be an effect on the system when we try to forcefully delete /etc/ld.so.preload file?

I have been doing my research around this command. rm -f /etc/ld.so.preload The script which currently I am analyzing, starts with above command. Note: I tried doing my research around "ld.so....
0
votes
1answer
41 views

C++ linking error: 'libcairo.so: undefined reference to FT_Get_Var_Blend_Coordinates'

I'm trying to build a C++ project via CLion and have been unable to get past this error in the linking process: /lib/../lib64/libcairo.so: undefined reference to `FT_Get_Var_Blend_Coordinates' I'm ...
1
vote
1answer
27 views

compiling old glibc on arm fails with undefined references in nis and nss

It seems to have become a bit complex, so first some background: I need to compile self-contained programs that run on arm systems with glibc versions typically between 2.13 and 2.17. When trying to ...
0
votes
0answers
25 views

linking .so file to newer GLIBC on SLES 11

I want to use the rocksdbjni.so on SLES 11 but I noticed that it is dependent to GLIBC_2.12: librocksdbjni.so: /lib64/libpthread.so.0: version `GLIBC_2.12' not found (required by librocksdb.so) The ...
0
votes
0answers
29 views

Trying to link Android shared object to native Linux program

I'm attempting to execute code directly from an unmodified Android shared object that has been compiled for i686. My executing environment is a native Linux x86_64. I have trouble linking everything ...
0
votes
1answer
99 views

ld ignores ld.so.conf

This is my /etc/ld.so.conf /usr/local/lib64 /usr/local/lib include /etc/ld.so.conf.d/*.conf The directory /etc/ld.so.conf.d/ contains mysql-x86_64.conf which contains only this one line: /usr/lib64/...
0
votes
0answers
26 views

nodejs undefined symbol when using pulsar-client

I am trying to install the pulsar client npm module on Debian 9.1. I tried following the instructions on github (https://github.com/apache/pulsar-client-node). My pulsar is in a custom directory so I ...
0
votes
0answers
33 views

Is the purpose of symbolic links to shared libraries in /usr/lib64 to satisfy -l linker filename requirements?

My /usr/lib64 directory contains the following files (among others): $ ll /usr/lib64/libboost_file* /usr/lib64/libboost_filesystem.so.1.69.0 /usr/lib64/libboost_filesystem.so -> ...
0
votes
0answers
139 views

How to test a binary, to see if all shared library dependencies, are satisfied?

I have a program which I compiled on an earlier version of Fedora which suddenly broke after an upgrade. I was running an older version of Fedora at the time which had stopped receiving updates; so I ...
0
votes
2answers
108 views

Is there an rpath for dynamic linked libraries?

So, the project I am working on uses a non-system directory to keep some DLLs that the code uses. I don't want to put them in system directories, so the executables have an rpath set to find the DLLs....
1
vote
0answers
109 views

Forking `addr2line` on shared object from application for constructing stack traces. How safe is this?

I am augmenting my applications which run on Linux to emit a backtrace when terminal signals (such as SIGSEGV, SIGABRT) are received by a process or thread. The code works very well using backtrace(...
1
vote
0answers
23 views

How to link to a numbered shared library?

This is the command I am running arm-linux-gnueabihf-gcc -Wall -Wl,--verbose -mthumb -mthumb-interwork -D_REENTRANT -oTestRun11 ./main.c -ldl -lpthread -lRTU_Module Which gives in the printout ...
1
vote
1answer
2k views

Correct way to add /lib/ld-linux.so.3 in Debian

My current setup is quite exotic, and I could use some clarification. I am running on a Pinebook Pro, powered by a Quad Cortex-A53, 64-bit CPU. The OS is a 64-bit version of Debian: $ uname -a Linux ...
0
votes
0answers
75 views

Linux: Where and how is ELF object file header used?

Does anyone know where in the shell, fork(), exec() sequence ELF are read and used by the loader? Linux can be used as an example. I ask because it's my understanding ELF has information about ...
0
votes
0answers
170 views

How many memory segments?

I'm having trouble interpreting the output of a pmap command. I want to see how many memory segments are added to the process when one of the libraries (libupper/librot13) implementing a transform is ...
1
vote
0answers
71 views

ldconfig creating links with strange names after patching libraries with patchelf?

I am patching several libraries on my development server to remove unneeded dependencies using the patchelf tool. These get packaged into an RPM and installed on my runtime system. After the install, ...
26
votes
4answers
6k views

What is the gold linker?

Has anyone used the gold linker before? To link a fairly large project, I had to use this as opposed to the GNU ld, which threw up a few errors and failed to link. How is the gold linker able to link ...
1
vote
0answers
82 views

Objdump shows different symbols when disassembling and just printing symbols

Ubuntu 18.04 I have a simple ELF64 binary compiled from a C source file and linked with a shared object. I tried to examine it with objdump and got the following confusion: $ objdump -d -j .plt bin ...
13
votes
2answers
1k views

How can the dynamic linker/loader itself be dynamically linked as reported by `file`?

Consider the shared object dependencies of /bin/bash, which includes /lib64/ld-linux-x86-64.so.2 (dynamic linker/loader): ldd /bin/bash linux-vdso.so.1 (0x00007fffd0887000) libtinfo.so.6 =>...
2
votes
1answer
278 views

How do library files (*.so) resolve shared dependencies?

If I invoke the following command: ldd mylib.so this then yields something along the lines of: libopencv_features2d.so.4.1 => /usr/local/lib/libopencv_features2d.so.4.1 (0x00007f83dee6b000) If ...
2
votes
1answer
85 views

Is the dynamic linker automatically invoked by the operating system or by code embedded in the ELF file?

I'm not sure, whether the dynamic linker /usr/bin/ld is automatically invoked by the operating system, when the ELF file is loaded, or whether it's invoked by code embedded in the ELF file? When I ...
1
vote
2answers
472 views

Why does `ldd <dynamic_lib>` output “??? => ???” (question marks in both library and location)?

Running ldd <dynamic_lib>, I noticed that there are some entries that read ??? => ???. Searching for a variety of combinations of "Linux", "ldd" and "??? => ???", both via search engine ...
3
votes
2answers
1k views

Use Different OpenSSL for Apache

I'm compiling Apache from source, and staticly linking mod_ssl. I'm looking to use a different version of OpenSSL to the system-installed version. I would like to do this in a way that doesn't affect ...
0
votes
1answer
56 views

Dynamic loader: Strange behavior (Debian 8)

I'm trying to setup and run a scientific application on Debian 8 guest OS (OpenVZ containerized environment). Since the OS-bundled GNU C++ library is quite old and doesn't contain all needed symbols, ...
1
vote
0answers
144 views

Official ELF reference & ignoring DT_RPATH in shared libraries

What is the official ELF format reference for Linux? There is the ELF 1.2 specification, which is from 1995 and outdated (does not include DT_RUNPATH for instance). But apart from that, it seems ...
1
vote
1answer
3k views

Make error: DSO missing from command line

I am attempting to install rejoystick, and when I run make, I get this: Making all in src make[1]: Entering directory '/home/chrx/Downloads/joystick/rejoystick-0.8.1/src' make[2]: Entering directory '...
0
votes
1answer
154 views

Is an executable portable between different Nixos hosts which reference different nixpkg commits?

I'm trying to get an executable to work by just copying it directly from one Nixos host to another. It works/executes on only one of the hosts. On old host (where it works): [root@...
0
votes
0answers
24 views

How does my application in Linux know how to find libraries in the common places [duplicate]

When I compile a simple C program for Linux, how does it automatically know where to find the standard C libraries when I run it? Take the simple Hello World program for example which uses printf to ...
1
vote
1answer
517 views

Why (and how) do I have (seemingly!) duplicate symbols in my shared libraries?

I happened to need to work out which symbols were exported by which library from a flat list of exported shared library symbols. There were just enough symbols (20 or so) in the list that I wasn't ...
4
votes
3answers
591 views

Compile program in GNU GuixSD with cmake

I am trying to compile Xash3D on GuixSD v1.0.0 and gcc 8.3.0. As is shown below, ld (GNU Linker) is giving me errors, that ctr1.o and ctri.o are missing. These files exist elsewhere under multiple ...
1
vote
0answers
81 views

After setcap on executable, curl_easy_perform throws out of memory error

I've cross compiled an executable to run on Debian Stretch that requires a specific version of cURL (greater than 7.56) to run, and needs specific capabilities during execution. So on the executable ...
0
votes
1answer
98 views

Installing gtkmm from source

I know that gtkmm can be installed using package manager, but here I am keen to install it from source. It requires me to install the Dependencies: libsigc++ 2.0 GTK+ 3.0 glibmm cairomm pangomm ...
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 ...
7
votes
2answers
2k 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
37 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
611 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 ...
2
votes
1answer
4k 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
2answers
359 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
848 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
450 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
1k 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
908 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
116 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
4k 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 ...
3
votes
1answer
3k 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
37 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
250 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
423 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 ...

1
2 3 4 5