-/* In GDB 4.9 this routine was a real performance hog. According to
- some gprof data which mtranle@paris.IntelliCorp.COM (Minh Tran-Le)
- sent, almost all the time spend in solib_add (up to 20 minutes with
- 35 shared libraries) was spent here, with 5/6 in
- lookup_minimal_symbol and 1/6 in read_memory.
+/* Allocate the runtime common object file. */
+
+static void
+allocate_rt_common_objfile ()
+{
+ struct objfile *objfile;
+ struct objfile *last_one;
+
+ objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
+ memset (objfile, 0, sizeof (struct objfile));
+ objfile -> md = NULL;
+ obstack_specify_allocation (&objfile -> psymbol_obstack, 0, 0, xmalloc,
+ free);
+ obstack_specify_allocation (&objfile -> symbol_obstack, 0, 0, xmalloc,
+ free);
+ obstack_specify_allocation (&objfile -> type_obstack, 0, 0, xmalloc,
+ free);
+ objfile -> name = mstrsave (objfile -> md, "rt_common");
+
+ /* Add this file onto the tail of the linked list of other such files. */
+
+ objfile -> next = NULL;
+ if (object_files == NULL)
+ object_files = objfile;
+ else
+ {
+ for (last_one = object_files;
+ last_one -> next;
+ last_one = last_one -> next);
+ last_one -> next = objfile;
+ }
+
+ rt_common_objfile = objfile;
+}