[1/20] MIPS GOT: Fix an invalid free
Richard Sandiford
rdsandiford@googlemail.com
Mon Feb 11 17:23:00 GMT 2013
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;
}
More information about the Binutils
mailing list