PR26463, ASAN: m32c_elf_relax_section elf32-m32c.c:1448

PR 26463
	* elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
	before accessing elf fields.
This commit is contained in:
Alan Modra
2020-08-25 18:23:38 +09:30
parent 2186273ac4
commit 1438dd86cc
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2020-08-25 Alan Modra <amodra@gmail.com>
PR 26463
* elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
before accessing elf fields.
2020-08-25 Alan Modra <amodra@gmail.com>
PR 26452

View File

@ -1445,7 +1445,8 @@ m32c_elf_relax_section
bfd_byte *shndx_buf = NULL;
int machine;
if (abfd == elf_hash_table (link_info)->dynobj
if (is_elf_hash_table (link_info->hash)
&& abfd == elf_hash_table (link_info)->dynobj
&& (sec->flags & SEC_LINKER_CREATED) != 0
&& strcmp (sec->name, ".plt") == 0)
return m32c_elf_relax_plt_section (sec, link_info, again);