From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9744 invoked by alias); 22 Feb 2006 18:05:27 -0000 Received: (qmail 9736 invoked by uid 22791); 22 Feb 2006 18:05:27 -0000 X-Spam-Check-By: sourceware.org Received: from satelite.dea.inpe.br (HELO satelite.dea.inpe.br) (150.163.30.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Feb 2006 18:05:26 +0000 Received: by satelite.dea.inpe.br (Postfix, from userid 550) id E90B6128A49; Wed, 22 Feb 2006 15:12:43 -0300 (BRT) From: "Fabrício de Novaes" Subject: Does GDB use VMA addresses when uploading an image to debug in a remote target? To: gdb@sourceware.org Cc: Message-Id: <1140631963.8331@satelite.dea.inpe.br> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bound1140631963" Date: Wed, 22 Feb 2006 18:18:00 -0000 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00295.txt.bz2 This is a multi-part message in MIME format. --bound1140631963 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1318 Hi all, I have a GCC application that will run in a board with an ERC32 (SPARC) pro= cessor. For many reasons, this app has to run in RAM, not ROM. So, the ELF32 image has a ".boot" section which starts the board and copies= the main program from a ".text" section to RAM. This .text section has dif= ferent LMA (pointing to ROM) and VMA (RAM) addresses, as you can see below: Idx Name Size VMA LMA File off Algn 0 .boot 00001320 00000000 00000000 000000b4 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text 0001d1b0 02001000 00001320 000013d8 2**3 CONTENTS, ALLOC, LOAD, CODE [...] I'm trying to debug this app using GDB and a simulator. My problem is that,= when I load the image to debug, the .text section is already in the 0x2001= 000 address (VMA), and the LMA area (starting from 0x1320) is empty - so I = can't debug appropriately the routine that copies the .text section to RAM. I'd like to know if GDB loads sections from an ELF file to a target using t= he VMA addresses and, if yes, if it's possible to change this behavior and = tell it to send my .text section to its LMA address. Any answer or comment will be very appreciated. Thank you in advance and best regards, Fabr=EDcio de Novaes Kucinskis. --bound1140631963--