From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2050 invoked by alias); 2 Aug 2007 01:21:30 -0000 Received: (qmail 2041 invoked by uid 22791); 2 Aug 2007 01:21:30 -0000 X-Spam-Check-By: sourceware.org Received: from www.iap-online.com (HELO www.iap-online.com) (69.20.70.12) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Aug 2007 01:21:24 +0000 Received: from dk11 ([219.120.53.234]) (authenticated bits=0) by www.iap-online.com (8.12.11.20060308/8.12.11) with ESMTP id l721L8P7004224; Wed, 1 Aug 2007 21:21:16 -0400 From: "Bhushan Verma" To: "Nick Clifton" Cc: Subject: RE: Regarding linker code generation Date: Thu, 02 Aug 2007 01:21:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <46B0C52A.9010906@redhat.com> X-Synonym: Copied by Synonym (http://www.modulo.ro/synonym) to: mscopy 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/msg00034.txt.bz2 Thanks Nick, I am using gnu arm tool chain 4.1.1. I mean that when I build any shared object this toolchain is building only one segment as below 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 I know this header is needed ,but as per my knowledge this would make two segment of p_type:PT_LOAD type. mean two header values Program Header[0]: and Program Header[1]: of p_type:PT_LOAD, one for data segment and one for text segment. why this tool chain only generate one segment . is there any thing wrong in tool chain. When I tried gcc3.2.2 tool chain on Linux then this makes two header. I do not know why gcc 4.1.1 tool chain is not making two header values. regards verma -----Original Message----- From: Nick Clifton [mailto:nickc@redhat.com] Sent: Thursday, August 02, 2007 2:39 AM To: Bhushan Verma Cc: binutils@sourceware.org Subject: Re: Regarding linker code generation 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