Changes between Version 1 and Version 2 of kLdr


Ignore:
Timestamp:
Oct 29, 2006, 12:05:56 AM (18 years ago)
Author:
bird
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kLdr

    v1 v2  
    33I've got several different places now where I need a cross platform dynamic (executable image) loader and can do more than just dlopen/dlsym/dlclose. In addition to having to support all kinds of formats, it also has to be able to load images that won't run on the host cpu. Like for instance a 64-bit ELF image on a 32-bit Windows or OS/2 host system. Another requirement is to be able to relocate the module *after* it has been loaded. And of course, it also need to be able to do standard dynamic linking - i.e. load the executable and it's prerequisites on execv/spawn, and to do dlopen/dlsym/dlclose.
    44
     5== The api ==
     6
     7The kLdr API is split into two parts:
     8 -# The module interpreter API with prefix kLdrMod.
     9 -# The dynamic loader API with prefix kLdrDyld.
     10
     11In addition to these two interfaces, there's generic file provider interface which is used to open, read and map image files. Users of kLdr can implement their own file providers, which for instance servers files embedded in another module, and prepend them to the list kLdr uses when opening files. The default file provider is naturally using native OS APIs directly (no libc inbetween) and is all what most users would need.
     12
     13
     14== Supporte image formats ==
     15
    516Support for LX, MACH-O, PE and ELF (in that priority) is planned. It's possible that a.out will be added too.
    617
    718
    8 == links ==
     19== Implementation details ==
    920
    10  1. A state diagram for the dynamic loader modules can be found here: http://svn.netlabs.org/libc/browser/trunk/kLdr/tg/KLDRSTATE.gif
     21...
     22
     23source:trunk/kLdr/tg/KLDRSTATE.gif
     24
     25...