-
-
Notifications
You must be signed in to change notification settings - Fork 605
Dynamic Linker
WALDEMAR KOZACZUK edited this page Nov 9, 2019
·
31 revisions
OSv is made of many components but the dynamic linker is probably the most essential one as it ties all other components together and is responsible for bootstrapping an application. In essence, it involves locating ELF file on the filesystem, loading it into memory using mmap()
, processing its headers and segments to relocate symbols, configuring TLS, executing its init functions, loading any dependant ELF objects and finally starting the app. Please note that unlike Linux, the dynamic linker is an integral part of the OSv kernel. Most of the dynamic linker code is located in core/elf.cc
, arch/<arch>/arch-elf.cc
and core/app.cc
.
app_registry
-
application
- represents running program (there is _program pointer it points to) -
elf::program
- typically there is only one instance of it so effectively it is a singleton, but it is possible to create new programs for new ELF namespaces -
elf::object
elf::symbol_module