Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  8 Feb 1999 13:56:57 -0500 (EST)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        John Polstra <jdp@polstra.com>
Cc:        Terry Lambert <tlambert@primenet.com>, alpha@FreeBSD.ORG
Subject:   Re: Could somebody please test this patch?
Message-ID:  <14015.12344.625775.923958@grasshopper.cs.duke.edu>
In-Reply-To: <XFMail.990208104026.jdp@polstra.com>
References:  <199902062108.OAA17997@usr02.primenet.com> <XFMail.990208104026.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help

John Polstra writes:
 > 
 > That will show where the RTLD is mapped for sleep, but it doesn't
 > show whether the RTLD _has_ to be mapped at that location.  I think
 > a better way would be to run objdump on the Digital Unix RTLD and
 > see if it has a fixed load address.
 > 

Shared library loading works a little different on Digital UNIX than
everywhere else.  The rtdl (/sbin/loader) is actually a static
executable in its own right (with its text at 0x3ff800059e0), which
maps in the 'real' dynamic executable and its shared libs, then
transfers control the 'real' executable.

The way the OSF/1 emulator works is that when the image activation
routine realizes its loading a dynamic executable, it needs to back
out (eg, unmap the first page, cleanup any state, etc), and start
executing /sbin/loader instead.  Note that you cannot mention
/sbin/loader in argv[] (else you'll get '/sbin/loader: Fatal Error:
loader cannot be invoked directly'), rather you need to build an
auxargs array on the stack.  The loader finds the path to the
executable there, and proceeds to map it in, along with its shared
libs, etc.  When this has been done, the loader transfers control to
the executable immediately after calling osf1_set_program_attributes()
to setup the size & location of the process's text & data segments.

Drew

------------------------------------------------------------------------------
Andrew Gallatin, Sr Systems Programmer	http://www.cs.duke.edu/~gallatin
Duke University				Email: gallatin@cs.duke.edu
Department of Computer Science		Phone: (919) 660-6590


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14015.12344.625775.923958>