From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21003 invoked by alias); 27 Apr 2008 21:46:32 -0000 Received: (qmail 20995 invoked by uid 22791); 27 Apr 2008 21:46:32 -0000 X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 27 Apr 2008 21:46:01 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id D503E67166; Sun, 27 Apr 2008 21:45:59 +0000 (UTC) From: Mike Frysinger To: Daniel Jacobowitz Subject: Re: the "load" command and the .bss section Date: Mon, 28 Apr 2008 17:29:00 -0000 User-Agent: KMail/1.9.7 Cc: gdb@sourceware.org References: <200804270509.34308.vapier@gentoo.org> <20080427135600.GA9356@caradoc.them.org> In-Reply-To: <20080427135600.GA9356@caradoc.them.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1815334.BgPE4GgeyO"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200804271745.59361.vapier@gentoo.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00233.txt.bz2 --nextPart1815334.BgPE4GgeyO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 1508 On Sunday 27 April 2008, Daniel Jacobowitz wrote: > On Sun, Apr 27, 2008 at 05:09:31AM -0400, Mike Frysinger wrote: > > i was doing a new board port using jtag and so was leveraging the "load" > > command to setup the initial ELF in the relevant memory regions. things > > kept crashing on me and then i realized that the loading process wasnt > > actually zeroing out the bss. is there a reason for this ? i googled > > and flipped through the manual, but the details on what exactly the > > "load" command is supposed to do is a bit on sketchy side. from what i > > can tell from the gdb source code and the actual output from running the > > command, it walks the section headers (rather than the program headers = ?) > > and loads up everything that is in the file. since the bss section > > doesnt actually exist in the file and is only allocated, that is why it > > gets skipped ? > > Load puts things at their LMA rather than their VMA. So it assumes > that whatever sets up load -> virtual also handles bss; it's more like > flash programming than like the Linux kernel's loader. Heck, > sometimes it is flash programming... > > IIRC we have a couple of old requests for a version of load which > drops things at their VMA. That one would have to clear the BSS. what would be the way to extend things ? getopt-style flags to load ? a n= ew=20 command ? i may take a look (according to my wants/needs), but i'm not=20 terribly good with gdb code base, so i wont promise anything ... -mike --nextPart1815334.BgPE4GgeyO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. Content-length: 827 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iQIVAwUASBT0F0FjO5/oN/WBAQKJABAApJN+biAflL1E7Ygp19L5salZjU7plAzZ mxB3bHZHsMCRBQLxFbeBit0L5aoO0Nk5qameohkr7GBLHOqG1Ytd+cb0qbvTZyHU CB1KmL/m0O5CviEfCfs9fvtTqXEyZJ+PG/WTZILkvYMG2czR2dmlCk7UBbzsO35+ eSxTJWBA5afuO4cOO3AIWZ8G4ZniqkHv1e3xoKV6v5LwhHu4ewHhnarMWvTlbp8Y 7SazcuxdGlu80AomMteAhkopTjXmCFiH62AFAz6ICnxbl5ZhE0e+QpmkEaXsabE+ 0OPBizQHrLA0ocrMHzyWK0HDDd0al+9N8WejD9WtSktZBwrpLn9+oCRfzl+rM5m8 FOmvbGGRjmuGS8anWSfwIfOcTlC13/27BLpaMy6DDXIBAdsykUJW1Yl6GAt6Sj4F heft1XPEq97FlRJ0XH2JYBx9mNaQyGTg624tpQkwbHB3BDXlRKQa7cwkWZCaz1s4 ZWsxwdyEbx1JqK5jgavp0W8zDO0miuTQsEmKrvs0gK+fMXXKKSVJSwx2i9s84yoN klstJ5isBEYqVJ+z73bnnVu3Q5hL4fYVpIaQrpGN0YBvSIThYHDXKt1YeiqHmGgQ bYZjKVmTKSEWerE5E5xwTNViGhLfX3DEyAwxe85QuoOd9nfi1KSwZpaLOYBJEhZE kLV6UZJusSc= =2piU -----END PGP SIGNATURE----- --nextPart1815334.BgPE4GgeyO--