Questions tagged [ld]

These questions are about ld: a dynamic linker/loader which combines object files, archive files and shared libraries before the final compilation of a program.

Filter by
Sorted by
Tagged with
0 votes
2 answers
84 views

gdbus symbol look up error

I'm using Archlinux. After a recent update, I find that the gdbus doesn't work and it presents a symbol lookup error: ➜ tidedra@ZgrArch ~ gdbus gdbus: symbol lookup error: /usr/lib/libgobject-2.0.so....
1 vote
2 answers
61 views

Hacking LD_LIBRARY_PATH to use a recent bash from a chroot

I try to get a more up to date version of bash from LinuxMint. I have a chroot with Debian Sid in my box. What I try to do in a bash wrapper script, early in my PATH #!/bin/bash LD_LIBRARY_PATH=/path/...
2 votes
1 answer
78 views

GCC linker search path when cross-compiling

I have various tool chain directories on my linux machine for compiling under specific compiler versions. I have a problem where the linker (in the tool chain dir) is selecting a library file from ...
  • 21
0 votes
1 answer
31 views

What is the .xs and .x* files in ldscripts?

What are these files /lib/x86_64-linux-gnu/ldscripts/elf32_x86_64.xs /lib/x86_64-linux-gnu/ldscripts/elf_x86_64.xs /lib/x86_64-linux-gnu/ldscripts/elf_i386.xs /lib/x86_64-linux-gnu/ldscripts/elf_iamcu....
0 votes
0 answers
35 views

Running Build Engine GDX on newer Java (> 1.8)

When running BuildGDX with any version of Java above 1.8.0 (Tested with 11, 17 and 19), it launches fine, but upon running a game (Tested with Blood and Duke Nukem 3D), it pauses for a second and ...
0 votes
0 answers
27 views

building geeqie on arch: ninja error undefined reference to lua_settop

I am trying to build geeqie from https://github.com/BestImageViewer/geeqie.git. Following instructions in the README.md `meson setup build` `ninja -C build install` The meson runs without error but ...
0 votes
0 answers
134 views

ld: error: undefined symbol: X509_STORE_new

I build grpc static library, but I get error: ld: error: undefined symbol: X509_STORE_new I have installed openssl: mindgood@minds-MacBook-Pro grpc % whereis openssl openssl: /usr/bin/openssl /...
0 votes
0 answers
17 views

How is the syntax with a loader before the command desribed in bash and other similar shells? [duplicate]

While reading this I saw this kind of strange command $ /lib64/ld-linux-x86-64.so.2 ./app $ LD_DEBUG=all /lib64/ld-linux-x86-64.so.2 ./app Unexpectedly they really works What are these? The man pages ...
  • 1,927
0 votes
1 answer
188 views

Linker cannot find libpthread

I am trying to build 32bit versions of two programs, and both shows the same error message /usr/bin/ld: cannot find /media/34GB/Arquivos-de-Programas-Linux/Glibc-2.17-32bit/lib/libpthread.so.0 I ...
0 votes
0 answers
247 views

Building python from source with --includedir and -libdir

I'm trying to build python from source. I got the error home/jmsh/Python-3.10.5/Modules/_ctypes/_ctypes.c:107:10: fatal error: ffi.h: No such file or directory Since I'm not a sudoer on the machine, ...
0 votes
0 answers
9k views

/usr/bin/ld: cannot find -latomic: No such file or directory

I am trying to compile some code using gcc. The following error is thrown: /usr/bin/ld: cannot find -latomic: No such file or directory collect2: error: ld returned 1 exit status make[1]: *** [...
2 votes
1 answer
863 views

ELF symbol: GLOBAL+HIDDEN

Based on eg. this Oracle description: STB_GLOBAL Global symbols. These symbols are visible to all object files being combined. One file's definition of a global symbol will satisfy another file's ...
0 votes
1 answer
54 views

How to link using -lfoo when there are versioned names of libfoo but no libfoo.so

Suppose /usr/lib/x86_64-linux-gnu/ contains libfoo: libfoo.so.2 -> libfoo.so.2.0.0 (symbolic link) libfoo.so.2.0.0 Notably missing is libfoo.so. Suppose there is a program /usr/local/bin/...
  • 2,334
0 votes
1 answer
1k views

32bit program on 64bit: cannot execute binary file: Exec format error

I'm linking an application consisting out of two libraries in clang under WSL. The command I use looks as follows (simplified): clang -m32 -fsanitize=address -L _build/ -l:lib1.lib -l:lib2.lib -o test ...
1 vote
1 answer
146 views

Which component of linux remove filter environment variables on executing setuid program?

It's observed that when running a program having setuid bit set, it won't receive some environment variables set on the shell (bash etc.). Several environment variables which get removed this way are ...
2 votes
3 answers
1k views

ImportError /usr/lib64/libQt5Core.so.5 - in several software packages

Working with Fedora 35: I want to run a few different software packages that share a dependency, seemingly Qt. In the shell, I get this response, from Cadence and other software: ImportError: /...
  • 1,575
7 votes
3 answers
1k views

LD_PRELOAD for setuid binary

I'm trying to override malloc/free functions for the program, that requires setuid/setgid permissions. I use the LD_PRELOAD variable for this purpose. According to the ld documentation, I need to put ...
  • 109
1 vote
1 answer
242 views

Linker error by g++ when compiling to stdout

Let's say I have a C++ file called dummy.cpp, and I need to compile it with g++ in such a way that it's being from stdin and g++ spits the compiled binary out to stdout. If only the stdin part is ...
  • 113
1 vote
0 answers
79 views

How to run multiple versions of sudo?

My machine runs a patched version of Sudo version 1.8.21p2 and I need to also have the unpatched version. After getting the code from Github (the unpatched one), running ./configure, and then make I ...
  • 309
0 votes
0 answers
266 views

Shared library fetching fails if LD_LIBRARY_PATH isn't exported

By looking at /etc/ld.so.conf.d there is a libc.conf file that point to /usr/local/lib that contains the .so file necessary to run my application correctly. Even running ldconfig -v it is showed that ...
1 vote
0 answers
169 views

Why pgrep hangs when clang AddressSanitizer library is preloaded using LD_PRELOAD?

I noticed that when I set LD_PRELOAD env. variable to libclang_rt.asan-x86_64.so pgrep hangs. Why is this happening and how to avoid this? senx:/$ time pgrep anything real 0m0,022s user 0m0,...
  • 141
0 votes
1 answer
221 views

Weird linking issue with libldap using cmake

I am trying to build SimGear from the FlightGear project using the download_an_compile.sh script (which uses CMake to build the binaries). The build went fine so far, but when the script tried linking ...
  • 101
0 votes
0 answers
194 views

Project links during compile but ldd shows library not found. why?

When i run through the compile process of a project, quite often i need to use a custom library compiled and stored somewhere that is not in the path. At the start of the compile, I can specify the ...
0 votes
0 answers
230 views

What is the difference between link and ld command in linux ..?

First, let tell what do I think about them:- ld ld is a GNU linker according to man page. I think, It takes an object file as input and return an executable output file. ld combines a number of object ...
0 votes
2 answers
2k views

'LD' can't find library to link, even though 'ldconfig -v' lists the file

I'm trying to install KIWI on my RaspBerry Pi. When I attempt a pip install kiwi I get a linking failure, with /usr/lib64/gcc/aarch64-suse-linux/10/../../../../aarch64-suse-linux/bin/ld: cannot find -...
  • 103
2 votes
0 answers
1k views

Which library is producing this error: undefined reference to `TIFFTileRowSize@LIBTIFF_4.0'?

I'm building Ignition (https://ignitionrobotics.org/home) from source on Ubuntu 18.04.5 with gcc-10.1.0, and it seems that some dependencies are missing or have wrong versions. Here are linker errors ...
1 vote
0 answers
168 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 ...
  • 203
1 vote
1 answer
6k views

CentOS 8 - /usr/bin/ld: cannot find -lnsl

I am working on a new CentOS 8 server to replace an aging CentOS 6 server. Most everything is working and I am having the primary users test out everything they use the server for. Many errors have ...
-1 votes
1 answer
175 views

Trying to compile X Window System and getting errors that I don't know

I have double-checked that I have every dependency to build X and that they are all at the latest version. I'm not even sure where to begin with these errors, so I was hoping someone here could help ...
  • 33
3 votes
1 answer
1k views

Is it possible to use lazy dynamic linking on Linux?

On UNIX, I may use a commandline like: cc -o executable *.o -zlazyload -lsomelib with the result that the libraries listed to the right of -zlazyload are marked with the LAZYLOAD ELF tag in the ...
  • 18.5k
-1 votes
2 answers
2k 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 ...
  • 95.9k
0 votes
1 answer
793 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 ...
  • 95.9k
0 votes
1 answer
1k views

dnf broken by installation - how does /usr/lib64 get on the search path and why isn't it earlier?

After installing the an RPM on centos8 I found that the package manager dnf - inexplicably stopped working with a cryptic error: Traceback (most recent call last): File "/usr/lib64/python3.6/site-...
1 vote
1 answer
76 views

pyspotify compilation ld error

I'm trying to install mopidy-spotify on my freebox delta that allow me to install vm and is arm64 based After many problems, i've manage to get most of the dependencies working and to get rid of most ...
  • 13
2 votes
1 answer
1k views

What mandates the _start entrypoint (kernel, ld-linux.so, etc.)?

I know that ELF executable files need to have a visible _start subroutine where the execution begins. However, from what I can understand, the Kernel actually calls in ld-linux.so (or some other ...
1 vote
2 answers
305 views

How to use gcc dynamic linker

test.c: #include <stdio.h> int main(){ return printf("helloworld %d",a); } lib.c: int a=0; test.c is using the variable a from lib.c. I turned it into the shared library lib.so. gcc ...
3 votes
1 answer
502 views

ld linker ignores LD_LIBRARY_PATH

I'm having trouble linking the Intel MKL libraries to use in building Julia with MKL support. I've had this problem with other projects as well, but here I'll focus on Julia. I have MKL installed in /...
  • 33
1 vote
1 answer
263 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, ...
  • 111
0 votes
0 answers
3k views

Why gdb can't find my shared object library?

Please IGNORE my post. I must have been the 1000000th person to discover that gdb resets LD_LIBRARY_PATH. Sorry if you have wasted some of your time! For the record, the solution is not to say ...
0 votes
2 answers
574 views

Operation not permitted - libwine.so.1

I run Fedora 30 on my laptop. Yesterday I tried to install wine using the following commands: $ sudo dnf config-manager --add-repo https://dl.winehq.org/wine-builds/fedora/30/winehq.repo $ sudo dnf -...
0 votes
1 answer
1k views

Cannot execute ld : error 126

I have f30 installed 3 weeks and I keep seeing this error when I try to compile C++ of maybe fortran code. It is an error connected to ld : error: ld returned 126 exit status I've tried to look into ...
  • 425
1 vote
1 answer
7k 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 '...
1 vote
0 answers
183 views

ld can't find MKL library after adding it to ld.so.conf.d

I'm trying to link a a library, libmkl_rt.so, while compiling Julia in Fedora 30. The library is located in /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/. Running ld -...
  • 204
5 votes
3 answers
1k 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 ...
user avatar
0 votes
1 answer
501 views

Is loader for a particular "executable format" configurable in Linux?

This question is in continuation of How does compiler lay out code in memory, which is posted at stack-overflow. I have few questions with respect to ld (GNU) utility available in Linux. Whenever ...
17 votes
1 answer
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
0 answers
239 views

GNU Linker Colorization

Compiling code with GCC or Clang can result in some colorful error outputs. Linking code, however, doesn't enjoy the same luxury. It seems like the GNU Linker doesn't support colorized error output ...
  • 9
1 vote
1 answer
769 views

How to install libpq.so.4.x on Debian 9

I try to compil from source PHP5.3.29 on Debian 9. The make command stopped in error at this step LDFLAGS="-Wl,-rpath=/opt/OpenSSL/openssl-1.0.1u/lib,-rpath=/opt/CURL/curl-7.26.0/lib" make .../... (...
  • 1,410
2 votes
1 answer
361 views

Can’t run the ownCloud client on Linux Mint 19 Tara (Qt issues)

I have a problem running the ownCloud client on Linux Mint 19 Tara. It doesn’t start. If run from the command line, it gives me these errors: pavel@lenovo ~ $ owncloud owncloud: /usr/lib/x86_64-linux-...
  • 21
2 votes
2 answers
1k views

Different standards of ELF (SysV vs TIS) and Linux?

There are at least two standards of Executable and Linkable Format (ELF), one of them System V Application Binary Interface AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming ...