aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
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 /bfd/elf-m10300.c
parent9d45a7de8b80336b9965ee99353c34be85b1b98f (diff)
downloadgdb-478c006f9b4a64d59c31aed081c14c1d7dd4ba68.zip
gdb-478c006f9b4a64d59c31aed081c14c1d7dd4ba68.tar.gz
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.
Diffstat (limited to 'bfd/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c2
1 files changed, 1 insertions, 1 deletions
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;