From owner-freebsd-alpha Mon Feb 8 10:57:23 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA12036 for freebsd-alpha-outgoing; Mon, 8 Feb 1999 10:57:23 -0800 (PST) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA12030 for ; Mon, 8 Feb 1999 10:57:21 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.1/8.9.1) with ESMTP id NAA28023; Mon, 8 Feb 1999 13:56:59 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.2/8.9.1) id NAA07104; Mon, 8 Feb 1999 13:56:58 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 8 Feb 1999 13:56:57 -0500 (EST) To: John Polstra Cc: Terry Lambert , alpha@FreeBSD.ORG Subject: Re: Could somebody please test this patch? In-Reply-To: References: <199902062108.OAA17997@usr02.primenet.com> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14015.12344.625775.923958@grasshopper.cs.duke.edu> Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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