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
0answers
21 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
0answers
8 views

Including only .text section with GNU Linker

I'm using it to generate a plain binary from an ELF : ld --oformat binary a.out -o bin But it does include all its sections, and I want only .text section to be stored. How can I do that ?
4
votes
1answer
1k views

undefined reference, even when the linked library does exist

I'm trying to compile VTK from source and I received the following error. I'm running Fedora 27, kernel version 4.14.11-300.fc27.x86_64 /usr/lib64/libSM.so: undefined reference to `uuid_generate@...
20
votes
4answers
44k views

Find out if library is in path

Assuming I want to test if a library is installed and usable by a program. I can use ldconfig -p | grep mylib to find out if it's installed on the system. but what if the library is only known via ...
0
votes
2answers
32 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 -...
0
votes
1answer
2k views

Force linker to find stdc++ library in non-standard directory

I've read a lot of guidance that says the LD_LIBRARY_PATH is searched before anything else, but one of my .so libraries is linking with libtdc++.so.6 in /usr/lib64. ldd mylib.so: ... libstdc++.so.6 =&...
2
votes
1answer
4k views

How to Resolve undefined reference to 'RAND_egd'

Debian 8 Jessie, OpenSSL version 1.1.0, cURL version: 7.50.2 I am trying to build curl on a Linux Debian system. All stages go well up until trying to build with make command. The linking stage fails ...
1
vote
0answers
42 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 ...
0
votes
0answers
74 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
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
480 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
1answer
58 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 ...
1
vote
0answers
109 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 ...
-4
votes
2answers
270 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
84 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
361 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-...
0
votes
0answers
27 views

Why xdg-open can't load lib from LD_PRELOAD from .desktop?

I has /usr/share/applications/wfica.desktop, which contains: Exec=env LD_PRELOAD="/lib64/libcrypto.so.1.0.2o" /opt/Citrix/ICAClient/wfica -icaroot /opt/Citrix/ICAClient %f When I run that ...
0
votes
0answers
32 views

vlc's so not found (ld -laxvlc -llibvlc -llibvlccore -lnpvlc) not found

I am trying to build a Qt web app, but it is giving me linking error for certain VLC libraries /usr/bin/ld: cannot find -laxvlc /usr/bin/ld: cannot find -llibvlc /usr/bin/ld: cannot find -llibvlccore /...
1
vote
1answer
39 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 ...
6
votes
3answers
6k views

How can I find out what linker flags are needed to use a given C library function?

Running example C code is a painful exercise unless it comes with a makefile. I often find myself with a C file containing code that supposedly does something very cool, but for which a first basic ...
0
votes
0answers
82 views

ld :cannot find -l<something>, but ld -l<something> --verbose finds it

I am trying to build a qmake project. In the .pro file I specify -lhello. It exists in /usr/lib/x86_64-linux-gnu and I have added the associated -L flag to specify its location. I am still getting ...
1
vote
1answer
256 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 ...
5
votes
2answers
1k views

stdbuf supposed behavior for subprocesses

I didn't exactly find something about the following in the man-page. How is the supposed behavior in subprocesses spawned by a process which was itself spawned by stdbuf? E.g.: stdbuf -oL myprog ...
13
votes
1answer
39k views

What is the default value of LD_LIBRARY_PATH? [duplicate]

In my case, it seems as if LD_LIBRARY_PATH is set to the empty string. But all standard system tools still work fine, so I guess the dynamic linker checks for that case and uses some default for ...
1
vote
2answers
37 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
1answer
219 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 /...
9
votes
3answers
1k views

Making a process read a different file for the same filename

I have an application that reads a file. Let's call it processname and the file ~/.configuration. When processname runs it always reads ~/.configuration and can't be configured differently. There are ...
3
votes
1answer
2k views

Automatically start an application with a modifed LD_PRELOAD?

I have an application that needs a modified LD_PRELOAD. I want to start the application using the originally provided rc script, so I can benefit from an automatically updated rc script on an update ...
1
vote
1answer
723 views

Failed make when installing madplay source

I am attempting to get madplay installed on my shared host I've run: ./configure --prefix=$HOME CPPFLAGS="-I /home/dir/include" LDFLAGS="-L /home/dir/lib" and then "make", but on that on run into ...
1
vote
1answer
1k views

configure: error: LDFLAGS

I am trying to install LTTng. I was installing lttng-tools-2.6.0 and got the following error: configure: error: Cannot find libuuid uuid_generate nor libc uuid_create. Use LDFLAGS=-Ldir to specify ...
4
votes
3answers
713 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
95 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, ...
0
votes
0answers
1k 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
2answers
228 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
1answer
446 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 ...
3
votes
3answers
740 views

redirect application listening on localhost to listening on external interface / alternative to bindp ( libindp.so )

imagine a server application that listens on localhost only, that has no settings to listen on other interfaces one wants to force make it listen on other interfaces such as eth0 bindp (libindp.so) ...
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 '...
1
vote
0answers
96 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 -...
14
votes
3answers
63k views

ldd does not find path, How to add

I know this question isn't very new but it seems as if I didn't be able to fix my problem on myself. ldd generate the following output u123@PC-Ubuntu:~$ ldd /home/u123/Programme/TestPr/Debug/TestPr ...
0
votes
1answer
159 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 ...
9
votes
2answers
7k views

What is the difference between “LSB executable” (ET_EXEC) and “LSB shared object” (ET_DYN)?

With two files, one compiled and linked with gcc and the other manually with nasm and ld I get ELF 32-bit LSB shared object ... ELF 32-bit LSB executable ... What's the difference between these two ...
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 ...
2
votes
2answers
726 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 ...
2
votes
2answers
2k views

ldconfig cannot link to specific files

I installed ATLAS (with Netlib LAPACK) in a Docker image, and now every time I run ldconfig, I get the following errors: ldconfig: Can't link /usr/local/lib//usr/local/lib/libtatlas.so to libtatlas....
0
votes
0answers
103 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 ...
1
vote
1answer
466 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 .../... (...
2
votes
1answer
281 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-...
1
vote
1answer
7k views

How can I build my shared library (.so) so that symbols from a different shared library are also included? [closed]

My shared library libnew.so uses some symbols form an already built third-party shared library libold.so. I would like to build an executable binary file that should be only linked against libnew.so. ...
4
votes
1answer
955 views

How to prevent a process from writing to the systemd journal?

I am using a third party .NET Core application (a binary distribution used by a VS Code extension) that unfortunately has diagnostic logging enabled with no apparent way to disable it (I did already ...
0
votes
1answer
1k views

Linking with GCC doesn't detect -fPIC flag

I am trying to link some files. Here is my command: gcc -T linker.ld -o Stack\ Berry.bin -ffreestanding -O2 -nostlib kernel.o boot.o -fPIC -lgcc How ever, I get this error: /usr/bin/ld: boot.o: ...