diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-25 18:23:38 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-25 23:07:10 +0930 |
commit | 1438dd86cc7b1048a8d1b37754d51d9153123064 (patch) | |
tree | 882fd6c94140bec6214ae6772c825b5a734de22c /bfd | |
parent | 2186273ac4ba9fa4c56dc8c5d47ab3a7e358cec9 (diff) | |
download | gdb-1438dd86cc7b1048a8d1b37754d51d9153123064.zip gdb-1438dd86cc7b1048a8d1b37754d51d9153123064.tar.gz gdb-1438dd86cc7b1048a8d1b37754d51d9153123064.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-m32c.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 38920f3..7cf99f6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 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 * som.c (som_compute_checksum): XOR 32-bit words in header, not unsigned long sized words. diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index d839f62..a0452d7 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); |