From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10287 invoked by alias); 27 Apr 2008 09:09:59 -0000 Received: (qmail 10277 invoked by uid 22791); 27 Apr 2008 09:09:59 -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 09:09:37 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 2B8BB671CA for ; Sun, 27 Apr 2008 09:09:35 +0000 (UTC) From: Mike Frysinger To: gdb@sourceware.org Subject: the "load" command and the .bss section Date: Mon, 28 Apr 2008 08:02:00 -0000 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4413133.D9BakvBlBn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200804270509.34308.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/msg00229.txt.bz2 --nextPart4413133.D9BakvBlBn Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-length: 885 i was doing a new board port using jtag and so was leveraging the "load"=20 command to setup the initial ELF in the relevant memory regions. things ke= pt=20 crashing on me and then i realized that the loading process wasnt actually= =20 zeroing out the bss. is there a reason for this ? i googled and flipped=20 through the manual, but the details on what exactly the "load" command is=20 supposed to do is a bit on sketchy side. from what i can tell from the gdb= =20 source code and the actual output from running the command, it walks the=20 section headers (rather than the program headers ?) and loads up everything= =20 that is in the file. since the bss section doesnt actually exist in the fi= le=20 and is only allocated, that is why it gets skipped ? once i adapted my habits to first load the ELF and then manually zero the b= ss,=20 life was so much saner :). -mike --nextPart4413133.D9BakvBlBn 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) iQIVAwUASBRCzkFjO5/oN/WBAQLjXBAAt6Mx5T925ByHBBCEcajZzerV2P5nuO4B wDBMrbP/Yq+AG6xV9P58K81BwUnRLvsg4Tl7WzrfJBYqCcKbjZdRgEL8ezXl51sY uKcXGwqox6yYBviE2XOG/tFWiCkKhUTZy+mjqonbwnDyZE6yWKR+yM4c3sZ2/Iaw T8oJNzVlIBE0WucNk3h3Oo//BH7IK7A38GYhoATbmnP+m8kqH3WIzR0uFtD74t/r lUlnMcgKsAI3PY97SGUS4u/GG8BYeoqC4wy7V3e3nqBTqdKYD+MJ+Dfof84rEZIK UKaIG7yle7bDCSUv6hci7zIv+JMQ3zaO0eZWnca/6TJvcRkYEYZkk392Z56dS5VE qhmnh2jsAZY/gZJyKJTLVha/WMjL0jUTf90OvmYgrUYTDf2CXBHckfU9WqZogRqJ 7nrLDwZyrTPMvVEowlPiM9+VIUOgwkUwFGdgQR7IVtDqGn2OW2aQk5zG5eJnJ1vt NvY+hC1iddt7cv+6+PMWeK8hI/z60k1y/W+IHYSKd9OmTs3kHMToWJx79M/Ohfdx B7WG7LYOStPlG1+f7appJ9+zmoTj/kJMwlqi8NTMFc0WfSS3KcWmSu8IFnUbChT4 Clbo/6Y+PO+NYmSD9EZq+bOLCrSkarmNTZsgLBoIgnDNpLj09tTkHFjDxMSJ4jj4 2MKtUncS4Ow= =wLEy -----END PGP SIGNATURE----- --nextPart4413133.D9BakvBlBn--