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
0
votes
0answers
93 views

Can't compile any c program (/usr/bin/ld: 1: Syntax error: newline unexpected)

Hello everyone, I have a serious issue, i can't compile any c program, i get the following error : /usr/bin/ld: 1: Syntax error: newline unexpected collect2: ld returned 2 exit status I have found on ...
1
vote
1answer
22 views

ldd shows a set of libraries linked in, but using rabin2 -l shows differently. Why is that so?

While trying to debug something, i noticed that ldd <executable> would show a bunch of libraries like libldap_r, libkrb5 and libroken, amongst others. On the other hand a rabin2 -l <...
0
votes
0answers
39 views

ifort will not find gmp library (libgmp) while linking

Does anybody know the underlying sorcery behind libgmp?? I am working on compiling a program (hires_ifr.c) on Red Hat Enterprise Linux 7.9 that previously had no issues. It is now failing to find the ...
0
votes
0answers
77 views

Make error: DSO missing from command line when installing YOLOV4

I am trying to install YOLOV4 in Linux and when I run make.I get this error: lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line. Maybe the problem is related the ...
1
vote
1answer
69 views

Why is chrpath limited to maximum length 6?

I'm trying to change the RUNPATH of a shared object but I get an error that it cannot be longer than 6 characters. What is the reason for this? This is chrpath version 0.16 on Raspbian. $ chrpath -r ...
1
vote
0answers
29 views

Linking an assembly program

I'm trying to compile and link an assembly program. assembly file (main.asm): .section .text .global main main: mov $msg, %rdi call printf xor %rax, %rax mov $80, %rdi syscall ...
0
votes
1answer
16 views

How can I “give” a forked process a diferent dynamic library than the one it “asks” for?

I want to know how I can "give" a forked process a different dynamic library than the one it "asks" for. For example, if the fork "asks" for the library "foo.so"...
0
votes
0answers
25 views

How to write a file PkgConfig.pc file that supports both static and shared linking

I am writing a little library as a self challenge. I plan to target Linux based systems. Reference: https://gitlab.com/invitron/cphoton Forked: https://gitlab.com/mansoorahmedmemon/cphoton (fix ...
0
votes
0answers
28 views

What is the best way of finding library conflicts in a large application?

I have a large application (let's call it P) with lots of dependencies to boost, Qt, zlib, libpng, etc. Recently, I have added a feature to P that needs to dynamically load a new shared object (let's ...
1
vote
0answers
22 views

Definitive way to make dynamic link .so file from many C source codes [closed]

How do we build/make dynamic link .so file from many C source TUs (translation units) as gcc -o foo.so -shared -fPIC foo.c of a single .c file ?
0
votes
0answers
36 views

How to debug a cpp file that's part of a so file in the software?

So I have this software which has multiple .so files. For one of the so file and I made some changes to the code but I want to see the line by line execution of file present in the so file. Just to ...
0
votes
1answer
43 views

Mac OS 10.12 - Accidentally Unlinked libz.1.dylib

Ran: unlink /usr/lib/libz.1.dylib Now I can't launch from my user profile. I have been able to run in recovery mode, where I can see the .dylib in question is there, but running in single-user mode I ...
-4
votes
2answers
275 views

What is the linker and what is the loader in dynamic linking?

CSAPP (3ed) says in p733 that 7.9 Loading Executable Object Files To run an executable object file prog, we can type its name to the Linux shell’s command line: linux> ./prog Since prog does not ...
-1
votes
1answer
85 views

Does `dlopen()` performs dynamic linking by invoking dynamic linker `ld-linux.so`?

CSAPP says Linux systems provide a simple interface to the dynamic linker that allows application programs to load and link shared libraries at run time. #include <dlfcn.h> void *dlopen(const ...
0
votes
1answer
229 views

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

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
72 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
183 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
144 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
53 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
91 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
291 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
263 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
335 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
1answer
245 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
27 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
5k 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
106 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 ...
1
vote
0answers
96 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
8k 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
164 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
2k 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
789 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
167 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
603 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
2k 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
75 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
199 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
4k 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
196 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
29 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 ...
2
votes
1answer
794 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
714 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
122 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
175 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
834 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 ...
4
votes
1answer
5k 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
528 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
2 3 4 5