diff options
author | Alan Modra <amodra@gmail.com> | 2008-10-09 00:55:52 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-10-09 00:55:52 +0000 |
commit | 066ee829b9ac6c058fc8466e79fa2b3603b56884 (patch) | |
tree | 64ff33c297d3c3b75ef48b2c765533b81a769294 /bfd/elf64-ppc.c | |
parent | 0396d017791608beeb524dcae998d3d50bbf4d4e (diff) | |
download | gdb-066ee829b9ac6c058fc8466e79fa2b3603b56884.zip gdb-066ee829b9ac6c058fc8466e79fa2b3603b56884.tar.gz gdb-066ee829b9ac6c058fc8466e79fa2b3603b56884.tar.bz2 |
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't attempt to
read plt relocs if no dynamic syms.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 86fe3c3..523d137 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3005,8 +3005,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, } /* Get start of .glink stubs from DT_PPC64_GLINK. */ - dynamic = bfd_get_section_by_name (abfd, ".dynamic"); - if (dynamic != NULL) + if (dyn_count != 0 + && (dynamic = bfd_get_section_by_name (abfd, ".dynamic")) != NULL) { bfd_byte *dynbuf, *extdyn, *extdynend; size_t extdynsize; @@ -3061,21 +3061,21 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, if (resolv_vma) size += sizeof (asymbol) + sizeof ("__glink_PLTresolve"); - } - relplt = bfd_get_section_by_name (abfd, ".rela.plt"); - if (glink != NULL && relplt != NULL) - { - slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; - if (! (*slurp_relocs) (abfd, relplt, dyn_syms, TRUE)) - goto free_contents_and_exit; + relplt = bfd_get_section_by_name (abfd, ".rela.plt"); + if (relplt != NULL) + { + slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; + if (! (*slurp_relocs) (abfd, relplt, dyn_syms, TRUE)) + goto free_contents_and_exit; - plt_count = relplt->size / sizeof (Elf64_External_Rela); - size += plt_count * sizeof (asymbol); + plt_count = relplt->size / sizeof (Elf64_External_Rela); + size += plt_count * sizeof (asymbol); - p = relplt->relocation; - for (i = 0; i < plt_count; i++, p++) - size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + p = relplt->relocation; + for (i = 0; i < plt_count; i++, p++) + size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + } } s = *ret = bfd_malloc (size); |