aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-12-15 14:04:52 +0000
committerTristan Gingold <gingold@adacore.com>2011-12-15 14:04:52 +0000
commit4434114c64d0db91eec28281c20eeef90b52d9c9 (patch)
treeb990d90fd9c1a8305074dc66da19b4fb83905d3c
parent1576bd00ee92a0d0ebd9191ac84a12fd9dde757d (diff)
downloadgdb-4434114c64d0db91eec28281c20eeef90b52d9c9.zip
gdb-4434114c64d0db91eec28281c20eeef90b52d9c9.tar.gz
gdb-4434114c64d0db91eec28281c20eeef90b52d9c9.tar.bz2
2011-12-15 Iain Sandoe <iains@gcc.gnu.org>
* mach-o.c (bfd_mach_o_mkobject_init): Initialize dyn_reloc_cache. (bfd_mach_o_close_and_cleanup): Only cleanup Mach-O private data for object files.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/mach-o.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4c0c375..8acd171 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-15 Iain Sandoe <iains@gcc.gnu.org>
+
+ * mach-o.c (bfd_mach_o_mkobject_init): Initialize dyn_reloc_cache.
+ (bfd_mach_o_close_and_cleanup): Only cleanup Mach-O private data
+ for object files.
+
2011-12-15 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>
* mach-o.c (bfd_mach_o_canonicalize_reloc): Update relocation
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 182f0ef..325cf61 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -3202,6 +3202,7 @@ bfd_mach_o_mkobject_init (bfd *abfd)
mdata->commands = NULL;
mdata->nsects = 0;
mdata->sections = NULL;
+ mdata->dyn_reloc_cache = NULL;
return TRUE;
}
@@ -3765,9 +3766,10 @@ bfd_mach_o_close_and_cleanup (bfd *abfd)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
if (bfd_get_format (abfd) == bfd_object && mdata != NULL)
- _bfd_dwarf2_cleanup_debug_info (abfd, &mdata->dwarf2_find_line_info);
-
- bfd_mach_o_free_cached_info (abfd);
+ {
+ _bfd_dwarf2_cleanup_debug_info (abfd, &mdata->dwarf2_find_line_info);
+ bfd_mach_o_free_cached_info (abfd);
+ }
return _bfd_generic_close_and_cleanup (abfd);
}