X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=bfd%2Felf64-ppc.c;fp=bfd%2Felf64-ppc.c;h=069bd758aec1e30b5b22c02ec504960fa8f66afc;hb=81ff113f7852558610855261551410455886cb08;hp=193e00bc88ded286172252159044cc3077de939c;hpb=2c5c22d68e5a0eac05b1f300916cf772a8b29b03;p=thirdparty%2Fbinutils-gdb.git diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 193e00bc88d..069bd758aec 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2472,7 +2472,9 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, asection *dynamic, *glink = NULL, *relplt = NULL; arelent *p; - if (opd != NULL && !bfd_malloc_and_get_section (abfd, opd, &contents)) + if (opd != NULL + && ((opd->flags & SEC_HAS_CONTENTS) == 0 + || !bfd_malloc_and_get_section (abfd, opd, &contents))) { free_contents_and_exit_err: count = -1; @@ -2507,7 +2509,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, size_t extdynsize; void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *); - if (!bfd_malloc_and_get_section (abfd, dynamic, &dynbuf)) + if ((dynamic->flags & SEC_HAS_CONTENTS) == 0 + || !bfd_malloc_and_get_section (abfd, dynamic, &dynbuf)) goto free_contents_and_exit_err; extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; @@ -5536,7 +5539,8 @@ opd_entry_value (asection *opd_sec, if (contents == NULL) { - if (!bfd_malloc_and_get_section (opd_bfd, opd_sec, &contents)) + if ((opd_sec->flags & SEC_HAS_CONTENTS) == 0 + || !bfd_malloc_and_get_section (opd_bfd, opd_sec, &contents)) return (bfd_vma) -1; ppc64_elf_tdata (opd_bfd)->opd.contents = contents; } @@ -7361,7 +7365,9 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) continue; sec = bfd_get_section_by_name (ibfd, ".opd"); - if (sec == NULL || sec->size == 0) + if (sec == NULL + || sec->size == 0 + || (sec->flags & SEC_HAS_CONTENTS) == 0) continue; if (sec->sec_info_type == SEC_INFO_TYPE_JUST_SYMS) @@ -8922,6 +8928,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info) toc = bfd_get_section_by_name (ibfd, ".toc"); if (toc == NULL || toc->size == 0 + || (toc->flags & SEC_HAS_CONTENTS) == 0 || toc->sec_info_type == SEC_INFO_TYPE_JUST_SYMS || discarded_section (toc)) continue;