diff options
Diffstat (limited to 'backends/ppc64_init.c')
| -rw-r--r-- | backends/ppc64_init.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c index 7ea2b236..56e1828e 100644 --- a/backends/ppc64_init.c +++ b/backends/ppc64_init.c @@ -90,13 +90,16 @@ ppc64_init (elf, machine, eh, ehlen) if (opd_shdr != NULL && (opd_shdr->sh_flags & SHF_ALLOC) != 0 && opd_shdr->sh_type == SHT_PROGBITS - && opd_shdr->sh_size > 0 - && strcmp (elf_strptr (elf, ehdr->e_shstrndx, - opd_shdr->sh_name), ".opd") == 0) + && opd_shdr->sh_size > 0) { - eh->fd_addr = opd_shdr->sh_addr; - eh->fd_data = elf_getdata (scn, NULL); - break; + const char *name = elf_strptr (elf, ehdr->e_shstrndx, + opd_shdr->sh_name); + if (name != NULL && strcmp (name, ".opd") == 0) + { + eh->fd_addr = opd_shdr->sh_addr; + eh->fd_data = elf_getdata (scn, NULL); + break; + } } } } |
