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
1 answer
94 views

Who is the original author of GNU ld?

Author information can be difficult to find for projects whose histories go back long before their git repositories. According to Wikipedia, Richard Stallman wrote gcc, and Dean Elsner wrote GNU as. ...
clarkep's user avatar
  • 109
0 votes
0 answers
129 views

I can't boot after upgrading glibc... how can I rebuild my ld.so cache?

Hello Unix StackExchange! I unfortunately made a huge mistake. I needed a newer version of glibc on my system for a screensharing application, so I ran the following commands to download and build ...
Anish G.'s user avatar
8 votes
2 answers
2k views

LD_PRELOAD does not work and LD_DEBUG shows nothing

I use LD_PRELOAD to overwrite the read function. For a minimal test application it works fine, but if I test it with a larger application it does not work anymore. Also LD_DEBUG=all does not show ...
Kevin Meier's user avatar
0 votes
0 answers
213 views

ld error with clangs when compiling vdso

i am trying to compile a kernel but it always return this error: LD arch/arm64/kernel/vdso/built-in.o ld.lld: error: cannot find linker script -r make[2]: *** [scripts/Makefile.build:507: arch/...
xxjoe's user avatar
  • 11
1 vote
0 answers
101 views

Behavior of running ldconfig with a directory argument

I have installed some shared libraries to the non-standard directory /usr/lib64/mylib. Then I run sudo ldconfig /usr/lib64/mylib. I can assert by running ldconfig -p that my libraries are indeed ...
Nick's user avatar
  • 111
0 votes
2 answers
322 views

No rule to make target `scripts/extract-cert' when building Linux Kernel - Centos 7, devtoolset-9

I'm trying to debug my build environment for compiling a linux kernel with some patch sets. I installed devtoolset-9 in my CentOS 7 environment to satisfy the minimum gcc version requirement of the 5....
merlin's user avatar
  • 1
1 vote
1 answer
54 views

How to load android binaries in Debian environment?

I am trying to run adbd from within a chrooted environment. I can run it fine with Android's LD_LIBRARY_PATH=$PWD ./linker64 $PWD/adbd. When I try to run ./adbd I get: bash: ./adbd: cannot execute: ...
Bret Joseph's user avatar
1 vote
1 answer
720 views

How do I edit '/etc/ld.so.conf' in a yocto recipe?

As suggested by Zac Anger, i copy this question over here: I have a yocto recipe in which I copy/install some stuff to an image. After that, I want to add a line to the /etc/ld.so.conf file like this, ...
schande's user avatar
  • 115
0 votes
2 answers
900 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....
GearyZhang's user avatar
1 vote
2 answers
362 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/...
Mévatlavé Kraspek's user avatar
2 votes
1 answer
695 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 ...
kfank's user avatar
  • 21
0 votes
1 answer
153 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....
Evan Carroll's user avatar
  • 30.9k
0 votes
0 answers
58 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 ...
Stephen Boston's user avatar
0 votes
1 answer
518 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 ...
user2752471's user avatar
0 votes
0 answers
12k 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]: *** [...
thatbangaloreanguy's user avatar
3 votes
1 answer
2k 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 ...
Moutaineer of Mariana trench's user avatar
0 votes
1 answer
128 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/...
Flux's user avatar
  • 2,938
1 vote
1 answer
2k 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 ...
tl-photography.at's user avatar
1 vote
1 answer
278 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 ...
cipherdragon's user avatar
2 votes
3 answers
2k 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: /...
ingli's user avatar
  • 1,859
7 votes
3 answers
2k 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 ...
zlatonick's user avatar
  • 149
1 vote
1 answer
425 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 ...
mraron's user avatar
  • 113
1 vote
0 answers
122 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 ...
d9ngle's user avatar
  • 329
0 votes
0 answers
402 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 ...
Antonio Santoro's user avatar
1 vote
0 answers
234 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,...
senx's user avatar
  • 171
0 votes
1 answer
430 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 ...
TheEagle's user avatar
0 votes
0 answers
370 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 ...
placid chat's user avatar
0 votes
0 answers
461 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 ...
Abdul_Kuddus's user avatar
1 vote
2 answers
3k 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 -...
tuskiomi's user avatar
  • 127
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 ...
Paul Jurczak's user avatar
1 vote
0 answers
297 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 ...
fctorial's user avatar
  • 203
4 votes
1 answer
10k 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 ...
Chris Woelkers's user avatar
-1 votes
1 answer
212 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 ...
Mason M's user avatar
  • 33
3 votes
1 answer
2k 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 ...
schily's user avatar
  • 19.2k
1 vote
2 answers
4k views

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

Computer Systems: A Programmer's Perspective (3ed) says on 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: ...
Tim's user avatar
  • 102k
0 votes
1 answer
2k 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 ...
Tim's user avatar
  • 102k
0 votes
1 answer
2k 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-...
Bruce Adams's user avatar
1 vote
1 answer
89 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 ...
akabaka's user avatar
  • 13
4 votes
1 answer
2k 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 ...
marked-off-topic's user avatar
1 vote
2 answers
374 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 ...
Q Stollen's user avatar
3 votes
1 answer
605 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 /...
mark2's user avatar
  • 33
1 vote
1 answer
317 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, ...
swaggy p's user avatar
  • 111
0 votes
0 answers
4k 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 ...
troppapolvere's user avatar
0 votes
2 answers
829 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 -...
Jimmy Scionti's user avatar
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 ...
Thanos's user avatar
  • 435
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 '...
Gary Flermen's user avatar
1 vote
0 answers
245 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 -...
zaen's user avatar
  • 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
678 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 ...
karthiksatyanarayana's user avatar
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 ...
daedalus_hamlet's user avatar