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.
This commit is contained in:
H.J. Lu 2017-10-09 15:05:03 -07:00
parent 9d45a7de8b
commit 478c006f9b
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
* elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
isymbuf.
2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
* elf32-bfin.c (bfin_size_dynamic_sections): Don't create the

View File

@ -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;