This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR22067, x86 check_relocs invalid read


Committed as obvious.

	PR 22067
	* elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.

diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 61244f5..9c0dcbbe 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -41,7 +41,8 @@
 #define ELIMINATE_COPY_RELOCS 1
 
 #define elf_x86_hash_table(p, id) \
-  (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) == (id) \
+  (is_elf_hash_table ((p)->hash) \
+   && elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) == (id) \
     ? ((struct elf_x86_link_hash_table *) ((p)->hash)) : NULL)
 
 /* Is a undefined weak symbol which is resolved to 0.  Reference to an

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]