genode/os/src/lib/ldso
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +01:00
..
arch Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
arm Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
contrib Imported Genode release 11.11 2011-12-22 16:19:25 +01:00
include Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
startup Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
x86_32 Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
x86_64 Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
dl_extensions.h Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
environ.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
err.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
file.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
file.h Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
ldso_types.c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
ldso.ld Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
lock.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
main.c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
platform.c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
README Imported Genode release 11.11 2011-12-22 16:19:25 +01:00
rtld_dummies.c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
stdio.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
stdlib.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
string.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
symbol.map NOVA: cleanup - remove _first_sel special handling 2012-10-08 15:08:12 +02:00
target.inc Merge base libraries into a single library 2013-02-19 14:45:55 +01:00
test.cc Update copyright headers to 2013 2013-01-10 21:44:47 +01:00

This directory contains the port of the dynamic linker (ldso) from FreeBSD.


Usage
-----

To build a shared library instead of a regular static library, you just need to
declare 'SHARED_LIB = yes' in the library-description file.  When doing so, a
'<libname>.lib.so' file will be generated and installed in the
'<build-dir>/bin/' directory.  For building an executable that uses a shared
library, no special precautions are needed. The build system will automatically
detect the use of shared libraries, concludes that the binary must be
dynamically linked, and will use the correct linker script.  When loading a
dynamically linked program, the dynamic linker 'lsdo' and all used shared
objects must be loaded as well.

Debugging dynamic binaries with GDB stubs
-----------------------------------------

! # start GDB with binary to debug
! gdb <path to binary>
!
! # break in main routine
! b main
!
! # inspect loaded shared libraries
! info sharedlibrary
!
! # load shared symbols of shared libaries
! share
!
! # from here you can debug within libraries

:Known issues:

GDB 7.2 has a regression bug in its line information parser. These issue has
been fixed with version 7.3.