From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16340 invoked by alias); 1 Aug 2007 17:38:56 -0000 Received: (qmail 16324 invoked by uid 22791); 1 Aug 2007 17:38:55 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 17:38:47 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l71HcjCm007480; Wed, 1 Aug 2007 13:38:45 -0400 Received: from pobox.fab.redhat.com (pobox.fab.redhat.com [10.33.63.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l71HciST019006; Wed, 1 Aug 2007 13:38:45 -0400 Received: from [10.33.6.26] (vpn-6-26.fab.redhat.com [10.33.6.26]) by pobox.fab.redhat.com (8.13.1/8.13.1) with ESMTP id l71HchxR006926; Wed, 1 Aug 2007 13:38:44 -0400 Message-ID: <46B0C52A.9010906@redhat.com> Date: Wed, 01 Aug 2007 17:38:00 -0000 From: Nick Clifton User-Agent: Thunderbird 1.5.0.10 (X11/20070301) MIME-Version: 1.0 To: Bhushan Verma CC: binutils@sourceware.org Subject: Re: Regarding linker code generation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00021.txt.bz2 Hi Verma, > Program Header[0]: > p_vaddr: 0 p_flags: [ PF_X PF_W PF_R ] > p_paddr: 0 p_type: [ PT_LOAD ] > p_filesz: 0x2bc1f p_memsz: 0x2d6c8 > p_offset: 0 p_align: 0x8000 > > Why linker is generating this type of header? I am not sure exactly what you are asking here. This header is needed because it is part of the ELF specification. All loadable ELF binary files (ie either libraries or programs) have a header like this. > But whenever I separate code and data segment this gives segmentation fault > inside self relocation of run time linker. It sounds like there is a problem inside the run time linker then. > I am using gnu arm toolchain Are you using the latest version ? If not then try that. Also try building a toolchain from the current mainline development sources as this *may* fix your problem. > Could you please help me is this due to permiison of data segment or I have > some other problem as in creating wrong data segment etc. Could be. You would need to investigate this "run time linker" you refer to. > could you please explian me p_vaddr Vs p_paddr. See the ELF spec for full details. Here is a quick excerpt: p_vaddr This member gives the virtual address at which the first byte of the segment resides in memory. p_paddr On systems for which physical addressing is relevant, this member is reserved for the segment's physical address. This member requires operating system specific information, which is described in the appendix at the end of Book III. Cheers Nick