next up previous contents index
Next: 21.1.1 oskit_boot_rtld: Initialize the Up: 21 Runtime Linker/Loader: liboskit_rtld.a Previous: 21 Runtime Linker/Loader: liboskit_rtld.a

21.1 Introduction

This section describes the Runtime Linker/Loader (RTLD) support in the OSKit. The library code is derived from the FreeBSD 3.0 ELF runtime link-editor library, and was modified to work in the OSKit. Rather than operating as an ``interpreter,'' the RTLD library is linked in directly with an OSKit kernel, and exports the standard set of interface functions that allow shared libraries to be loaded and unloaded. The OSKit kernel must have been compiled and linked properly so that the kernel is in the correct binary format (ELF), and contains the necessary information (dynamic symbol table, etc.) in the executable file. The reader should consult the demonstration kernel in examples/dyntest, which shows how the kernel should be linked, and how to compile, link, and load a shared library. Shared libraries are loaded into the kernel using the dlopen function, which is described below. Once a library is loaded, the dlsym function is used to find individual symbols inside that library. A shared library is unloaded with the dlclose function.

In order to use the RTLD functions, the OSKit kernel must first initialize the RTLD library. This is done with the oskit_boot_rtld function.





Utah Flux Research Group