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
15 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
19 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
130 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
51 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
68 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
33 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, ...
24
votes
4answers
3k 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
25 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 ...
12
votes
2answers
752 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 =>...
1
vote
1answer
38 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
40 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 ...
0
votes
0answers
17 views

get path from all linked shared libraries while linking

I have my own linux distribution for an selfmade arm hardware. Therefor I have to compile diffenent software like nginx and openssl. Every compiled software will packed to an rpm. To reduce size I ...
1
vote
2answers
211 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 ...
1
vote
2answers
245 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
42 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
93 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
917 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
0answers
103 views

What is the entry point of a so (shared object?)'s source code?

Specifically I'm trying to port libcroco's functionality to a cross-platform BASIC dialect and need to know where to start looking at the code. In short, what is the equivalent of Window's DLLMAIN?
0
votes
1answer
107 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 ...
0
votes
0answers
102 views

QNX throws an error as login: -sh: cant access shared libraries

When I am trying to login with non root user the QNX throws an error as login: -sh: cant access shared libraries. Why is it so? I have already checked the permissions they are as below: /lib (...
1
vote
1answer
243 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 ...
0
votes
0answers
13 views

Remove or change default .so paths from library

With the usual cmake structure, we end up with a devel/lib directory of libraries we have built, and a install/lib/ directory with these installed files. If I run ldd install/lib/libFOO.so I see ...
0
votes
0answers
106 views

Error while attemping to run OpenRCT2 on Debian Stretch. libicuuc.so.60 cannot be opened: No such file or directory

I've been trying to get OpenRCT2 working on my laptop, which runs Debian Stretch (9.9 amd64), and I'm running into an issue. When running the executable after extracting OpenRCT2 in a folder, it tells ...
4
votes
3answers
422 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
45 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
57 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 ...
0
votes
0answers
34 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
36 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
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
32 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
279 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
1answer
1k 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
199 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
563 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
244 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
745 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
624 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
84 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
2k 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 ...
2
votes
0answers
2k 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
214 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
318 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
44 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
525 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
794 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
1k 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
499 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 ...