This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc][1/3] Remote core file generation: BFD support
- From: Alan Modra <amodra at gmail dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, gdb-patches at sourceware dot org, binutils at sourceware dot org
- Date: Tue, 17 Jan 2012 09:00:30 +1030
- Subject: Re: [rfc][1/3] Remote core file generation: BFD support
- References: <201111091600.30812.pedro@codesourcery.com> <201111091818.pA9IIQ5F005486@d06av02.portsmouth.uk.ibm.com>
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 <NT_PRPSINFO>): Don't leave
trailing garbage in the note.
* elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): 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