dynamic-linking Questions

2

Solved

I'm experimenting with LD_PRELOAD/dlopen and faced a confusion regarding symbol lookup. Consider the following 2 libraries: libshar shared.h int sum(int a, int b); shared.c int sum(int a, i...
Combatant asked 20/9, 2019 at 12:29

1

Solved

I have two plugins pluginA.plugin and pluginB.plugin which are both depend on same library libC.dylib. When plugins are built, I recursively go over dynamic dependencies (use otool -L), copy all de...
Mcdaniel asked 18/7, 2019 at 22:47

2

I have the following scenario in MSVC2017: A static library with the function bool foo() A dynamic link library that links to the static library above An application that loads the dynamic link l...
Bellbella asked 27/5, 2019 at 18:28

3

I'm trying to understand the correct way, or right approach, to provide a reasonably large C++ API for a non-open source project. I do not want to provide a "header only" library as the code base i...
Juieta asked 25/6, 2019 at 9:47

1

Solved

TL;DR Why do variables defined in a shared library seem to reside in segments defined in the main program and not the shared library? I am trying to understand ELF file dynamic linking. I wrote a ...
Sputum asked 3/6, 2019 at 16:1

4

Solved

I have two executables, both cross compiled to run in Android. I have put both on the device in the same directory. I have put all the shared libraries that they are dependent on in the same direct...
Jerrylee asked 21/11, 2012 at 21:12

1

Solved

The following program: #include <stdio.h> int main(int argc, char *argv[]) { for (int j = 0; j < argc; j++) printf("%d: %s\n", j, argv[j]); return 0; } built into a statically linke...
Billet asked 14/4, 2019 at 20:10

2

Solved

Consider the following simple shared library source code: library.cpp: static int global = 10; int foo() { return global; } Compiled with -fPIC option in clang, it results in this object asse...
Uprear asked 9/4, 2019 at 7:31

1

Solved

My main.rs looks like // #[link(name = "lib")] extern "C" { fn hello(); } fn main() { unsafe { hello(); } } And lib.rs: #[no_mangle] pub fn hello() { println!("Hello, World!"); } I have...
Tigges asked 5/4, 2019 at 14:24

2

I am trying to compile a program using a self-compiled GCC-4.7.1 on Mac OS 10.8.2. The program uses openMP and the compilation succeeds; however, when I try to run the program, the dynamic linker c...
Ullage asked 16/11, 2012 at 10:30

2

Solved

I recently encountered this problem after an upgrade of the system: using the GCC -Wl,-rpath= option works differently than before. I used it to set the search paths to some shared libraries that w...
Bathsheba asked 25/8, 2018 at 14:9

4

Solved

I have an application which depends on a plethora of libraries (don't we all). Most of these libraries are installed via the package manager. For the ones which are not, I have re-compiled them but...
Unweighed asked 4/4, 2011 at 21:15

5

Solved

I'm experimenting with the concept of pure-static-linked PIE executables on Linux, but running into the problem that the GNU binutils linker insists on adding a PT_INTERP header to the output binar...
Margaritamargarite asked 5/5, 2012 at 20:48

1

I want to ship and archive binaries (executables with libraries) which are backward and forward compatible with as many Linux distributions as possible and the whole package relocatable. As I under...
Gilding asked 23/2, 2019 at 10:3

1

Solved

When using external libraries, you often have to decide whether you use the static or the dynamic version of the library. Typically, you can not exchange them: If the library is build as dynamic li...
Rosado asked 29/1, 2019 at 14:58

4

Solved

I create dynamic link and I want to send some specific parameter, like: "https://mydynamiclink/?link=" + link + "&msgid=" + id + "&apn=myapn". link field looks like "https://play.google.com...
Hopefully asked 23/10, 2018 at 7:36

1

Solved

I've studied about JVM(especially JDK 8 version) and while studying about class linking, I've not figured out where a direct memory address that was determined from symbolic reference in resolution...
Syphilology asked 4/12, 2018 at 11:57

2

Solved

I am trying to compile my Rust project with dynamic linking to reduce the size and provide .so (or .dll on Windows) files with the application just like Qt does for Android. I read Why are Rust exe...
Definitive asked 22/11, 2018 at 18:42

4

I have a requirement that I link all my libraries statically including libstdc++, libc, pthread etc. There is one omniorb library which I want to link dynamically. Currently I have dynamically lin...
Toni asked 28/5, 2011 at 9:6

5

Solved

I want to change the rpath of an executable using install_name_tool, but I can't figure out what the rpath is right now. install_name_tool requires both the old and the new rpath's to be given on t...
Caressa asked 20/9, 2012 at 22:26

2

Solved

I have an executable that is linked to two shared libraries, each of which have dependencies to system shared libraries. (In this case these are the OpenCL and CUDA runtime libraries, but this does...
Amphibious asked 28/9, 2018 at 14:32

3

I'm trying to link a Rust program with libsoundio. I'm using Windows and there's a GCC binary download available. I can link it like this if I put it in the same folder as my project: #[link(name ...
Nkvd asked 27/11, 2016 at 19:36

3

Solved

I have to perform dynamic linking on a variadic function of following format: int foo(char *args, const char *f, ...) Here the number of arguments are variable. What I want to achieve is that I...
Cocainize asked 1/8, 2018 at 6:8

2

Solved

I have two assembly codes, code1.s and code2.s and I want to build a relocatable (using -fPIC switch) shared library from these two. I want code2.s call a function, named myfun1, which is defined ...
Camp asked 28/7, 2018 at 17:38

5

Solved

My problem is the following: I have a go binary on a machine From that binary I need to compile an external .go file Once compiled, I need to link the compiled go file into the current binary so ...
Chalmers asked 17/10, 2013 at 15:44

© 2022 - 2024 — McMap. All rights reserved.