diff options
Diffstat (limited to 'backends/ppc_symbol.c')
-rw-r--r-- | backends/ppc_symbol.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c index 4b32003a..35b14319 100644 --- a/backends/ppc_symbol.c +++ b/backends/ppc_symbol.c @@ -135,7 +135,7 @@ find_dyn_got (Elf *elf, GElf_Addr *addr) /* Check whether given symbol's st_value and st_size are OK despite failing normal checks. */ bool -ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, +ppc_check_special_symbol (Elf *elf, const GElf_Sym *sym, const char *name, const GElf_Shdr *destshdr) { if (name == NULL) @@ -152,7 +152,10 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, return true; } - const char *sname = elf_strptr (elf, ehdr->e_shstrndx, destshdr->sh_name); + size_t shstrndx; + if (elf_getshdrstrndx (elf, &shstrndx) != 0) + return false; + const char *sname = elf_strptr (elf, shstrndx, destshdr->sh_name); if (sname == NULL) return false; |