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.
Questions tagged [ld]
108 questions
77
votes
2 answers
Getting "Not found" message when running a 32-bit binary on a 64-bit system
I have currently a strange problem on debian (wheezy/amd64).
I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/.
To make things easy, I have initialized this chroot with a…
Elenaher
- 949
- 1
- 7
- 8
24
votes
4 answers
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 setting LD_LIBRARY_PATH?
In that case, the program…
nbubis
- 954
- 3
- 10
- 23
20
votes
3 answers
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
linux-vdso.so.1 => (0x00007ffcb6d99000)
…
C-Jay
- 311
- 1
- 2
- 5
19
votes
1 answer
Is it normal that LD_LIBRARY_PATH variable is missing from an environment?
I have found by coincidence that on my Debian Jessie there is no LD_LIBRARY_PATH variable (to be exact printenv | grep LD shows nothing related to linker and echo "$LD_LIBRARY_PATH" shows also nothing).
This is the case in x terminal emulator (which…
calavera.info
- 531
- 1
- 4
- 13
17
votes
1 answer
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 spawning my binary executable by executing the…
daedalus_hamlet
- 331
- 1
- 9
15
votes
1 answer
What is the default value of LD_LIBRARY_PATH?
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 LD_LIBRARY_PATH in that case.
What is that default…
Albert
- 639
- 2
- 5
- 17
15
votes
1 answer
Where to get "/etc/ld.so.nohwcap" file from?
When I run a command through strace utility I can see access errors such as
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
Now I've read somewhere that what's happening on the above line is that a linker is looking…
Shady Programmer
- 365
- 1
- 3
- 9
14
votes
1 answer
Difference between 'ld' and 'ld.so'?
While both are called "linker" and are used to link binaries, I can't really figure out how they differ from each other. Can anyone tell me their differences?
iBug
- 3,428
- 1
- 24
- 57
11
votes
3 answers
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 also other applications that rely on…
Alexander
- 9,607
- 3
- 40
- 59
10
votes
2 answers
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 things? I can see with readelf -h that one is…
Evan Carroll
- 28,578
- 45
- 164
- 290
10
votes
3 answers
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 attempt at compilation (gcc main.c) fails…
Anko - inactive in protest
- 4,506
- 2
- 29
- 57
9
votes
4 answers
Overwriting a running executable or .so
I have a question about overwriting a running executable, or overwriting a shared library (.so) file that's in use by one or more running programs.
Back in the day, for the obvious reasons, overwriting a running executable didn't work. There's even…
Steve Summit
- 507
- 3
- 12
7
votes
3 answers
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 my library into one of the standard search…
zlatonick
- 139
- 6
7
votes
1 answer
Fedora 27 /usr/bin/ld: cannot find -lstdc++
I have Fedora 27. I am building something from source. (It is https://github.com/xmrig/xmrig-nvidia if that matters).
Make gets to linking and then fails with this message:
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit…
Mikhail Ramendik
- 442
- 5
- 18
7
votes
2 answers
Is it OK to sort /etc/ld.so.conf
I am wondering if I can keep the entries in /etc/ld.so.conf sorted.
My ld.so.conf looks now like…
Peter VARGA
- 992
- 3
- 11
- 28