This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] mn10300: Don't free cached internal symbol table
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 9 Oct 2017 15:09:43 -0700
- Subject: [committed, PATCH] mn10300: Don't free cached internal symbol table
- Authentication-results: sourceware.org; auth=none
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 | 5 +++++
bfd/elf-m10300.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c14a3bc491..81d27857fc 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 9214a5745c..b5951c6005 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;
--
2.13.6