From: H.J. Lu Date: Mon, 9 Oct 2017 22:05:03 +0000 (-0700) Subject: mn10300: Don't free cached internal symbol table X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=478c006f9b4a64d59c31aed081c14c1d7dd4ba68;p=binutils-gdb.git mn10300: Don't free cached internal symbol table Since ELF linker may cache internal symbol table in init_reloc_cookie, we should check if it is cached, before free it. * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached isymbuf. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c14a3bc4910..81d27857fc1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2017-10-09 H.J. Lu + + * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached + isymbuf. + 2017-10-09 H.J. Lu * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 9214a5745cb..b5951c60054 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1377,7 +1377,7 @@ mn10300_elf_check_relocs (bfd *abfd, result = TRUE; fail: - if (isymbuf != NULL) + if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); return result;