From 1ab8d928977f4d9f137f972d03e079555d0f29fa Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 25 Aug 2020 17:56:08 +0930 Subject: 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(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c3342ca..fbdef4e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 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 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that won't be output. diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index b0644f1..3bd147b 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. */ -- cgit v1.1