This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[1/20] MIPS GOT: Fix an invalid free
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 11 Feb 2013 17:23:11 +0000
- Subject: [1/20] MIPS GOT: Fix an invalid free
- References: <87fw1222fy.fsf@talisman.default>
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;
}