diff --git a/bfd/elf.c b/bfd/elf.c index 42ae162..dd7efd8 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -498,6 +498,19 @@ bfd_elf_get_elf_syms (bfd *ibfd, /* Convert the symbols to internal form. */ isymend = intsym_buf + symcount; + { + /* arm32 deals with names during the call of (*swap_symbol_in). + * It thus needs to associate the correct strings to the + * symbols. So we temporarily redefine the private data with + * the correct symtab_hdr so that using elf_symtab_hdr (ibfd) + * will give the correct information and we restore after in + * order to keep it as it for the various callers. + */ + Elf_Internal_Shdr bak; + + bak = elf_symtab_hdr (ibfd); + elf_symtab_hdr (ibfd) = *symtab_hdr; + for (esym = (const bfd_byte *) extsym_buf, isym = intsym_buf, shndx = extshndx_buf; isym < isymend; @@ -512,8 +525,11 @@ bfd_elf_get_elf_syms (bfd *ibfd, if (alloc_intsym != NULL) free (alloc_intsym); intsym_buf = NULL; + elf_symtab_hdr (ibfd) = bak; goto out; } + elf_symtab_hdr (ibfd) = bak; + } out: if (alloc_ext != NULL)