From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 20 10:39:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA355106566C for ; Sun, 20 Apr 2008 10:39:14 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF178FC1A for ; Sun, 20 Apr 2008 10:39:14 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:62932 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JnWwz-0004Bx-7v for freebsd-hackers@freebsd.org; Sun, 20 Apr 2008 12:39:13 +0200 Received: (qmail 5040 invoked from network); 20 Apr 2008 12:39:10 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 20 Apr 2008 12:39:10 +0200 Received: (qmail 92889 invoked by uid 1001); 20 Apr 2008 12:39:10 +0200 Date: Sun, 20 Apr 2008 12:39:10 +0200 From: Erik Trulsson To: emily becker Message-ID: <20080420103910.GA92852@owl.midgard.homeip.net> Mail-Followup-To: emily becker , freebsd-hackers@freebsd.org References: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1JnWwz-0004Bx-7v. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1JnWwz-0004Bx-7v b960c9b3b398dd43430da97622dd3fdb Cc: freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 10:39:14 -0000 On Sun, Apr 20, 2008 at 12:02:09PM +0300, emily becker wrote: > Hi, > > I have a question about symbol table. > One of the section In symbol table is memory adress which symbol is located. > I wonder if this memory adress is bound at run-time or compile-time? It depends. Symbols referring to objects in a dynamically loaded library will be bound at run-time, the rest should be bound at compile-time. > if it is compile-time, I don't understand how do we know whether the symbol > is located this adress. > Maybe this adress is already bound by other process or like this. Each process runs in its own address space, and therefore the compiler (actually: the linker) can know exactly where in this address space things will end up. (The above is true for FreeBSD and just about all other Unix-derived systems. Other systems can do things differently.) -- Erik Trulsson ertr1013@student.uu.se