Questions tagged [dynamic-loading]
26 questions
32
votes
5 answers
What system call is used to load libraries in Linux?
In strace outputs, the paths to the libraries that executables call are in calls to open(). Is this the system call used by executables that are dynamically linked? What about dlopen()? open() isn't a call I'd have guessed would play a role in the…
Melab
- 3,808
- 8
- 29
- 49
14
votes
2 answers
How to export LD_LIBRARY_PATH to all users and system services
I want to export LD_LIBRARY_PATH to system services and all users.
System services are run before login, so .bashrc is not applicable.
How to achieve this?
linquize
- 969
- 2
- 9
- 9
12
votes
2 answers
Which parts of an ELF executable get loaded into memory, and where?
What I already know:
An ELF executable has a number of sections, obviously the .text and .data sections get loaded into memory as these are the main parts of the program. But for a program to work, it needs more info, especially when linked…
Dutchy
- 133
- 1
- 9
10
votes
2 answers
ELF shared libraries - motivation for the PLT
Could self-modifying code be used to speed up function calling in dynamically linked libraries?
As far as I understand it, ELF shared libraries use a kind of indirect jump table (the procedure linkage table, or PLT) to enable lazy binding of library…
lxgr
- 213
- 1
- 7
8
votes
2 answers
Is there a way to check whether a .so has been compiled with -Bsymbolic-functions flag?
My application loads custom code using dlopen on the fly.
For common symbols, the global symbol table is used by default.
However, I want to provide the functionality where - if the user has linked their so with -Bsymbolic-functions, I pass the…
amisax
- 2,957
- 17
- 23
5
votes
1 answer
Are .text sections shared between loaded ELF executables?
If one program, for example grep, is curretly running, and a user executes another instance, do the two instances share the read-only .text sections between them to save memory? Would the sharing of the main executable text sharing be done similarly…
novice
- 419
- 3
- 12
5
votes
1 answer
Reload xserver-xorg-input-mouse
Can I reload xserver-xorg-input-mouse driver on the fly? For example, after I modify and recompile the source
Jakub M.
- 439
- 6
- 14
4
votes
0 answers
Is there any solution to ltrace calls made by libs opened using dlopen()?
I wrote different two different types of queues. Bundled them in different .sos. I have a driver main.c which tests functions offered by those queues. main.c makes use dlfcn.h to load, unload required library at run-time. Both the implementations of…
Vishwajith.K
- 45
- 6
4
votes
1 answer
List loaded libraries of a process on FreeBSD
How can I list all loaded libraries of a process in FreeBSD? On Linux I can use /proc
cat /proc/$pid/maps
on Solaris there is pldd
pldd $pid
For FreeBSD /proc also works:
cat /proc/$pid/map
however, /proc is not mounted by default. As this is…
Thomas Erker
- 2,777
- 12
- 19
4
votes
2 answers
Specifying local libc does call global libc?
If I run the command foo specifying a a different libc to use as follows:
LD_LIBRARY_PATH=$PATH_TO_MY_CUSTOM_LIBC foo
Is the globally defined libc used to run any of the command given above?
For the sake of context: consider the situation where…
user213575
- 43
- 1
- 4
4
votes
3 answers
Is it possible to configure dynamic loader for an executable
I am looking for a way to allow an executable to find its shared library, but in order to avoid conflict with any package that could use a different version of the same shared library I prefer to keep these libraries in a 'private path' (not…
mpromonet
- 383
- 3
- 13
3
votes
1 answer
How to run programs with ld-linux.so?
The dynamic linker can be run either indirectly by running some dynamically linked program or shared object (in which case no command-line options to the dynamic linker can be passed and, in the ELF case, the dynamic linker which is stored in the…
x-yuri
- 3,223
- 10
- 39
- 62
2
votes
1 answer
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() or dlopen(), to solve the chicken-egg problem…
Tim
- 98,580
- 191
- 570
- 977
2
votes
2 answers
ld.so.preload doesn't differ x86_32 and x86_64
— It's known you can run x86_32 programms with x86_64 kernel if it was compiled with support for that. But dynamic linker doesn't provide any way to define a separate set of preload libraries for 32-bit programs, so every time you run such a…
poige
- 6,195
- 2
- 30
- 57
1
vote
1 answer
(debian) installing mod_qos on apache results in error on start
I installed the mod_qos module using the steps found here, every step went perfectly fine without any problems, however, when attempting to restart the apache service it returned the following error:
apache2: Syntax error on line 203 of…
xorinzor
- 67
- 9