Questions tagged [dynamic-linking]
Dynamic linking is a system which allows libraries to remain separate from programs until loaded, contrast static linking.
1,615
questions
0
votes
0
answers
16
views
How to get XCode preview working in KMP with FirebaseFirestore using CocoaPods?
I am trying to build Xcode preview in kotlin multiplatform project when using FirebaseFirestore with CocoaPods.
With the following gradle files everything works fine, app runs & preview runs.
...
-1
votes
0
answers
25
views
Problems when relocating certain symbols of dynamic ELF file
I have created an ELF loader that maps all of the LOAD segments into memory, then maps the interpreter specified in the INTERP program header, and calls it.
It works fine but now I am trying instead ...
1
vote
1
answer
16
views
Dynamically openssl liked C++ application failing with error "version `OPENSSL_1_1_1' not found"
I have build my C++ application by dynamically linking the openssl library on SLES15 machine with openssl version OpenSSL 1.1.1d and running the application on SLES15SP1 with openssl version OpenSSL 1....
-1
votes
0
answers
40
views
Catchpoint inside gdb does not break at syscall call
I'm debugging a simple "Hello World" on Linux 4.15 & gcc 7.5.0 built as gcc main.c -o main
I want to catch the syscall to execve() to load the ELF executable into process' virtual ...
0
votes
1
answer
69
views
Statically linked executable with dynamic loading
I'm not sure if it makes sense or not, but is it possible to have a statically linked executable + dynamic loading ?
In other words: at compile/linking time an object code is statically linked against ...
-1
votes
1
answer
93
views
Executable doesn't see Vulkan dynamic lib and throws an linker-error LNK2019
I wanted to write an application in C++/Vulkan without requiring the pre-installed VulkanSDK.
So, I have added through "git submodule" vulkan-headers repo, copy VulkanRT to binaries-...
0
votes
0
answers
20
views
I want to print hello before CoreFoundation.dylib loads in ios
I want to print hello before CoreFoundation.dylib loads in ios build process. For instance if you create a new ios application and remove all the files and add main.c inside which you print helloworld ...
2
votes
1
answer
65
views
Can the Xcode linker deduplicate symbols in a merged binary?
Intro
I'm trying to determine whether Xcode's new Mergeable Libraries feature can remove duplicated symbols in a scenario where an app links to two dynamic frameworks which both link to the same ...
1
vote
1
answer
151
views
What does C++ standard say about dynamic libraries?
What does C++ standard say about dynamic libraries? I heard that it completely ignores them (for some reason) - if it's true, why so?
2
votes
0
answers
56
views
Is "extern C" code allowed to throw exceptions? [duplicate]
In a project, we have C++ core code which loads C++ libraries dynamically. Loading those libraries works with QLibrary::resolve, which, however, requires the to-be-resolved functions to "be ...
1
vote
1
answer
53
views
How to make/build project against one version of a library but its dependencies against a different version of that library?
I have workspace structure as shown below. It involves PROJ for project, TPL for third party library and DEP-PROJ for dependency project (and ws for workspace). I have also specified their ...
1
vote
0
answers
37
views
What's the best minimal ELF dynamic linker / loader? [closed]
I'm searching for a great example of an ELF linker / loader that can start-up "most" processes.
The goal should be on code clarity and not so much on completeness.
I found a few on GitHub ...
2
votes
0
answers
51
views
Confusion about LINK_WHAT_YOU_USE and Meson's counterpart b_asneeded
From what I gather when Meson performs linking of ELF binaries it trims unneeded shared libraries by default by passing --as-needed flag to the linker. This answer says that the flag makes linker to ...
0
votes
0
answers
66
views
libstdc++ both statically and dynamically linked through different libraries
My executable dynamically links two libraries (d1.so and d2.so).
d1.so statically links to libstdc++.
d2.so dynamically links to libstdc++.
Assuming d1.so is loaded first, which stdlib (dynamic or ...
2
votes
1
answer
112
views
Is it possible to build a dynamic framework without the symbols of a static library that it links to?
I have an app that links to two dynamic frameworks which both link to the same static library, as follows:
|--App
|--DynamicFramework1
|--StaticLibrary
|--DynamicFramework2
|...
0
votes
0
answers
31
views
Why the term "memory" instead of "RAM" is used in context of loading libraries?
I am a bit confused, most articles say that programs and libraries are loaded into "memory" or "main memory". I don't fully understand what "main memory" is. I thought it ...
0
votes
0
answers
44
views
How to link OpenSSL 3.x with Qt in Windows?
Qt 6.2 (and 6.5) both link to "Windows secure channel" by default. For us this version is not workable as it fails a few socket connections, which otherwise used to work with 1.1.1t etc.
...
0
votes
0
answers
20
views
RUNPATH is disappearing from search path after some libs are found [duplicate]
I'm compiling a software with CMake and GCC under Ubuntu 18.
Here's the relevant CMake line:
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/")
setting the runpath relative to the origin.
Once ...
5
votes
1
answer
82
views
Why is the `jmp` at the start of the PLT stub needed?
The way PLT usage is specified in the SystemV ABI (and implemented in practice), is schematically somtehing like this:
# A call from somewhere in code is into a PLT slot
# (In reality not a direct ...
1
vote
1
answer
50
views
ImportError: undefined symbol when linking pybind11 with a static/shared library
I tried to link pybind11 with a static library. The building process was successful, but I got the runtime error "ImportError: undefined symbol". Directly linking with .o file worked fine ...
0
votes
3
answers
155
views
Better error message if dynamic linking fails
I get this error if dynamic linking fails:
/ # /manager
/bin/sh: /manager: not found
For the average user this is very confusing, because /manager exists.
Now, after searching for some hours, I found ...
0
votes
0
answers
21
views
How can I convert/compile a Python script into an e executable with no _Python_ dependencies?
I've read this question:
How can I make a Python script standalone executable to run without ANY dependency?
and some (or all?) of the options there work. But - I don't care about removing all ...
0
votes
1
answer
11
views
Can I un-dynamicize a linked executable given a dynamic library?
Suppose I have a dynamically-linked executable which depends on symbols in libfoo and libbar; and that it works on my system, i.e. it finds appropriate versions of these shared libraries. Now, I want ...
3
votes
0
answers
149
views
Rust-to-rust dynamic linking equivalent of a C header (library interface)
In Rust, there are two types of dynamic libraries supported.
cdylib - that creates a "C interface" (kind of like extern "C" in C++), to be used by C or anything that can use C FFI....
1
vote
2
answers
44
views
What are the scoping rules for subsequent calls to dlopen?
Suppose I have an executable that dlopens libfirst.so with RTLD_LOCAL which then dlopens libsecond.so with RTLD_GLOBAL. Should the symbols from libsecond.so now be directly available (i.e., without ...
0
votes
1
answer
57
views
How do i load symbols & variables into a DLL File from the main process thats using the same header files? (-rdynamic on linux basically)
First of all, I'm not very experienced with DLL Files so sorry if this seems like such a beginner question.
On linux, you can compile a shared library with -rdynamic flag that makes the symbols from ...
0
votes
1
answer
59
views
How to dynamically choose between 2 versions of a library?
I work on a C++ cross-platform project compiled with CMake and use an external library. This library has some issues in an old version, but a disjointed set of issues in a new version. The versions ...
0
votes
0
answers
19
views
g++: undefined reference to function while linking custom dynamic library [duplicate]
This is the error I'm getting while linking a shared object(which I created) to my main.cpp
$ g++ -Iinclude -L`pwd`/bin -lcppops -Wl,-rpath,`pwd`/bin main.cpp -o bin/out
/usr/bin/ld: /tmp/ccXHFLyv.o: ...
1
vote
1
answer
28
views
qmake: detect whether the kit uses a static or dynamic Qt version
Is there a way to check whether the active kit uses a static or dynamic Qt build? Something like this:
contains(SOME_QMAKE_VARIABLE, STATIC_QT_BUILD) {
message("static build detected!")
}
0
votes
1
answer
41
views
Why does dynamic linking work when I use -lc with my.s?
If I compile the below with gcc -g a.c -lz -o normal and execute it on my debian server, it complains with
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./normal)
...
0
votes
1
answer
71
views
Why does MinGW compiler/linker requires runtime library path to be properly set up?
I'm building a CMake project in Windows, using MSYS2/MinGW and VSCode, which includes both libraries and executables that link to them.
There no issues while building, however when attempting to run ...
2
votes
0
answers
99
views
How to cross compile a Go program for an ARM device passing it a custom dynamic C library to link against?
I am facing difficulties while attempting to cross compile a Go program for an ARM device that involves NFC communication. The code I am working with is essentially the same as the one provided in ...
0
votes
1
answer
65
views
Both main program and dlopen'ed library need different versions of libsqlite3.so
I have a main program that depends on libsqlite3.so. By running it with LD_DEBUG=libs ./my_executable, I observe the following (I edited the search paths to look simpler):
386600: find library=...
0
votes
0
answers
28
views
Overriding Xcode setting
I have my project that contains a binary executable and a couple of dylibs.
In Xcode there is an option called Dynamic Library Install Name and Dynamic Library Install Name Base.
Right now they point ...
3
votes
1
answer
114
views
Is the ELF Section Header Table necessary for Dynamically Linked ELF file?
I have been reading about loading and linking over the past couple days, and I have read countless times that the Section Header in an ELF file is not necessary for an executable. I understand how ...
0
votes
1
answer
73
views
Unexpected memory usage behaviour when using static linking in C
I am studying static linking and dynamic linking, and my understanding is that static linking consumes more memory and disk space compared to dynamic linking. It is evident that static linking ...
0
votes
1
answer
65
views
Is it possible to link to a dynamic library that may have one of a few possible names or paths so that at runtime it'll use any one of those paths?
I'm working on a Qt plugin for macOS. I want it to be as easy to integrate and use as possible, both for developers and end users. To that end, I want to provide compiled versions of it for different ...
0
votes
2
answers
54
views
Create separate import lib with a subset of a .dll/.so's exports for third-party users (Visual C++, gcc)
For my project, a number of users have requested a way to access certain portions of the DLLs it creates. I'd like to build an API for them with header files and a .lib (or Linux equivalent, for the ...
1
vote
1
answer
128
views
What is the meaning of the '=>' symbol in the output of 'ldd' command in Linux linker?
when I run 'ldd some_executable_file', it shows dependencies required by this exe, like "libm.so.6 => /usr/lib64/libm.so.6 (0x00007ff2eaf52000)".
while some dependencies in the list ...
1
vote
0
answers
297
views
Sharing dynamic links from React Native app using Firebase or Branch.io results in redirection to App Store on iOS real devices even if app installed
I have implemented Firebase Dynamic Links in my React Native app, following all the configuration steps provided in the official Firebase documentation. The dynamic links are functioning correctly on ...
0
votes
1
answer
79
views
How can I avoid target name clashes when add_subdirectory()ing both the mainstream and a fork of a repository?
For a good reason, I am attempting to use add_subdirectory() on both a fork of a repository and the mainstream repository, and both add_library() a library with the same name.
I will only privately ...
0
votes
0
answers
120
views
valgrind reports leaks in boost test framework with no tests
I am using the latest apt packages on Ubuntu 18.04.6:
Boost 1.65.1
valgrind-3.13.0
Here is the test file; it intentionally doesn't include any tests:
// temp.cpp
#define BOOST_TEST_MODULE ...
1
vote
0
answers
143
views
How does linking shared libraries and indirect shared libraries work? What if a library is both a direct and indirect dependency?
I have the following scenario:
foo is directly dependent on bar, and bar is dependent on baz.
foo has a RPATH of $ORIGIN/lib, where bar.so and baz.so are in.
bar has a RUNPATH of /some/unimportant/dir/...
0
votes
0
answers
53
views
creating c++ dll which depends on another c++ dll
I have the following setup.
file1.h, folder1, file1.so,
file2.h, file2.cpp
In my visual studio:
Library directory paths I give: folder1 (which contains file1.so)
Now I create a dll using file2.cpp ...
1
vote
1
answer
225
views
Segfault when using dynamic loading with libssl.so
I am trying to dynamically load libssl.so using the code
typedef int (*SSL_library_init_t)(void);
typedef void (*SSL_load_error_strings_t)(void);
int main()
{
SSL_library_init_t SSL_library_init;
...
0
votes
1
answer
78
views
What is the consideration behind making RTLD_DI_SERINFOSIZE request twice?
From my understanding of the use of RTLD_DI_SERINFO in dlinfo, the first call gives dls_size value that helps ensure the struct is large enough, but the second call is seemly doing nothing new but ...
1
vote
1
answer
53
views
Can't debug GOT table lazy resolution; entry already resolved before the first call
I have a small program using a dynamic library and I want to follow the GOT resolution. I reach the following lines when calling _print_string. Now, The first line should be first set to the next one ...
0
votes
0
answers
25
views
Can framework contains static library be linked dynamically?
I am new to iOS development and forgive me if I asked a stupid question.
Can you create a framework with static library(.a) set the framework to be dynamic?
I understand you can put dynamic library(....
1
vote
1
answer
2k
views
How to address crash due to missing libdl.so on Ubuntu 22?
Applications crashing on Ubuntu 22
user@machine:~$ myapp
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies. In order to help ...
0
votes
1
answer
558
views
Building ffmpeg libraries for third party usage
I am trying to create bindings for FFmpeg in Elixir programming language and would love to handle FFmpeg binaries for users of my library.
The whole flow is as follows:
Write some function definition ...