Questions tagged [linker]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-6
votes
1answer
52 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 ...
-1
votes
1answer
49 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 ...
0
votes
1answer
45 views

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

below is my 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) ...
0
votes
1answer
40 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 ...
0
votes
1answer
23 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 ...
0
votes
0answers
32 views

Relocation - linker(compile time) and Loader(runtime)

My question is whether the loader has to redo the work of relocating if the linker script(at runtime)already does that? I have read that relocating loaders will relocate the addresses at runtime. What ...
0
votes
1answer
24 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=/...
0
votes
1answer
28 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 $ ...
1
vote
1answer
94 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 ...
0
votes
0answers
38 views

Trying to link Android shared object to native Linux program

I'm attempting to execute code directly from an unmodified Android shared object that has been compiled for i686. My executing environment is a native Linux x86_64. I have trouble linking everything ...
0
votes
1answer
121 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/...
0
votes
0answers
38 views

Is the purpose of symbolic links to shared libraries in /usr/lib64 to satisfy -l linker filename requirements?

My /usr/lib64 directory contains the following files (among others): $ ll /usr/lib64/libboost_file* /usr/lib64/libboost_filesystem.so.1.69.0 /usr/lib64/libboost_filesystem.so -> ...
1
vote
1answer
249 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 ...
0
votes
0answers
22 views

Library uses default libraries instead of news ones

I have seen multiple questions about this but didn't see an answer that matched me. I have a library that requires other libraries. I have used patchelf to change which libraries should be looked at. ...
0
votes
0answers
29 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?
1
vote
0answers
165 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 ...
1
vote
0answers
78 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, ...
26
votes
4answers
6k 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 ...
2
votes
1answer
91 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 ...
2
votes
1answer
62 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 ...
1
vote
0answers
83 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 ...
3
votes
3answers
761 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, ...
4
votes
1answer
309 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 ...
-5
votes
2answers
215 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 ...
-1
votes
1answer
476 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(...
2
votes
1answer
3k 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"
1
vote
1answer
487 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 ...
0
votes
2answers
1k 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 ...
1
vote
1answer
988 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 ...
1
vote
1answer
854 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-...
2
votes
1answer
741 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 ...
0
votes
2answers
3k 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 ...
2
votes
1answer
239 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 ...
3
votes
1answer
3k 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 ...
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@...
0
votes
1answer
113 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 ...
10
votes
1answer
2k 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 ...
0
votes
2answers
306 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: ...
2
votes
0answers
667 views

libtool: error: relink 'libpocketsphinx.la' with the above command before installing it

When I trying to install pocketsphinx by make install command(after ./autogen.sh , ./configure, make commands) , I get this error message: libtool: error: relink 'libpocketsphinx.la' with the above ...
2
votes
2answers
1k views

Extracting the size and origin of all symbols in an ELF

I am trying to estimate the code size of a binary's various components. I have access to the source code and resulting build directory containing all built object files. Of course, I want to include ...
1
vote
2answers
948 views

What do compile and link line refer to?

While installing the cudnn library, I came across this in the INSTALL.txt file: Add [installpath] to your build and link process by adding -I[installpath] to your compile line and -L[...
2
votes
1answer
637 views

GNU linker producing useless spacing between sections in ELF file

My intent is to place the text section at a specific location in memory (0x00100000). SECTIONS { . = 0x00100000; .text : { *(.text*) } } Although the linker does do ...
2
votes
0answers
357 views

cannot find -lm linker error

This question is highly related to cannot find -lm, but the error appears when I'm invoking cross G++ Linker. I'm trying to follow through the documentation provided by Using Eclipse with ARTIK SDK. ...
9
votes
1answer
3k views

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?
3
votes
1answer
9k views

How to link OpenSSL library in macOS using gcc?

I have OpenSSL installed through the Homebrew package manager. I have found the library and header files I need. The headers are: /usr/local/Cellar/openssl/1.0.2h_1/include/openssl /usr/local/...
1
vote
1answer
1k views

How to get the REAL gcc (not the one that is hashed to clang) in MacOS?

I am trying to compile a program that uses the OpenSSL library. I had a problem where it couldn't find the header files. I fixed this problem by adding the option -I /usr/local/opt/openssl/include ...
1
vote
1answer
57 views

How strong is the promise that .so.x.y.z will exist?

I have an application that requires OpenCV 2.4.11 to link, so in my make file I ensure I use the following linker flag pattern: -l:libopencv_core.so.2.4.11 How robust is this assumption? My ...
1
vote
1answer
936 views

Unable to compile vapoursynth: failed to link zimg [closed]

I'm trying to compile vapoursynth and have run into a linker issue which I don't understand how to solve. Here is what I have so far: I have compiled zimg from github github: buaazp/zimg and have ...
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 =&...
0
votes
0answers
1k views

Where are the definitions for the prototype declarations in <bsd/stdlib.h>?

I have a C program on Ubuntu 16.04, in which I would like to use arc4random_uniform. typedef unsigned char u_char; #include <bsd/stdlib.h> int main () { return (int) arc4random_uniform(100); } ...