mn10300: Don't free cached internal symbol table
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Oct 2017 22:05:03 +0000 (15:05 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 9 Oct 2017 22:05:03 +0000 (15:05 -0700)
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.

bfd/ChangeLog
bfd/elf-m10300.c

index c14a3bc491032f8725b00a8a9f3b2196d81a7f39..81d27857fc1ca1d456a95f0935bffb1b05325092 100644 (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
index 9214a5745cbda1387bf95ef9285e68977124dbb4..b5951c6005466a102623b10b2ecae0c4acaf974f 100644 (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;
This page took 0.032424 seconds and 4 git commands to generate.