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.
+2017-01-04 James Clarke <jrtc27@jrtc27.com>
+
+ * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
+ if relocs are cached.
+
2017-01-03 Rich Felker <bugdal@aerifal.cx>
PR ld/21017
if (tsec_relocs == NULL)
return 0;
tsec_relend = tsec_relocs + info->tsec->reloc_count;
- tsec_free = (info->link_info->keep_memory ? NULL : tsec_relocs);
+ tsec_free = (elf_section_data (info->tsec)->relocs == tsec_relocs
+ ? NULL
+ : tsec_relocs);
}
/* Recover the symbol's offset within the section. */