This is the mail archive of the 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]

[committed] MIPS/BFD: Fix assertion in `mips_elf_sort_hash_table'

Move the assertion on non-NULL `htab' in `mips_elf_sort_hash_table' to 
the beginning, before the pointer is dereferenced (`mips_elf_hash_table 
(info)' and `elf_hash_table (info)' both point to the same memory 
location, differently typed).

	* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
	non-NULL `htab' to the beginning.
Index: binutils/bfd/elfxx-mips.c
--- binutils.orig/bfd/elfxx-mips.c	2017-02-01 14:50:03.082396853 +0000
+++ binutils/bfd/elfxx-mips.c	2017-02-02 00:56:23.581898707 +0000
@@ -3832,12 +3832,12 @@ mips_elf_sort_hash_table (bfd *abfd, str
   struct mips_elf_hash_sort_data hsd;
   struct mips_got_info *g;
-  if (elf_hash_table (info)->dynsymcount == 0)
-    return TRUE;
   htab = mips_elf_hash_table (info);
   BFD_ASSERT (htab != NULL);
+  if (elf_hash_table (info)->dynsymcount == 0)
+    return TRUE;
   g = htab->got_info;
   if (g == NULL)
     return TRUE;

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