diff options
author | Mark Wielaard <mark@klomp.org> | 2018-09-14 12:28:58 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-09-14 12:28:58 +0200 |
commit | 029c76f0d4b06584e370b5fc0112712ba99a6219 (patch) | |
tree | 20c91ff0dc7125251b26ded357e71c542b67d5cc /backends/aarch64_symbol.c | |
parent | 94c975eefdfbfa9319b7bab69600c76fe6be7910 (diff) | |
parent | 52b6b2f1f49e7385527e9f311f248092be0c0b61 (diff) |
Merge branch 'master' into mjw/RH-DTSdts-0.174
elfutils 0.174 release
Removed new M68K and RISCV tests.
Diffstat (limited to 'backends/aarch64_symbol.c')
-rw-r--r-- | backends/aarch64_symbol.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backends/aarch64_symbol.c b/backends/aarch64_symbol.c index da3382e9..dfd755a5 100644 --- a/backends/aarch64_symbol.c +++ b/backends/aarch64_symbol.c @@ -62,13 +62,16 @@ aarch64_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) https://bugzilla.redhat.com/show_bug.cgi?id=1201778 */ bool -aarch64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, +aarch64_check_special_symbol (Elf *elf, const GElf_Sym *sym, const char *name, const GElf_Shdr *destshdr) { if (name != NULL && strcmp (name, "_GLOBAL_OFFSET_TABLE_") == 0) { - 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 && (strcmp (sname, ".got") == 0 || strcmp (sname, ".got.plt") == 0)) { @@ -79,7 +82,7 @@ aarch64_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); if (shdr != NULL) { - sname = elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name); + sname = elf_strptr (elf, shstrndx, shdr->sh_name); if (sname != NULL && strcmp (sname, ".got") == 0) return (sym->st_value >= shdr->sh_addr && sym->st_value < shdr->sh_addr + shdr->sh_size); |