genode/os/src/lib/ldso
Alexander Boettcher 6862ab481a NOVA: drop special utcb handling of main thread
Unify handling of UTCBs. The utcb of the main thread is with commit
ea38aad30e at a fixed location - per convention.
So we can remove all the ugly code to transfer the utcb address during process
creation.

To do so also the UTCB of the main thread of Core must be inside Genode's
thread context area to handle it the same way. Unfortunately the UTCB of the
main thread of Core can't be chosen, it is defined by the kernel.

Possible solutions:
- make virtual address of first thread UTCB configurable in hypervisor
- map the utcb of the first thread inside Core to the desired location

This commit implements the second option.

Kernel patch: make utcb map-able
With the patch the Utcb of the main thread of Core is map-able.

Fixes #374

Noux actually uses the sp variable during thread creation and expects to be
set accordingly. This wasn't the case for the main thread, it was ever set
to the address of the main thread UTCB.
2012-10-04 14:35:38 +02:00
..
arch NOVA: Fix ldso test for 64bit 2012-08-14 10:19:54 +02:00
arm Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
contrib Imported Genode release 11.11 2011-12-22 16:19:25 +01:00
include Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
startup Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
x86_32 Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
x86_64 Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
dl_extensions.h Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
environ.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
err.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
file.cc Add an 'executable' flag to 'Rm_session::attach()' 2012-04-20 11:21:19 +02:00
file.h Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
ldso_types.c Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
ldso.ld Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
lock.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
main.c Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
platform.c Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
README Imported Genode release 11.11 2011-12-22 16:19:25 +01:00
rtld_dummies.c Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
stdio.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
stdlib.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
string.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
symbol.map NOVA: drop special utcb handling of main thread 2012-10-04 14:35:38 +02:00
target.inc Imported Genode release 11.11 2011-12-22 16:19:25 +01:00
test.cc Bump year in copyright headers to 2012 2012-01-03 15:35:05 +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.