From 63194ea62adfa5357eb68cd041bead3fce1c7a77 Mon Sep 17 00:00:00 2001 From: amodra Date: Mon, 12 Nov 2007 03:28:51 +0000 Subject: [PATCH] * elf.c (_bfd_elf_get_synthetic_symtab): Only bump the symbol pointer when we have a valid symbol. Init udata.p to NULL. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 16639c6520..2635fbdb3c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-11-12 Alan Modra + + * elf.c (_bfd_elf_get_synthetic_symtab): Only bump the symbol + pointer when we have a valid symbol. Init udata.p to NULL. + 2007-11-09 Nathan Sidwell * elf-vxworks.c (elf_vxworks_emit_relocs): Don't clobber diff --git a/bfd/elf.c b/bfd/elf.c index 0969abc370..d4f8f05498 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -8678,7 +8678,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, names = (char *) (s + count); p = relplt->relocation; n = 0; - for (i = 0; i < count; i++, s++, p++) + for (i = 0; i < count; i++, p++) { size_t len; bfd_vma addr; @@ -8695,12 +8695,13 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, s->section = plt; s->value = addr - plt->vma; s->name = names; + s->udata.p = NULL; len = strlen ((*p->sym_ptr_ptr)->name); memcpy (names, (*p->sym_ptr_ptr)->name, len); names += len; memcpy (names, "@plt", sizeof ("@plt")); names += sizeof ("@plt"); - ++n; + ++s, ++n; } return n; -- 2.11.0