Since bfd_elf_sym_name returns bfd_symbol_error_name for invalid symbol,
name, return error if bfd_elf_sym_name returns bfd_symbol_error_name.
PR ld/33501
* elf32-i386.c (elf_i386_scan_relocs): Return error for invalid
symbol name.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
/* Fake a STT_GNU_IFUNC symbol. */
h->root.root.string = bfd_elf_sym_name (abfd, symtab_hdr,
isym, NULL);
+ if (h->root.root.string == bfd_symbol_error_name)
+ goto error_return;
h->type = STT_GNU_IFUNC;
h->def_regular = 1;
h->ref_regular = 1;
/* Fake a STT_GNU_IFUNC symbol. */
h->root.root.string = bfd_elf_sym_name (abfd, symtab_hdr,
isym, NULL);
+ if (h->root.root.string == bfd_symbol_error_name)
+ goto error_return;
+
h->type = STT_GNU_IFUNC;
h->def_regular = 1;
h->ref_regular = 1;