From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 14:23:44 2010 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 5A7A3106566B for ; Wed, 29 Sep 2010 14:23:44 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C328D8FC13 for ; Wed, 29 Sep 2010 14:23:41 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA28654; Wed, 29 Sep 2010 17:23:12 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4CA34BCF.6090701@icyb.net.ua> Date: Wed, 29 Sep 2010 17:23:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: PL References: <4ca2f64ee66683.99262397@wp.pl> <4CA2FFAE.6030906@icyb.net.ua> <4ca3496d8ce8b3.74842248@wp.pl> In-Reply-To: <4ca3496d8ce8b3.74842248@wp.pl> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers Subject: Re: question regarding link_elf.c 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: Wed, 29 Sep 2010 14:23:44 -0000 on 29/09/2010 17:13 PL said the following: > It seems like it is not a problem in my own code, since readelf -S on a > elf file > gives me the same results as my debug messages. I've created an empty > module, to > simplify debugging. Both my code, and readelf says, that '.text' section > address > is 0x3e0, and its size is 7 bytes. Adding 0x3e0 to lf->address points to > a valid location. > > '.data' is supposed to be at 0x1424 (again, both my code and readelf > returns the same thing), > but the actual data starts at lf->address + 0x3e7. How do I know ? I've > added global > initialized string variable in empty test module, and Im looking at the > memory to determine > it's location. I'm not sure what is wrong then. Can you post a link to the compiled test module? -- Andriy Gapon