Questions tagged [linker]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

Calculation of relocation address; ELF

I am learning about the relocation from the ELF reference and this blog, but I can't get my head around calculating the relocation address. Suppose we have two files A and B of type ET_REL, we want ...
Question's user avatar
1 vote
0 answers
98 views

Runtime library search order on AIX

If I understand correctly, the variables LIBPATH and LD_LIBRARY_PATH have a higher priority than the argument to the linker -blibpath. I'm looking for how to tell the loader to search for libraries ...
ibse's user avatar
  • 295
0 votes
0 answers
41 views

cc linker error

I'm writing a C application based on GTKlibrary on Debian 12. The program is build by a Makefile, generated from cmake. The compile phase of the source files is correct but when the linker is fired I ...
SteMMo's user avatar
  • 197
1 vote
1 answer
55 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
0 votes
0 answers
192 views

Why do I have to put -Wl,--dynamic-linker flag if it points to same location

Yes, I know about this question but this is not a duplicate. I try to run my app in an older system where glibc 2.12 is installed. What I need is glibc 2.19 and I have installed it and I give its ...
Mert Mertce's user avatar
0 votes
1 answer
520 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
4 votes
1 answer
2k views

Existing .so file cannot be loaded even though it exists, seems to depend on Docker host OS

I have built Qt6 in an Alma8 based Docker container, with the Docker host being Fedora 35. Under some circumstances (described below), all Qt libs cannot load libQt6Core.so[.6[.2.4]]. But that file ...
Stefan Scherfke's user avatar
0 votes
1 answer
540 views

How to get meson to use a library in a different lib directory?

I have two versions of a library, zita-convolver3 and zita-convolver4. The system library is zita-convolver3, but i want to link against zita-convolver4, which is stored in a local user directory. How ...
placid chat's user avatar
0 votes
1 answer
3k views

How does RAM get divided into Kernel Space and User Space

I understand that with Linux, RAM gets divided into kernel space and user space. Kernel space is reserved for running the kernel, and user space applications should not have direct access to the ...
Engineer999's user avatar
  • 1,151
0 votes
1 answer
680 views

Linker unable to find header and library files

I've installed the CHERI simulator from this link. It allows me to use the clang compiler for both risc-v and a capability extended risc-v architecture. I've defined the following aliases alias clang-...
Sathvik Swaminathan's user avatar
0 votes
0 answers
1k views

Usage of objcopy / elfedit to patchelf symbol (versions) in elf file

The context is as follows: on my o.s. there is (already) liba.so.v2 of "liba" which contains the string 'symbol_version-2' as the symbol version for its functions , e.g. functionX@version-2 ...
cg79's user avatar
  • 11
0 votes
1 answer
431 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
1 answer
228 views

FreeBSD - problem with linking protobuf

I have a small application that was tested on Linux and it worked. Now I would like to build the same code on FreeBSD. To build it on FreeBSD I needed to change a little my Makefile. Here is my ...
tomi7654's user avatar
0 votes
0 answers
373 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
1 answer
1k views

Can't compile any c/ c++ program, linker problem

It's my second post here, i have a huge problem which prevents me to study so i have to fix it as soon as it's possible ! My gcc was working fine and i had to work on FairThreads (in C). I downloaded ...
Amine Benslimane's user avatar
2 votes
1 answer
1k views

LD_PRELOAD and the dynamic linker

So I have been reading about the preload feature of the dynamic liner (dl) and how it can be used to load a user specified, shared library (.so) using the LD_PRELOAD env variable, before all other ...
cyzczy's user avatar
  • 366
-5 votes
1 answer
369 views

Does the existence of linker and loader not depend on operating systems such as Linux?

Does the existence of linker (for performing linking following compilation) and loader (for executing an executable file) not depend on operating systems such as Linux? (I had though of linker and ...
Tim's user avatar
  • 102k
0 votes
1 answer
1k views

Does _start call my program's main function and other essential setup functions? [closed]

I'm reading a textbook which describes how loader works: When the loader runs, it copies chunks of the executable object file into the code and data segments. Next, the loader jumps to the program’s ...
amjad's user avatar
  • 157
2 votes
1 answer
4k views

Why the dynamic linker couldn't resolve reference when a shared library has a dependency on other share library?

Code: //a.c I don't use header files as this is just for demo purpose. extern void function_b(int num); void function_a(int num) { function_b(num) } //b.c void function_b(int num) { ... } //...
slowjams's user avatar
  • 259
0 votes
1 answer
723 views

why static libraries use relocatable object files while share libraries use source file?

I was reading a textbook which describes static libraries anad shared libraries. There are two source files, addvec.c and multvec.c, to create a static library of them, we would use the ar tool as ...
amjad's user avatar
  • 157
1 vote
1 answer
367 views

What Centos package contains the libraries for -lSM -lICE linker options?

Apologies if this has already been answered; I am having trouble finding an existing post (either on SE or linux forums) which solves the issue. I need to install the package(s) that enables the -lSM ...
asdf's user avatar
  • 13
0 votes
1 answer
379 views

Can't run sudo after deleting libpcre2

I manually compiled libpcre2 with debug symbols into /usr/local/lib and then deleted the version installed in /lib64. While I can still run commands as my user by first running export LD_LIBRARY_PATH=/...
Johannes Riecken's user avatar
0 votes
1 answer
297 views

How to make path to current directory visible in bash, in order to be seen by linker?

I am trying to load shared library, but I dont have its .so file in directory loader look for, So I want to set a environment dir. $ ls # (current dir is bindir) foo.c foo.h libfoo.so exe $ ...
Herdsman's user avatar
  • 340
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
1 answer
2k views

ld ignores ld.so.conf

This is my /etc/ld.so.conf /usr/local/lib64 /usr/local/lib include /etc/ld.so.conf.d/*.conf The directory /etc/ld.so.conf.d/ contains mysql-x86_64.conf which contains only this one line: /usr/lib64/...
Peter VARGA's user avatar
  • 1,012
1 vote
1 answer
2k views

ld cannot find library right in front of it

I'm trying to build a rust program that involves diesel with postgresql on Fedora 31 and the build fails because the linker can't find libpq. As it's reproducible with gcc, I'm using gcc to keep the ...
rudib's user avatar
  • 1,602
0 votes
0 answers
71 views

Use of a user defined section name [ __attribute__((section("name")) ]

I do have some doubts about __attribute__((section("name")) .What is the real use of defining a user defined .section? Is there any examples to shows how it is useful?
Franc's user avatar
  • 289
3 votes
1 answer
1k views

Recover static library from executable

I have an existing executable for which a small amount of source code has been lost. In particular, the executable uses a few functions from a static library, and the source code for that library is ...
maldata's user avatar
  • 155
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
32 votes
4 answers
14k 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 ...
placid chat's user avatar
4 votes
1 answer
690 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 ...
Shuzheng's user avatar
  • 4,431
3 votes
1 answer
334 views

Annotating any files

I have had this problem for a very long time, had several discussions with friends, and tried searching relating info online. All efforts were in vain so I decide to give a shot here. I have lots of ...
Student's user avatar
  • 453
1 vote
1 answer
331 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 ...
nmd's user avatar
  • 19
4 votes
4 answers
3k views

Embedding binary data into an executable using LLVM tools

In the past I have embedded resource files (images) into programs by first converting them to .o files using the GNU linker. For example: ld -r -b binary -o file.o file.svg Starting with FreeBSD 12, ...
Richard Smith's user avatar
4 votes
1 answer
1k views

Placed library in /usr/lib, but ldconfig doesn't put it in cache

I'm starting a project that requires an external shared library third-party.so. I've placed it in /usr/lib. However, when I run sudo ldconfig -v, it's not listed. ldconfig -p | grep third-party.so ...
user44168's user avatar
  • 151
-5 votes
2 answers
266 views

BUG in clang linker - name resolving issue

I found bug in clang, and i post it here because it's very difficult to find how to do it in clang system. I think this information in useful - i saw similar questions in web. So, clang makes wrong ...
Mikola Akbal's user avatar
2 votes
1 answer
2k 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(...
Tim's user avatar
  • 102k
2 votes
1 answer
7k views

GNU Linker differences between the different 32bit emulation modes?

What is the difference between the 386 and 32 bit options in ld -V? elf32_x86_64 elf_i386 i386linux i386pep i386pe And, where can I find the documentation on these "emulation modes"
Evan Carroll's user avatar
  • 30.9k
1 vote
1 answer
2k views

Manually linking shared object files

I've been diving into dependency hell on an embedded Yocto Linux project recently in an attempt to compile and install a large project. I frequently run into an error while installing the dependencies ...
Dan Laks's user avatar
  • 351
0 votes
2 answers
4k views

Creating a link to a shared library

I have a library ( ZendDebugger.so ) which in turn requires the openssl library but it doesn't find a reference to it. Indeed when ZendDebugger.so loads, it prints this error on the error log ( which ...
HelloWorld's user avatar
1 vote
1 answer
3k views

Difference between the linker flags

I'm adding c++ runtime and exception support to the Linux kernel. For that, I need to provide my own lib/gcc and lib/libstdc++instead of the standard libraries provided by the compiler. So, I am ...
kjsr7's user avatar
  • 123
5 votes
1 answer
2k views

Is ld.so an executable?

$ file /lib/ld-linux.so.2 /lib/ld-linux.so.2: symbolic link to i386-linux-gnu/ld-2.27.so $ readlink -f /lib/ld-linux.so.2 /lib/i386-linux-gnu/ld-2.27.so $ file /lib/i386-linux-gnu/ld-2.27.so /lib/i386-...
Tim's user avatar
  • 102k
5 votes
1 answer
1k 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 ...
Cloud's user avatar
  • 272
0 votes
2 answers
5k views

Compile Git to use OpenSSL library libssl.so.1.0.1

Running a system that only has full support for OpenSSL version 0.9.8. Installed in parallel is OpenSSL 1.0.1 libraries (Supported by Distro) Git still preferentially uses the 0.9.8 libraries but we ...
Bee Min's user avatar
  • 75
2 votes
1 answer
523 views

What is the difference between the runtime linker (ld.so) and the prelink program?

What is the difference between the runtime linker (ld.so) and the prelink program? I know the runtime linker (ld.so) loads all the dynamic libraries needed for a program but what is the benefit of ...
N Randhawa's user avatar
6 votes
1 answer
7k views

Symbol table in the .data section of ELF

I'm trying to understand how does symbol tables relate to the .data section in ELF. First some assumptions that I'm using as ground to start with. A symbol is a human readable (or "as written in ...
TheMeaningfulEngineer's user avatar
6 votes
1 answer
3k 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@...
senthil ramamurthy's user avatar
0 votes
1 answer
180 views

Determine when the platform offers LD_LIBRARY_PATH?

I want to detect when the platform offers LD_LIBRARY_PATH to load libraries from an arbitrary location. The application is a lightweight shell script, so I am looking for a method that does not ...
user avatar
15 votes
1 answer
4k views

Linker script in .so file? (libc.so) Is that right?

I am currently trying to get python to run on my NAS which is a Zyxel NSA325. I did manage to get python 2.7 and pip running and I was able to successfully install the watchdog module with pip. I ...
Forivin's user avatar
  • 857
0 votes
2 answers
665 views

How to link libraries without root permissions

I am trying to compile OpenMPI without root permissions on my local account in a cluster, but I have the following error. /usr/bin/ld: cannot find -libcm /usr/bin/ld: cannot find -lnuma /usr/bin/ld: ...
Pablor's user avatar
  • 175