aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/symfile-mem.c18
-rw-r--r--gdb/symfile.c4
3 files changed, 10 insertions, 19 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 17f251b..458e218 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-06 Markus Metzger <markus.t.metzger@intel.com>
+
+ * symfile.c (symfile_free_objfile): Remove restriction to
+ OBJF_USERLOADED.
+ * symfile-mem.c (symbol_file_add_from_memory): Call
+ add_target_sections_of_objfile.
+
2014-06-05 Ludovic Courtès <ludo@gnu.org>
* guile/scm-value.c (gdbscm_history_append_x): Use
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index b29421e..ef48f7d 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -92,7 +92,6 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr,
struct section_addr_info *sai;
unsigned int i;
struct cleanup *cleanup;
- struct target_section *sections, *sections_end, *tsec;
if (bfd_get_flavour (templ) != bfd_target_elf_flavour)
error (_("add-symbol-file-from-memory not supported for this target"));
@@ -132,22 +131,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr,
from_tty ? SYMFILE_VERBOSE : 0,
sai, OBJF_SHARED, NULL);
- sections = NULL;
- sections_end = NULL;
-
- if (build_section_table (nbfd, &sections, &sections_end) == 0)
- {
- make_cleanup (xfree, sections);
-
- /* Adjust the target section addresses by the load address. */
- for (tsec = sections; tsec != sections_end; ++tsec)
- {
- tsec->addr += loadbase;
- tsec->endaddr += loadbase;
- }
-
- add_target_sections (&nbfd, sections, sections_end);
- }
+ add_target_sections_of_objfile (objf);
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 64a83c6..7ad4a44 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3892,8 +3892,8 @@ symfile_find_segment_sections (struct objfile *objfile)
static void
symfile_free_objfile (struct objfile *objfile)
{
- /* Remove the target sections of user-added objfiles. */
- if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
+ /* Remove the target sections owned by this objfile. */
+ if (objfile != NULL)
remove_target_sections ((void *) objfile);
}