From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23003 invoked by alias); 16 Jan 2012 22:31:01 -0000 Received: (qmail 22990 invoked by uid 22791); 16 Jan 2012 22:31:00 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_CP X-Spam-Check-By: sourceware.org Received: from mail-yx0-f169.google.com (HELO mail-yx0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 22:30:38 +0000 Received: by yenm10 with SMTP id m10so1527267yen.0 for ; Mon, 16 Jan 2012 14:30:37 -0800 (PST) Received: by 10.236.78.6 with SMTP id f6mr20087161yhe.109.1326753037701; Mon, 16 Jan 2012 14:30:37 -0800 (PST) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id q40sm53795451anh.18.2012.01.16.14.30.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 14:30:37 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 413E3170C2EA; Tue, 17 Jan 2012 09:00:30 +1030 (CST) Date: Mon, 16 Jan 2012 22:31:00 -0000 From: Alan Modra To: Ulrich Weigand Cc: Pedro Alves , gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: [rfc][1/3] Remote core file generation: BFD support Message-ID: <20120116223030.GN3708@bubble.grove.modra.org> Mail-Followup-To: Ulrich Weigand , Pedro Alves , gdb-patches@sourceware.org, binutils@sourceware.org References: <201111091600.30812.pedro@codesourcery.com> <201111091818.pA9IIQ5F005486@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111091818.pA9IIQ5F005486@d06av02.portsmouth.uk.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-01/txt/msg00190.txt.bz2 On Wed, Nov 09, 2011 at 07:18:26PM +0100, Ulrich Weigand wrote: > OK, good point. I've just copied this from the PowerPC implementation, > which needs to be fixed as well ... I'll provide an updated patch. Applied. * elf32-ppc.c (ppc_elf_write_core_note ): Don't leave trailing garbage in the note. * elf64-ppc.c (ppc64_elf_write_core_note ): Likewise. Index: bfd/elf32-ppc.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-ppc.c,v retrieving revision 1.306 diff -u -p -r1.306 elf32-ppc.c --- bfd/elf32-ppc.c 3 Dec 2011 00:55:49 -0000 1.306 +++ bfd/elf32-ppc.c 16 Jan 2012 22:25:06 -0000 @@ -1920,7 +1920,7 @@ ppc_elf_write_core_note (bfd *abfd, char va_list ap; va_start (ap, note_type); - memset (data, 0, 32); + memset (data, 0, sizeof (data)); strncpy (data + 32, va_arg (ap, const char *), 16); strncpy (data + 48, va_arg (ap, const char *), 80); va_end (ap); Index: bfd/elf64-ppc.c =================================================================== RCS file: /cvs/src/src/bfd/elf64-ppc.c,v retrieving revision 1.373 diff -u -p -r1.373 elf64-ppc.c --- bfd/elf64-ppc.c 11 Jan 2012 09:28:44 -0000 1.373 +++ bfd/elf64-ppc.c 16 Jan 2012 22:25:12 -0000 @@ -2721,7 +2721,7 @@ ppc64_elf_write_core_note (bfd *abfd, ch va_list ap; va_start (ap, note_type); - memset (data, 0, 40); + memset (data, 0, sizeof (data)); strncpy (data + 40, va_arg (ap, const char *), 16); strncpy (data + 56, va_arg (ap, const char *), 80); va_end (ap); -- Alan Modra Australia Development Lab, IBM