aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-09 15:05:03 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-09 15:05:03 -0700
commit478c006f9b4a64d59c31aed081c14c1d7dd4ba68 (patch)
tree096d9d422e7a2d3bad3a3db4e14fcaea790d72d0
parent9d45a7de8b80336b9965ee99353c34be85b1b98f (diff)
downloadfsf-binutils-gdb-478c006f9b4a64d59c31aed081c14c1d7dd4ba68.zip
fsf-binutils-gdb-478c006f9b4a64d59c31aed081c14c1d7dd4ba68.tar.gz
fsf-binutils-gdb-478c006f9b4a64d59c31aed081c14c1d7dd4ba68.tar.bz2
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.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-m10300.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c14a3bc..81d2785 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
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
.interp section with "ld --no-dynamic-linker".
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 9214a57..b5951c6 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;