POSIX function to dynamically load a library or binary into memory
Questions tagged [dlopen]
685 questions
0
votes
1 answer
I am about to use dlopen() to open shared object. Do I need to include corresponding headers if shared object?
I have to use dlopen() and access functions from shared object in my code. Do I need to include headers of corresponding functions of shared object ?

Chandu
- 1,837
- 7
- 30
- 51
0
votes
1 answer
dlopen fails in boost python module
My objective is to create a python extension module with boost python. The problem is that when code in the shared library uses dlopen to access symbols within the same library, it fails (details below). It seems like the symbols within the module…

user1827356
- 6,764
- 2
- 21
- 30
0
votes
1 answer
Store binary file as a string inside my code
I'm creating a library to provide access to another library.
The library in question is a vendor, so not everyone should access this library.
One solution to do so is to put the library on a specific group (AIX) and then put everyone that can…

Lefsler
- 1,738
- 6
- 26
- 46
0
votes
2 answers
dlopen() fails on Android but works on Linux
I'm trying to dynamically load a specific shared library using dlopen() in lazy mode.
There are of course unresolved symbols in the shared library, but the lazy mode supposed to ignore them.
It does ignore them on Linux, and the resolving actually…

stdcall
- 27,613
- 18
- 81
- 125
0
votes
4 answers
Disabling access to "exec" functions?
Let's say I have a process "A" that loads a dynamic library "L".
Q: Is there a way to disable access to the "exec" functions to functions inside "L"?

jldupont
- 93,734
- 56
- 203
- 318
0
votes
1 answer
How can i keep global variables in dynamic library when using dlopen to reload it
I have tried to use dlopen to load a dynamic library with the flag RTLD_NODELETE in order to keep global variables and make sure they will not be reinitiated when next time i use dlopen to reload it.
But when I want to reload the library when some…

user2706071
- 196
- 9
0
votes
2 answers
Visibility of symbols among sibling .so files
I'm trying to make this OSX code (golfed for ease of discussion) work on Ubuntu Linux.
cat >main.c <
#include
#include
void provided_by_main() { puts("Hello main!"); }
int main() {
void *provider_so,…

Quuxplusone
- 23,928
- 8
- 94
- 159
0
votes
2 answers
"dlopen: Invalid argument" when loading native activity
I'm using the following bootstrapping code to load my native activity (jngl-test):
#include
#include
#include
#include
#include
const std::string LIB_PATH =…

jhasse
- 2,379
- 1
- 30
- 40
0
votes
1 answer
why the DSO was loaded at address 0
There is a simple test program,it dlopen()s a DSO "/lib/libc.so.6" and then print the address of symbol "printf".
#include
#include
int main() {
void* handle;
void (*func)();
char* error_test;
if (handle =…

abin
- 1
- 1
0
votes
1 answer
Checking type of variables in dynamically loaded shared libraries in C/C++
I'm working on a test environment of a C library. The library extensively use global variables, what I want to check in the test codes. Unfortunately I have to load the library dynamically (using libdl) to be able to reset the function static…

simon
- 1,210
- 12
- 26
0
votes
1 answer
undefined symbol: PyOS_InputHook, from shared library
I wrote a C++ "python plugin" for an a non-python C++ application.
At some point, this plugin, which is a .so, initializes the python interpreter and opens a python console.
For convenience the "readline" module is then imported and we get this…

user2179288
- 203
- 2
- 12
0
votes
1 answer
Make local c library function accessable globally
I'm using a C library called GLC to record my OpenGL buffer programmatically.
GLC listens to key presses, which is not really a nice solution to trigger programmatically.
Therefore I want to execute the recording from GLC via a function call in my…

Josch
- 121
- 1
- 3
- 9
0
votes
1 answer
undefined reference to dlopen using djgpp
When I tried to compiled sqlite3 uding djgpp, it gives error undefined reference to dlopen, undefined reference to dlclose, undefined reference to dlsym etc.
On Linux if we use -ldl the problem is olved. However there is no dl.a available in…

user1445268
- 49
- 2
0
votes
1 answer
APK with two shared objects inside
According to docs/PREBUILTS.html it is allowed to use prebuilt shared objects in NDK apps. So I tried to have my NDK app import a function from a second shared object but as soon as I use a second shared object in my APK the whole shebang crashes…

Andreas
- 9,245
- 9
- 49
- 97
0
votes
2 answers
C - parsing text and calling functions
i have followind problem.
I have text parser located in parser.o library. I would like to parse some text(find functions) and call them. Functions are implemented in functions.o file. I am able to parse text, but i dont know how to call function…

user1453857
- 207
- 1
- 3
- 13