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]

[1/20] MIPS GOT: Fix an invalid free


mips_got_entries are allocated by bfd_alloc, so shouldn't be freed.
I hit this during the first attempt at some of the later patches.

I applied this one to the 2.23 branch too.

Richard


bfd/
	* elfxx-mips.c (mips_elf_recreate_got): Remove free.
	(mips_elf_resolve_final_got_entries): Remove bogus comment.

Index: bfd/elfxx-mips.c
===================================================================
--- bfd/elfxx-mips.c	2013-02-11 14:06:20.528069474 +0000
+++ bfd/elfxx-mips.c	2013-02-11 14:06:30.264141655 +0000
@@ -4002,8 +4002,6 @@ mips_elf_recreate_got (void **entryp, vo
     }
   if (*slot == NULL)
     *slot = entry;
-  else
-    free (entry);
   return 1;
 }
 
@@ -4027,8 +4025,6 @@ mips_elf_resolve_final_got_entries (stru
       if (new_got == NULL)
 	return FALSE;
 
-      /* Each entry in g->got_entries has either been copied to new_got
-	 or freed.  Now delete the hash table itself.  */
       htab_delete (g->got_entries);
       g->got_entries = new_got;
     }


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