This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Powerpc disassembly and gdb breakpoints
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: amodra at bigpond dot net dot au (Alan Modra)
- Cc: binutils at sourceware dot org
- Date: Wed, 14 May 2008 18:02:33 +0200 (CEST)
- Subject: Re: Powerpc disassembly and gdb breakpoints
Alan Modra wrote:
> This patch from Ulrich Weigand implements synthetic symbols on plt
> call stubs for powerpc, and the same for powerpc64 except that the
> symbol is on the glink branch table instead. See the fixme I added
> to explain why putting the synthetic symbol on the stub is difficult
> for ppc64.
Thanks for taking care of this!
Unfortunately, there were a couple of memset calls with swapped
second and third parameters, which may cause parts of the symbol
data structure to remain uninitialized, leading to a crash in GDB.
(This bug was already in the original patch it sent to you, sorry!)
I've checked in the following obvious fix.
Bye,
Ulrich
ChangeLog:
* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.237
diff -c -p -r1.237 elf32-ppc.c
*** bfd/elf32-ppc.c 14 May 2008 02:21:19 -0000 1.237
--- bfd/elf32-ppc.c 14 May 2008 14:26:18 -0000
*************** ppc_elf_get_synthetic_symtab (bfd *abfd,
*** 2464,2470 ****
}
/* Add a symbol at the start of the glink branch table. */
! memset (s, sizeof *s, 0);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
--- 2464,2470 ----
}
/* Add a symbol at the start of the glink branch table. */
! memset (s, 0, sizeof *s);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
*************** ppc_elf_get_synthetic_symtab (bfd *abfd,
*** 2478,2484 ****
if (resolv_vma)
{
/* Add a symbol for the glink PLT resolver. */
! memset (s, sizeof *s, 0);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
--- 2478,2484 ----
if (resolv_vma)
{
/* Add a symbol for the glink PLT resolver. */
! memset (s, 0, sizeof *s);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.281
diff -c -p -r1.281 elf64-ppc.c
*** bfd/elf64-ppc.c 14 May 2008 02:21:19 -0000 1.281
--- bfd/elf64-ppc.c 14 May 2008 14:26:20 -0000
*************** ppc64_elf_get_synthetic_symtab (bfd *abf
*** 3143,3149 ****
if (resolv_vma)
{
/* Add a symbol for the main glink trampoline. */
! memset (s, sizeof *s, 0);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
--- 3143,3149 ----
if (resolv_vma)
{
/* Add a symbol for the main glink trampoline. */
! memset (s, 0, sizeof *s);
s->the_bfd = abfd;
s->flags = BSF_GLOBAL;
s->section = glink;
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com