From 1ab8d928977f4d9f137f972d03e079555d0f29fa Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Aug 2020 17:56:08 +0930 Subject: [PATCH] PR26505, ASAN: xstormy16_elf_relax_section elf32-xstormy16.c:595 PR 26505 * elf32-xstormy16.c (xstormy16_elf_relax_section): Check is_elf_hash_table before accessing elf fields. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-xstormy16.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c3342ca0966..fbdef4e5c75 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-08-25 Alan Modra + + PR 26505 + * elf32-xstormy16.c (xstormy16_elf_relax_section): Check + is_elf_hash_table before accessing elf fields. + 2020-08-25 Alan Modra PR 26482 diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index b0644f17bdd..3bd147bc358 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -588,7 +588,8 @@ xstormy16_elf_relax_section (bfd *dynobj, /* Assume nothing changes. */ *again = FALSE; - if (bfd_link_relocatable (info)) + if (bfd_link_relocatable (info) + || !is_elf_hash_table (info->hash)) return TRUE; /* We only relax the .plt section at the moment. */ -- 2.30.2