]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bfd: alpha: Fix crash caused by double free with --no-keep-memory
authorJames Clarke <jrtc27@jrtc27.com>
Tue, 3 Jan 2017 16:15:15 +0000 (16:15 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 3 Jan 2017 22:32:28 +0000 (09:02 +1030)
commit2403cae2237d8a1d2d404651e63dd5f82cad98a6
tree3a76edd354ed20141bf47e081131bb1de8734c02
parentd04aef026988fde0340339be94666311849561cb
bfd: alpha: Fix crash caused by double free with --no-keep-memory

Without this, ld has been seen to crash in libc when freeing tsec_free:

*** Error in `/usr/bin/ld': double free or corruption (!prev): 0x0000000120ceb6a0 ***

_bfd_elf_link_read_relocs will always return the cached value if
present, even if keep_memory is false, therefore setting tsec_free to
NULL only when keep_memory is true is not sufficient.

* elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
if relocs are cached.
bfd/ChangeLog
bfd/elf64-alpha.c