diff --git a/gdb/coffread.c b/gdb/coffread.c index 3789995..186c8d2 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -468,8 +468,6 @@ coff_symfile_init (struct objfile *objfile) find this causes a significant slowdown in gdb then we could set it in the debug symbol readers only when necessary. */ objfile->flags |= OBJF_REORDERED; - - init_entry_point_info (objfile); } /* This function is called for every section; it finds the outer diff --git a/gdb/machoread.c b/gdb/machoread.c index 6a6eaa1..c0e6d90 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -79,7 +79,6 @@ static void macho_symfile_init (struct objfile *objfile) { objfile->flags |= OBJF_REORDERED; - init_entry_point_info (objfile); } /* Add a new OSO to the vector of OSO to load. */ diff --git a/gdb/symfile.c b/gdb/symfile.c index bc4f40a..f182617 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -929,8 +929,8 @@ read_symbols (struct objfile *objfile, int add_flags) an extra symbol file such as dynamically loaded code, and wether breakpoint reset should be deferred. */ -void -syms_from_objfile (struct objfile *objfile, +static void +syms_from_objfile_1 (struct objfile *objfile, struct section_addr_info *addrs, struct section_offsets *offsets, int num_offsets, @@ -943,11 +943,19 @@ syms_from_objfile (struct objfile *objfile, gdb_assert (! (addrs && offsets)); clear_ada_sym_cache (); - init_entry_point_info (objfile); objfile->sf = find_sym_fns (objfile->obfd); if (objfile->sf == NULL) - return; /* No symbols. */ + { + int num_sections = bfd_count_sections (objfile->obfd); + size_t size = SIZEOF_N_SECTION_OFFSETS (num_offsets); + + objfile->num_sections = num_sections; + objfile->section_offsets + = obstack_alloc (&objfile->objfile_obstack, size); + memset (objfile->section_offsets, 0, size); + return; /* No symbols. */ + } /* Make sure that partially constructed symbol tables will be cleaned up if an error occurs during symbol reading. */ @@ -1028,6 +1036,17 @@ syms_from_objfile (struct objfile *objfile, xfree (local_addr); } +void +syms_from_objfile (struct objfile *objfile, + struct section_addr_info *addrs, + struct section_offsets *offsets, + int num_offsets, + int add_flags) +{ + syms_from_objfile_1 (objfile, addrs, offsets, num_offsets, add_flags); + init_entry_point_info (objfile); +} + /* Perform required actions after either reading in the initial symbols for a new objfile, or mapping in the symbols from a reusable objfile. ADD_FLAGS is a bitmask of enum symfile_add_flags. */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 2e562ed..e340b39 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1927,8 +1927,6 @@ xcoff_symfile_init (struct objfile *objfile) find this causes a significant slowdown in gdb then we could set it in the debug symbol readers only when necessary. */ objfile->flags |= OBJF_REORDERED; - - init_entry_point_info (objfile); } /* Perform any local cleanups required when we are done with a particular