From 1438dd86cc7b1048a8d1b37754d51d9153123064 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Aug 2020 18:23:38 +0930 Subject: [PATCH] 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. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-m32c.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 38920f3a100..7cf99f68f37 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-08-25 Alan Modra + + PR 26463 + * elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table + before accessing elf fields. + 2020-08-25 Alan Modra PR 26452 diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index d839f624830..a0452d763ba 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -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); -- 2.30.2